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

2
votes
1answer
29 views

ST_LineMerge doesn't return LineString

I want to create a LINESTRING from a MULTILINESTRING. However in the following case ST_MultiLineString is returned: Select ST_GeometryType(ST_LineMerge(ST_AsText(' MULTILINESTRING( (-70.52570888 ...
1
vote
0answers
15 views

Postgis - st_MakeLine and st_lineLocatePoint

Lets explain, I have 4 points (1,2,3,4), and I need to visit clients (A, B, C, D). So, I need to use st_makeline with (1,2,3,4,3)... Now I have to get % position from A,B,C,D; but in visit order. ...
0
votes
1answer
38 views

What is the best way to get two points along the line in both directions using postgis?

I have a point on a linestring geometry (found by an intersection). What is the best way to get two points along the line in both directions using postgis? It does not really matter if the points ...
0
votes
1answer
26 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 && ...
2
votes
0answers
15 views

Extract from a linestring layer, groups of linestrings to a multilinestring objects layer

I've got a linestring layer with thousands of linestrings. I want to extract groups of linestrings to individual multilinestring objects. In the following picture you can see a part of the layer ...
2
votes
0answers
15 views

SQL Server, Given a linestring with M value, what is the location of this other M value

We are investigating migrating a prototype into SQL Server (azure). We have LineStrings that also have M values. What we would like to do is given another M value find out what its geographical ...
0
votes
1answer
47 views

QSpatiaLite Plugin: LINESTRINGZ(x y z, …) supported?

I get an error when trying to import this query as a spatial table in QGIS: select geomFromText('LINESTRING Z(13.091464 47.061328 2597, 13.092059 47.061287 2580)') as geometry 'The result can't ...
0
votes
0answers
15 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: ...
0
votes
1answer
24 views

Postgis: Conflation of two vector layers into a single layer

If I have table A that I consider to be definitive and table B that may have some elements missing from table B but also has geometries that are "close" to those in A that I want to ignore. How could ...
0
votes
1answer
32 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 ...
1
vote
1answer
29 views

How to use gdal's “forceToLineString()” with Python

I'm working with Python and GDAL and I'm quite new to this ^^ For my script I'm looking for a method to convert a MultiLineString into a simple LineString. Example: MULTILINESTRING ((0 0,0 1),(0 1,0 ...
2
votes
0answers
116 views

Get Distance between two point on linestring using mysql Spatial

I have a linestring and two point on this linestrin according to my picture i want distance between two point as base of linestring please hellp me
1
vote
1answer
82 views

How to find a point on linestring and in a range of 10 meter

i have a linestring which is show in diagram and i have a point which is some time on the linestring or out of linestring but in range which is red line and some time its is out of range so how can i ...
1
vote
1answer
40 views

Index to speed up ST_HausdorffDistance?

When comparing similarity of linestrings with ST_HausdorffDistance (or another type of similarity function), is there a way to use an index to speed up the search for similar linestrings?
2
votes
0answers
86 views

Splitting Line.shp at Point.shp with Python/ogr

I'm trying to modify some ESRI Shapefiles using Python with gdal/ogr module. What I want to do is quite simple, but I didn't find any solution by now. I have two shapefiles: (1) Lines.shp and (2) ...
0
votes
1answer
63 views

Check if point is near a linestring Spatialite

I have a LINESTRING made of two points start point and end point in spatialite. UPDATE points SET road_geometry = GeomFromText('LINESTRING(24.889142 67.196188, 24.889673 67.196579)',4326) where ...
6
votes
1answer
125 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
49 views

Closed Linestring

I've created a linestring using st_makeline(). When I draw this linestring using QGIS it always makes it closed. The start and end points are not the same and I verified by using st_startpoint() and ...
1
vote
0answers
66 views

Postgis - Split linestring between point A and B

I need to find the different trajectories between point A and B. In the image is possible to see 2 differents trajectories. The way i use to calculate them is: Found the min time and the max time (in ...
3
votes
1answer
79 views

How to find intersected line is from left or right on another line?

There is a main LineString and its direction is known. I want to find the side of intersected lines to this main line. Example image: Black line is main LineString and red one is intersected ...
5
votes
2answers
235 views

Split lines at intersection points

I've got some linestrings covering a road network, and need to split them at the crossroads. Does anybody have any idea on how to do it? I'm using QGIS 2.4, with a Postgis 2.1.3.
3
votes
1answer
70 views

Bounding box of a set of MULTILINESTRINGs PostGIS

I have a PostGIS table with a geometry column (geom) and a type column. The geom column contains only MULTILINESTRINGs and the type column contains tags that tell me what each MULTILINESTRING ...
1
vote
1answer
58 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 ...
3
votes
1answer
110 views

PostGIS: Get closest point between geometry and Multipoint

I think my question is not that difficult for GIS professionals, but i didn't found an answer to my problem (even not in other questions). Problem: I have given two tables (table1,table2) with Points ...
0
votes
2answers
68 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
1answer
211 views

OpenLayers: How to get *real* centroid of a Line Geometry/Feature?

I have declared a line geometry as: var lineString = new OpenLayers.Geometry.LineString([source,target]); then I am trying to get the centroid of this lineString as lineString.getCentroid(). But ...
1
vote
0answers
141 views

OpenLayers - Add points at vertices of line while drawing line

I would like to create points while I draw a line on my map in OpenLayers. That is, at each vertices of a line and at the end points there is a shape like a square, circle, or diamond. I have this ...
3
votes
1answer
188 views

Find the closest line vertex from the linestring using PostGIS

How to find the closest line vertex from a linestring? ST_ClosestPoint will give a point which is not from the linestring.
1
vote
1answer
105 views

PostGIS - Intersects feature to split into linestring

I would like to know if it's possible to intersect feature datasets (multipolygon, polygon, multilinestring and linestring) to get a result as a set of linestrings being split at each intersection ...
0
votes
1answer
40 views

ValueError when instantiating LineString from a mix of tuples and Point objects

I'm new to Shapely, and tried instantiating a LineString object from a mix of tuples and Point objects like this: >>> LineString([Point(1,2),(2,3),Point(3,4),(5,5)]) I get the following ...
3
votes
1answer
128 views

Showing Linestring from SQL statement with CartoDB

I have cartodb sql statement to return what polygons are intersected by a linestring, but I'd like to have the linestring visualized over the polygons on the results. Also not add the linestring to ...
1
vote
1answer
191 views

Distance Between Two Points vs Length of Linestring

So I have two points that I want to calculate the distance between. If I use: SELECT ST_Distance_Spheroid(point_a, point_b, 'SPHEROID["GRS 1980",6378137,298.257222101]') / 1000 FROM ( ...
1
vote
1answer
37 views

Linestring to CartoDB api

I want to add a linestring to a CartoDB API web app for one time use, I have SQL statement being ran at the same time and just want the linestring in the SQL statement to be displayed.
1
vote
1answer
40 views

Display linestring on Cartodb with SQL

I have a Cartodb api for a separate map, I need to display a linestring for each time the sql is run, but not store the linestring in the database.
1
vote
2answers
189 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
1answer
237 views

Merge multiple linestring features into a single multilinestring

Using QGis or ogr2ogr how do I convert a vector file containing multiple linestrings features into a single multilinestring feature? At the moment I've been doing this manually by converting the data ...
2
votes
2answers
70 views

How to extract a new linestring vector from a existing multipolygon in QGIS?

What I want to do: create a new line (named linestring in Postgis?) from existing multipolygon layer in Postgis. Purpose: once these lines are created, I'll run some distance calcs from specific ...
3
votes
1answer
148 views

Calculate distance between point and linestring and how to represent that on QGIS?

I have loaded my data with osm2pgrouting and I have my network with ways (Linestring) and nodes (Point). The problem is : I have a database of doctors addresses (point) and I should calculate the ...
0
votes
0answers
77 views

Offset WGS84 linestring based on pixel values

I would like to split up some roads based on their driving direction. For this, I need to offset the roads 2 pixels to the right, in the direction of the linestring. I have the coordinates in WGS84 ...
0
votes
0answers
58 views

Know if MBR contains any POINT of LINESTRING

I have a table with a Geometry column. This column only has LINESTRING. This LINESTRING only has two POINTS. If i have a MBR, i need to know which of LINESTRING of my Table has some of its POINTS ...
2
votes
1answer
191 views

How to extend a straight line in postgis?

I have a postgis table of simple linestrings, each one is a straight line with just two points. I want to select every linestring, but extended from both sides by 1 meter. So i have lines, that are ...
0
votes
1answer
28 views

Geometry conversion problem.Data loss

I was trying to convert a roadnetwork table.Its geometry contains both MULTILINESTRING and LINESTRING.I converted all the MULTILINE string to Linestring using the query update all_india_merge set ...
0
votes
0answers
98 views

Multiline String to Linestring conversion

I have road network table which is multilinestring.I was trying to convert this file to Linestring using the following query ALTER TABLE multiline ALTER COLUMN the_geom TYPE geometry(linestring,4030) ...
4
votes
2answers
565 views

How to group connected linestrings in PostGIS?

I have a table of streets I've selected based on a set of attributes (let's say it's speed_limit < 25). There are groups of streets that are locally contiguous; I'd like to group these sets of ...
1
vote
1answer
157 views

How to cluster similar lines in PostGIS?

In PostGIS I have a large database of linestrings which I have obtained using ST_makeline function. I would like to cluster similar lines based on where the lines start and end. Here is an example ...
4
votes
1answer
231 views

Calculating “travelled distance” of a GPS track without including “stops”

I have a set of GPS tracks from a cycling event and I want to correlate their distance along the route. Problem is: when a rider stops, generally by entering a covered place, GPS keeps logging (low ...
4
votes
2answers
220 views

How to speed up a query for nearest linestring to point data

I have processed a Strahler stream order layer with a lot of river linestrings (type: Multilinestring) and their corresponding strahler number (see information here). Besides I have a point layer. I ...
2
votes
2answers
206 views

Switch coordinates in linestring

I made a silly mistake: when creating linestrings in my PostGis database i inverted the lon and lat values. Which isn't a problem for postgis itself, but for my visualization and intersections. ;) Of ...
3
votes
0answers
188 views

PostGIS: How to distinguish overlapping routes (i.e., LineStrings) based on their direction?

I have a set of routes which are represented by LineStrings in my PostGIS database. These routes represent journeys that people make. I want to come up with routes that (a) overlap, and (b) have the ...
1
vote
1answer
32 views

violates check constraint

I try to add a constraint based on geometry type to a "street" table that prevents anything except Linestring geometry or Null. alter table streets add constraint streets_geom_linestring_chk ...