Questions tagged [linestring]

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

Filter by
Sorted by
Tagged with
21
votes
2answers
1k views

Drawing wavy, wiggly lines in QGIS?

Is there a QGIS function or plugin to draw wiggly line? I have used Spline Tool to manually draw some waves, but it is time consuming. If possible, I would like to draw something like: Inkscape ...
15
votes
3answers
879 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 ...
15
votes
1answer
2k views

How to see what lines have changed in an updated Shapefile?

I'm using my county's GIS data to update the roads in OpenStreetMap. I have a copy they published last year and one that was just published, and I'd like to find all the LineStrings that have either ...
14
votes
1answer
3k views

Detecting if point is on left or right side of 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 ...
13
votes
1answer
19k views

Transforming polygon to 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?
12
votes
2answers
4k views

Grouping 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 ...
11
votes
2answers
4k views

How can I export a linestring to a GPX file in QGIS?

I have a linestring in a vector layer in QGIS. How can I expot/save this linestring as a GPX file? I tried to select the linestring, then right click on the vector layer and choose "Save selection as....
10
votes
2answers
3k views

PostGIS - Get a point inside a line or polygon

I need to get the center point of a line or polygon to make marker for my app. So that when you click a marker the geometry appears (line or polygon). I used ST_Centroid to make it work. The result ...
10
votes
2answers
1k views

QGIS Extract Nodes with M-Values for Linear Referencing

I have a MultiLineStringZM layer in a sqlite database, and I'm trying to visualize the measures or m-values at the vertexes. I've tried looking up information on how to do this in QGIS, and about all ...
10
votes
2answers
3k views

How to add vertices to existing linestrings?

If I have Linestring(1 2, 1 5, 1 9) and a Point(1 3) Is there any function that can merge linestring and point preserving the order so output would be: Linestring(1 2, 1 3, 1 5, 1 9)
10
votes
0answers
719 views

Simplify the straight sections of (multi)Linestring in PostgreSQL/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 ...
9
votes
4answers
12k 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 ...
9
votes
3answers
3k views

How to perform SIA or Bezier line smoothing in PostGIS?

Can anyone provide an example SQL for smoothing linestrings from postgis table using Bezier curves or Iterative Averaging (SIA) algorithm?
9
votes
3answers
714 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 geometry(...
8
votes
1answer
10k views

Turning GeoDataFrame of x,y coordinates into Linestrings using GROUPBY?

I have a dataframe of X,Y coordinates that represent points along the paths taken by several different entities. Pseudo-data here, but it is roughly of the form: entity_id lat lon time 1001 ...
8
votes
1answer
3k views

How to create linestrings with a definite angle and length, that are fixed to a point

I want to create linestrings with a definite angle (e.g. 160°) and length (e.g. 2m) that are fixed to a number of points of another linestring. So, I want to use the ST_DumpPoints function to find the ...
8
votes
1answer
572 views

How to transform a set of street-segments into city-blocks, with PostGIS2?

Theoretically is possible to obtain the polygons of city blocks (urban blocks) from streets, when streets are represented by street axis (LineStrings). The urban blocks are bounded by streets, so ...
8
votes
1answer
1k views

How to rank polylines according to their similarity to a ref polyline?

How to rank polylines according to their similarity to a ref polyline? Update 1: simulations show that simple $\sqrt{\sum{(case-ref)^2}}$ can find better similarity between polylines (as set of ...
7
votes
3answers
12k views

How to delete duplicate lines?

I was wondering if anyone could help. I have a tab file in MapInfo consisting of just polylines. Each is meant to have its own reference number, however some are duplicated (e.g two lines occupying ...
7
votes
1answer
3k 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 table, ...
7
votes
1answer
4k views

Calculating length of just portion of linestring that intersect with polygon using PostGIS?

I want to calculate the portion of the linestring that lies within the limits of a polygon. Better with an image What is the length of the portion of linestring within Province A? and within Province ...
7
votes
2answers
1k views

Converting polygon to lines without duplicate edges?

This seems like it should be easy, but I'm not figuring it out: How do I convert a polygon layer into a line layer representing the polygon edges, where each edge belongs only to a single feature (or ...
7
votes
1answer
3k views

Adding offset to 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": "...
7
votes
4answers
1k views

How to calculate the “depth” of a linestring using postgis

I have linestring features, which look like bent linestrings, hemicycles or convex or concave linestrings. In the moment I can select the distance between the startpoint and endpoint of each feature. ...
7
votes
2answers
2k views

For a given feature find the closest point along a given path

Looking for a Java based (foss4g) solution for the following: I am using a path along with a buffer to find features that are along the path. For each of the features returned I want to find the ...
7
votes
2answers
3k 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.
7
votes
1answer
2k views

How do you fix Overlapping Lines?

I have a line dataset that contains some lines where the "end points" are actually found in the middle of the line. In the image below, the nodes are shown in green and one of the end points in red. ...
7
votes
3answers
1k views

How to generate geodesic linestring from two points in C#

I'm looking for a FREE C# class, library or set of functions that will allow me to generate a geodesic linestring (or array of vertices, whatever) from two decimal degree points. I've found ...
7
votes
0answers
1k views

ArcGIS Kernel Density with polyline, search radius / bandwidth calculation [closed]

I'm conducting a density analysis of a series of polylines and I'm hung up on determining an appropriate search radius. The default calculation performed by arcgis is to take the shorter dimension ...
6
votes
2answers
572 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 ...
6
votes
3answers
2k 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 ...
6
votes
1answer
955 views

How to split overlapping linestrings?

I'm new to PostGIS and a bit lost... I work with linestrings that sometimes overlap, for example: I'd like to distinguish these linestrings by splitting them like Google Maps do: I was thinking ...
6
votes
1answer
2k views

Using makeline() function for more than 2 points in spatialite?

Is it possible to use makeline() function to make linestring geometries in spatialite for connecting more than 2 sequence points? Suppose I have four sequence points P1, P2, P3, P4. Or are there any ...
6
votes
1answer
3k views

PostGIS geometry intersection test results different for Point and Linestring

Can anyone please tell me what I'm doing wrong, and how do I avoid the problem? I'll attempt to clarify what I'm doing as things go along. The geom column is a multipolygon column, all values are ...
6
votes
1answer
713 views

LineString VS Multi-LineString Performance PostGIS

Our road dataset (14mil segments, 300,000+ km length) is in Multi-LineString, I am thinking about shifting it all to LineString since all the roads in our data are single geometries and multi part ...
6
votes
1answer
809 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 referencing....
6
votes
2answers
3k views

In PostGIS, how do I merge a multilinestring into a single linestring, keeping the pieces in proper order?

I have a multilinestring made up of several pieces, some of which are facing the wrong direction. (Accessible here: http://pastebin.com/89Zcixv5 ) I think what I'm looking for is some utilization of ...
6
votes
1answer
854 views

How to merge linestrings that don't touch based on common name?

I had a table of road line strings that contained duplicate road names with different geoms for different line segments. I extracted the duplicates to another table. I now want to join these segments ...
6
votes
2answers
965 views

How to compare polygon boundaries in PostGIS?

I've to compare two polygon layers, 'land_use' and 'land_parcels', in PostGIS. My aim is to create linestrings, where boundaries of 'land_use' polygons do not match boundaries of 'land_parcel' ...
6
votes
2answers
471 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 ...
6
votes
0answers
296 views

How to remove overlapping features by percentage?

I have geometry records of type MultiLineStringZM and I am trying to INSERT new records that overlap some of the records currently in the table. If they were type MultiPolygon I could use ST_Area() as ...
6
votes
0answers
528 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 ...
5
votes
3answers
19k views

Creating line with specific length using ArcGIS Desktop?

How can I create a line in ArcGIS 9.3 to a specific length? I click once to start the line where I want it, and then I want it to be, say 10 Meters in length ... Similar to AutoCAD.
5
votes
3answers
9k 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?
5
votes
2answers
554 views

Bounding box of set of MULTILINESTRINGs in 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 ...
5
votes
2answers
4k views

How to calculate distance from POINT to LINESTRING in R using `sf` library and get all POINT features from LINESTRING where distances were calculated?

I'm trying to calculate distances from a set of POINT features (1, 2, 3, 4, 5, 6 & 7) to a LINESTRING feature using sf library in R. I could calculate all the distances using the function ...
5
votes
3answers
3k views

Getting distance between two points over linestring using PostGIS?

I have a linestring: LINESTRING(-1.3326397 50.9174932,-1.3319842 50.9166939) and I select two points that lay on that linestring. How do I get the distance between these two points (in meters)?
5
votes
1answer
3k 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 ...
5
votes
2answers
2k views

How to calculate the azimuth of a line of a multilinestring in PostGIS?

I have two spatially enabled tables in PostgreSQL with a geometry in each: First table is with POINT type, second is with MULTILINESTRING. I need to calculate the azimuth of the LINESTRING part of a ...
5
votes
1answer
580 views

r - sf::st_cast(“LINESTRING”) - keeping first linestring only warning

I have a dataset with geometry column in which there are linestrings and multilinestrings. While keeping the linestrings I want to convert the multilinestrings to linestrings (which should potentially ...