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
3
votes
1answer
807 views

Intersecting lines to get points in geopandas

I'm trying to use GeoPandas to generate points of intersection between two linear shapefiles. For example, I have a shapefile of pretend pipelines (red) and some crossings (blue). What I would expect,...
1
vote
1answer
905 views

Shapely python spatial join - point with line

I have two datasets, one with address points (lat,long) coordinates. And another one with line string geometry (each linestring represents a road). I am trying to find the road name for each address ...
1
vote
0answers
516 views

JSTS Buffered Polyline in route Service (google maps V3)

I do not know if someone has already lived the same thing as me, I work with JSTS API to create a polygon that surrounds the route of the google services but the problem is that when there are ...
1
vote
0answers
366 views

Closest point to road intersections with GeoPandas and Shapely [closed]

I have a geopandas dataframe, where each record's geometry field is made up of a LineString. Each LineString represents the points which make up a road. I'd like to find the locations of all road ...
0
votes
1answer
189 views

PostgreSQL+PostGIS creating GeoJSON with ST_MakeLine

Trying to get a valid geojson response from my PostgreSQL(9.6.3) + PostGIS (2.3.2) to track routes. I have a table of GPS positions of the form: CREATE TABLE public.gps ( id integer NOT NULL ...
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 ...
5
votes
1answer
294 views

Splitting LineString into Multiple Substrings using PostGIS?

I am new to PostGIS. I have a set of (thousands) of Linestrings and associated multiple points along the line, expressed as fractions along each linestring using ST_LineLocatePoint. I am looking ...
3
votes
1answer
3k views

Shapely multiline string to shapefile as single line

I am using shapely unary_union to dissolve multiple line strings to one line before exporting to a shapefile. The output from unary_union is a multiline string (example below which you can paste into ...
-1
votes
1answer
365 views

Multilines appearing on map but ordinary lines are not

I'm trying to achieve two things: 1) Display lines on a map and 2) add pictures to a map. 1) I've successfully displayed multilines on a map using the Leaflet.js library. For some reason lines are ...
3
votes
2answers
660 views

Zoom on Linestring object in Leaflet

I'm using Leaflet and trying zooming on a LineString object from a geojson file. Here is an extract of my file (with a lot of LineString objects): { "type": "FeatureCollection", "features": [ ...
4
votes
1answer
122 views

What tool could I use to merge separate line vectors?

I started with a line vector file consisting of several creeks. The problem with that file was that most of the creeks within the file were broken illogically into segments, even those that should ...
3
votes
1answer
887 views

How to transform Linestring to Polyline?

I have GeoJson file with roads data as Linestrings. I want to load it in Cesium Sandcastle and make a custom line styles. In order to do so, lines have to be Polylines, not Linestrings. Is there a way ...
2
votes
1answer
297 views

Create points every 20m with GDAL?

I have code written in ArcMap which uses the package ArcPy which I cannot use in a stand-alone Python script, but I want to do it with GDAL without ArcMap. Basically it goes through the lines in the ...
1
vote
1answer
105 views

How do I conditionally increment buffer in PLPGSQL/PostGIS?

I have gone through some relevant questions but my problem is slightly different. I have two tables in my PostgreSQL 9.5 database i.e., line geometry (1 row) and point geometry (2 rows). The scenario ...
0
votes
1answer
214 views

LineString Self-Intersection points

I'm trying to get all the points from a Self-Intersection LineString. On LineString segments intersection with no vertex on intersection: ST_Intersection make the job; Now, how catch the vertex ...
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 ...
0
votes
2answers
731 views

Openlayers 3 - how to get id/index ol.geom.LineString vertex by coordinates

I'm having a list of points (coordinates + extra info). I want to show them on the map as LineString and when I hover a vertex/point I want to get a callback where I display extra info for the given ...
1
vote
1answer
172 views

Merge two WKT Linestrings (almost parallel) into one

I don't have tools like ArcGIS. I have two LINESTRINGs LINESTRING(121.5160996 25.0358556,121.5168148 25.0347768,121.5170452 25.0345573) LINESTRING(121.517053 25.0345682,121.516851 25.0347814,...
3
votes
1answer
488 views

Determining if another marker (Point or Polyline) where marker Point dragged in Leaflet?

I'm trying to create interaction between 2 markers with Leaflet, I would like to be able to drag a marker onto another Either between one point and one linestring, or between 2 points. I added the ...
1
vote
1answer
233 views

Export network layer to a shapefile

To continue from this question about the format of a .csv file with network data. I have two layers now: 1) layer with the coordinates (X,Y) of some nodes, and 2) layer that represents the lines ...
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 ...
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 ...
3
votes
1answer
741 views

Measure length of each segment for a polygon in Postgis

I have a polygon table in PostGIS and need to calculate the length of each line segment. How can I achieve this? I have done it in QGIS but would prefer to do it in the database. I have found ...
3
votes
0answers
276 views

Reorder Shapefile of lines for consecutive ordering (Assemble Lines into LineString)

I have a Shapefile containing segments of Lines/LineStrings: Unfortunately the order of the DBF attributed table is random. How to reorder the segments so entry #1 in the Shapefile will be "Segment ...
2
votes
1answer
2k views

How do I extract points from a LineString or Polygon data frame and make a dictionary of point data frames?

I am building some pre-processing routines for 3D visualization of GIS data and I have several line and polygon shapefiles with multiple features. I want to extract the points for each of the features ...
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 ...
0
votes
0answers
82 views

Simplify multidimensional list of points into track/linestring

I have a bunch of points representing the movement of a target: Track_123 = [Point_1, Point_2, Point_3 ... Point_N] Where each point is a multidimensional vector: Point_N = [Lat, Lon, Time, Speed, ...
2
votes
1answer
879 views

PostGIS make line from shortest distance from points to polygons

I have two tables. An exploded points parcels layer create table a as select id, (ST_Dumppoints(geom)).geom as geom FROM tableblah; and another parcels table call it b which is a polygon I wrote a ...
2
votes
1answer
1k views

Line to polygon in Oracle Spatial

I have a table that contains buildings in a line geometry where a line starts and ends at the same point. Is there away to convert lines to polygons in Oracle Spatial?
1
vote
1answer
323 views

SLD to label linestring

I am trying to get labels to follow the linestring. I have inserted the following sld text into a geoserver style, but the label is displayed at the horizontally at linestring centroid <...
0
votes
0answers
127 views

Get Substring of Linestring by nearest point

I need get custom segment of any Linestring. For better understanding I've added image. Blue line is my Linestring which contains 3 points, and on the base of red point I need cut or fill line in ...
2
votes
0answers
32 views

Osm2pgrouting - edit final route

I've imported my data to database by osm2pgrouting. This tool created network topology which contains vertices and edges between them. Problem is when I need get route to specific point which is not ...
4
votes
2answers
491 views

Making linestrings with adjacent lines in Postgis

I have a Linestrings layer with all the horizontal signage (lines in the floor) in my town. I need to calculate the area of the closed linestrings. The thing here is that every side of each closed ...
3
votes
1answer
1k views

Create smooth line from zigzag line

I've vector which looks something like this My question is how I can make it smoother/straighter with less points and curves. Note: I've tried using simplify api from Shapely, but no luck. Update: ...
1
vote
1answer
78 views

How selecting uniques linestrings from two datasources with similar features?

I know is easy to select uniques points, or polygons features from two datasources (using centroids and overlap, or buffer) , but it not so easy do the same with linestrings, many times it is even a ...
2
votes
2answers
276 views

Merging two linestrings gives Geometry type error in MMQGIS?

I am trying to merge two linestrings/Lines/Polylines (not sure actually how I can see the difference whether my layer is a Linestring/Line or Polyline and googling didn't really brought clarification)....
4
votes
1answer
212 views

Geoserver linestring fill based on attribute value

I'm experimenting with Geoserver. I'm styling a linestring layer with CSS in this way, which works fine: [userid = 1] { stroke: #8C2300; stroke-width: 3px; stroke-linecap: round; z-index: 0, 1; } ...
1
vote
1answer
807 views

Smooth linestring shapefile

Is there an algorithm to perform a smoothing of a linestring and maintain the original points?
2
votes
3answers
661 views

How to break apart a complex line segment into simple line segments between all points?

Take for instance a very complex line string.. which has WKT like this LINESTRING(1 1,2 2,3 3,4 4,5 5 ...) I want to create two-point linestrings from many-point linestrings. SELECT ST_MakeLine(...
2
votes
1answer
193 views

How can I detect if my linestring is near an OSM node?

If I have a linestring of objects (different from the road OSM XML file) and an OSM XML file that contains nodes and ways (extracted down to roads only), how can I detect if my linestring passes ...
1
vote
1answer
1k views

Postgis using st_geometry linestring on column

I'm trying to create a linestring based on a value in a column in PostGIS. My code looks like this: create view left_span as SELECT st_geomfromtext('LINESTRING(line_att.wkt_left)', 27700) as geom ...
1
vote
1answer
956 views

Convert LineString to MultiLineString in Qgis Spatialite

How to convert LineString to MultiineString layer in sqlite?
2
votes
1answer
545 views

OGR2OGR convert linestring to multilinestring

I have a shapefile with 3D linestrings. I want to convert this to 2D multilinestrings I tried:- ogr2ogr -t_srs EPSG:4326 Road_wgs84_2d_mlt.shp Road_wgs84.shp -nlt PROMOTE_TO_MULTI -dim 2 -progress ...
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 ...
2
votes
2answers
1k views

How do I delete lines from the QGIS canvas which no longer are attached to a shapefile?

Using QGIS 2.18.1, I started to create a shapefile layer with a line feature, but then decided not to proceed. I first tried to select and delete the lines but couldn't seem to select them with the ...
2
votes
1answer
589 views

Can we take the length of a linestring by calculating ST_Distance from its ST_StartPoint and ST_EndPoint?

I took the values of my StartPoint and EndPoint by doing this procedure: a) SELECT COUNT( CASE WHEN ST_NumGeometries(geom) > 1 THEN 1 END ) AS multi, COUNT(geom) AS total FROM public.roads; ...
5
votes
2answers
6k views

How to style a LineString feature to be red colored?

I try to add Features with LineString geometries in different colors to a ol.source.Vector. I tried to do this with the following code: var myFeature = new ol.Feature({ geometry : new ol.geom....
1
vote
0answers
78 views

Need to fill the area of shapefile that contains LineStrings, which form a polygon, in ipython

The porblem I have is that I fetched the data about the administrative level of vienna (from OSM via overpass --> vienna relation id = 109166) as xml format. (json didn't work it had encoding problems)...
2
votes
2answers
570 views

How to identify a GeoJSON LineString self-intersection?

I am working on a (hobby) project where I am processing gps data (GeoJSON LineStrings) in which this often occurs. I am looking for a solution using JavaScript because I would like to do this client-...
2
votes
1answer
1k views

Create a point in intersection of 2 lines postgis

As an ArcGIS user this is simple but in PostGIS has became a nightmare. But well I guess this is typical in beginners like me. I have 2 layers (multilinestring) called roads and waterways, I'm trying ...