A sequence of point coordinates referring to the line segments connecting them, as used to represent a one-dimensional feature or object.

learn more… | top users | synonyms

3
votes
0answers
26 views

Can I reorder the points in a GEOS LineString?

Using libgeos, when I buffer() a polygon and then getExteriorRing() [to make a slightly smaller outline copy of the polygon just inside the original], it seems that which point on the new geometry is ...
1
vote
1answer
172 views

How to transform isolines to isopolygons with postgis?

I have a table a postgis table of isolines that's defined like this: CREATE TABLE myisolines ( gid serial NOT NULL, isotime timestamp without timezone, val numeric(10,4), geom ...
0
votes
1answer
315 views

Check if a point cordinate is between linestring cordinates

I know that, linestring is a vector and if i want to check that, if point cordinates are between linestring begginning and ending cordinates then i need to use vector comparison (x2 > x && ...
1
vote
1answer
17 views

Convert KML polygons to lines

I've been given a KML file which should consist of linear features (train lines), but for some reason they're all represented as <Polygon> types. Each appears to have the right data, from end of ...
3
votes
1answer
251 views

MySQL select linestrings into a multilinestring

I have a mysql column of linestring type with 2000 linestrings (high water mark values to be more specific). I want to merge them into one multilinestring so i can see what the shape of these values ...
1
vote
0answers
70 views

Using TIGER/Line shape files, how do I get address coordinates?

I've downloaded addressfeature shapefiles from TIGER/Line on the Census Bureau website. I converted one file to CSV using ogr2ogr. I get the following sample output: ...
4
votes
0answers
262 views

PostGIS 2.0 st_geomfromgml using LineString fails with invalid GML representation

I am attempting to insert a geometry into a table using the st_geomfromgml function. The GML is being sourced from a Geoserver WFS request. The function call looks like this ...
1
vote
1answer
293 views

Using Python in Arcmap to partition strings [closed]

I have a title "Text that remains Proposed Thing to replace" var_a = New Text I want the output to be "Text that remains Proposed New text" Currently outputs this "(u'Text that ...
3
votes
3answers
3k views

Creating point to center of polyline?

I'm trying to create a points in the middle of polylines. The data is now in the form of shapefile. Is there an easy way to do this?
12
votes
4answers
244 views

How to create lines to visualize differences between polygon features in PostGIS?

I've a PostGIS table polygon_b with some polygon features. There is also a table polygon_a which contains the same polygons as polygon_b but with minor changes. Now I want to create lines to visualize ...
2
votes
2answers
106 views

PostGIS get the distance between two points over a linestring

I have a linestring: LINESTRING(-1.3326397 50.9174932,-1.3319842 50.9166939) and I select two points that lay on that linestring. I would like to get the distance between these two points (in ...
2
votes
1answer
52 views

Bring a list of unsorted linestrings in order so that they form a path from origin to destination

I have a table of linestrings together with some attributes that, when displayed all at the same time, represent a connected path from an origin to a destination (each linestring has one predecessor, ...
2
votes
0answers
460 views

How to add an offset to a GeoJSON layer in Leaflet?

Using the example GeoJSON tutorial code at leafletjs.com. Change the myLines variable so that the two lines overlap, but run in opposite directions as follows: var myLines = [{ "type": ...
2
votes
1answer
60 views

Get LineString length in meters (Python, GEODjango)

In a Django model, I have a LineString field which holds GPS coordinates of a street route. I know that I the .length holds the length of the LineString, but I don't know what unit the returned value ...
6
votes
1answer
5k views

How can I transform a polygon to a linestring in QGIS?

I have a polygon, imported from a shapefile in QGIS. I would like transform it to a linestring instead so I can save it as a GPX file later. How can I transform a polygon to a linestring in QGIS?
5
votes
2answers
125 views

How to use ST_Difference to create linestrings from non-intersecting polygon boundaries?

There are two tables with polygon features in my PostgreSQL database. I want to create linestring features where the boundries of the polygons are not intersecting. CREATE TABLE schema.poly_a ( gid ...
2
votes
1answer
51 views

Creating line-strings from points in MySQL

I am extracting the lat/long information from Geo-tagged images and storing them in MySQL. I want to get a line-string from the points, I looked into the GROUP_CONCAT() function but I am not able to ...
4
votes
1answer
90 views

Find all intersections of a LineString and a Polygon and the order in which it intersects it

I would like to find out all intersections of a LineString (River) through Polygons (Municipalities). I would like to list the order of municipalities which the river crosses, using linear ...
7
votes
4answers
5k views

How to extract POINT from a [LINE|MULTILINE]STRING

I'd like to create a vectorLayer in QGIS to display all the points that form a LINESTRING or a MULTILINESTRING stored in a PostGIS DB. I think that I need to transform all points of LINESTRING (or ...
1
vote
2answers
218 views

Densify a JTS LINESTRING (add points)

I have a LineString I would like to "soften" in a way that if two coordinates (vertices) in the LineString are very far apart, I want to automatically add some coordinates in between. The line ...
3
votes
0answers
28 views

Postgis - Construct linestring of length N

Give a table of linestrings (roads) ogc_fid, wkb_geometry And a road with ogc_fid = X In postgis how could I construct a linestring that is of length Y metres made up of roads starting from road ...
0
votes
1answer
26 views

Linestring in OpenLayers doesn't draw

I don't understand why my code doesn't work. If the map is displayed, the line is never drawn: <script> var long_deb = -1.28627; var lat_deb = 43.49829; var long_fin = -1.29394; var lat_fin = ...
1
vote
1answer
70 views

Finding and merging lines that touch in PostGIS?

I would like to select and merge segments that touch like in the image below. My table contains single segments with their own id (shown in the figure), I just want to isolate single "group" of ...
4
votes
2answers
64 views

Get the 2 points immediately before and after a given point in PostGIS

In the picture below: The given point is C, I would like to select A and B, but not Z (which is closer to C than B but it's not immediately after in the LineString). Note that C is always ON the line ...
4
votes
1answer
1k views

leaflet - Drawing line following the road

Short version: What I wish to be able to do is drawing a polyline along part of a road. In that way marking certain houses, along this road. Long Version: I have several houses that I wish to mark ...
1
vote
1answer
111 views

In PostGIS: how to split linestrings into their individual segments?

I have one table with many linestrings and I want to make a new table containing the individual segments of all the linestrings, no matter if they are grouped line per line or not. This is my ...
1
vote
2answers
162 views

How to get the LineStrings from a MultiLineString

I was wondering if there is a way I can extract the LineStrings from a MultiLinestring object. What I am really trying to do is look into a MultiLineString and see if I have a certain LineString. I ...
6
votes
2answers
205 views

What controls the direction of TopoGeometry Linestrings?

In PostGIS, what if anything controls the direction that topogeometry LINESTRINGs will have when converted to geometry? It doesn't appear to be the order in which the edges are listed in the call to ...
1
vote
1answer
26 views

Finding zero-length LINESTRINGs the wrong way gives funny answer

I tried select st_astext(geom) from table where st_pointn(geom, 1) = st_pointn(geom, 2) But I get some results which don't match the criteria. For example: LINESTRING(-117.1642086 ...
1
vote
1answer
92 views

Determine points where a LineString meets the boundaries of a Polygon using Turf.js

Using Turf, I'm trying to determine the points at which a line (LineString) meets the boundaries of a polygon. Turf has the ability to do point-in-polygon/point-on-line and polygon intersections etc, ...
-1
votes
1answer
43 views

JSON to line string

I'm getting a JSON return like so: ...
0
votes
1answer
167 views

MapServer: Symbol (v-line) style that automatically follows line direction

I created this image: with: MAP SIZE 1000 1000 IMAGETYPE png24 EXTENT -30 -10 60 30 UNITS DD SYMBOL NAME "v-line-shift" TYPE vector POINTS 0 0 5 10 10 0 END # ...
5
votes
2answers
384 views

Counting self intersections of linestring using PostGIS?

Is there a way of using PostgreSQL + PostGIS for finding the number of self intersections in a linestring? I have a linestring that goes forward but in circles, and I need to find the number of times ...
2
votes
2answers
70 views

PostGIS - Merging linestrings into multilinestrings in a particular order

I have a set of linestrings, which I want to group into a single multilinestring, and in a specific order. However, when I use ST_Collect, it merges them out of order, like this: Geometries as ...
2
votes
3answers
90 views

How to remove identical lines from layer in QGIS?

I converted polygon layer to line layer using "Polygons to Lines" tool. Then I used "Split" function of the Networks plugin. What I need to do next is to remove identical lines that were shared ...
5
votes
0answers
220 views

How do I simplify the straight sections of (multi)Linestring in PostGres/PostGis leaving the curved sections untouched

I have (multi)linestrings containing upwards of 5000 points and I want to perform two simplifications possibly using Ramer Douglas Peucker or alternative methods in PostGis The (multi)linestrings ...
3
votes
2answers
359 views

How to recalculate the the length of a geography linestring from nearby geography point in POSTGIS?

I have a geography type linestring *route_geography geography(LineString,4326)*, its a route from point A to point B. Now I have a point C near that line. I want to find the nearest point on that ...
2
votes
1answer
80 views

How to export a CSV with lat lon WKT from a layer which is not in WGS84?

I want to extract a csv with lat and lon coordinates so I select -- Geometry AS_WKT but when the csv is created I see this LINESTRING (277054.55782319931 198725.03588318737,277052.43701817648 ...
0
votes
0answers
70 views

Drawing lineString in Google Earth API

I am able to draw a Polygon on the Google Earth API which is integrated in my website but i have to draw a lineString. Does anybody can help me? Here is the code i use to draw the polygon: function ...
0
votes
0answers
208 views

google maps api with polyline not displaying lines

I converted shape files into mysql table that has features like LINESTRING and MULTILINESTRING. I am using google maps api ( var shape = new google.maps.Polyline({path: ...
0
votes
1answer
157 views

Multipolygon From Multilinestring PostGis

I have been looking for a answer for days. I dont even know if its possible. Tried: ST_AsGeoJson(ST_MakePolygon(ST_transform(geom,4326))) ERROR: Shell is not a line ...
1
vote
0answers
57 views

need to split some linestrings by points

please help me, i'm new in gis 1) i have а table with geom railways, which are multilinestrings (for example there are 2 ways one of which is interrupted, so this way will be multilinestrings ...
2
votes
1answer
229 views

How to detect if point is on the left or right side of the line in PostGIS

I have a linestring table and a point table in postgis. I know the closest line to any given point. What I need to know is on which "side" of that line is the point. I guess I have to do that by ...
0
votes
0answers
78 views

Drawing Lines Between Postal Codes in Fusion Tables

I'm using Google Fusion Tables and have two columns of corresponding postal codes. Fusion Tables automatically converts postal codes to coordinates (the centroids of each postal code) upon import. ...
1
vote
0answers
42 views

Postgis ST_AsSVG renders a tiny SVG

I am storing information about a person's journey as a linestring. Having recently discovered ST_AsSVG I tried the following query: SELECT ST_AsSVG(path) FROM activities WHERE id = 209 ...
2
votes
0answers
33 views

match noisy GPS data to closest linestring in road network [duplicate]

I have some noisy GPS data(Points) that they are not exactly on the road because of the noise. But I want to match them to the closest road linestrings. How to do this in PostgreSQL? Data: ...
0
votes
1answer
97 views

Spatial query ST_CONTAINS returns empty result

I want to create a database view in Postgres/PostGIS which returns a subset of the points stored in another table called locations. The subset is defined by an area stored in yet another table called ...
2
votes
2answers
193 views

Merging linestrings in QGIS using PostgreSQL and PostGIS

I've to merge all linestrings from a PostgreSQL table "river" where not more than two start-/endpoints are overlapping. In the illustration below I use a "M" to mark all linestrings that needs to be ...
4
votes
1answer
2k views

How to create polyline of varying distance from origin point using azimuth?

I am looking for a Python script that does the following: Uses a point (from a point shapefile) as the origin. Creates about 3 km line from point Based on an azimuth provided in the original point ...
2
votes
3answers
362 views

postgis linestring segmentation in 4326

How can I divide a single postgis linestring with SRID 4326 into segments (preferably an array of linestrings) with no segment longer than a given distance? I've tried st_segmentize(), but it spits ...