Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
0answers
27 views

“bending” lines to a predetermined shape

I have a dataset with AIS-transponder information. A AIS-transponder is a digital system onboard a ship that sends/receives information to/from the vessels within range of the VHF transceiver in a ...
5
votes
1answer
91 views

Create a line string from street geometry

I'm currently facing some hard times trying to create a simplified line from a street geometry. The data that I'm currently using comes from OpenStreetMap, using osm2pgsql.(Which means PostGIS, but I'...
1
vote
0answers
17 views

Check point in line segment not accurate in Shapely

I use Shapely and I've run into an issue where I can find the intersection of two lines. However once I have the intersection point, I don't seem to be able and cross-reference that it belongs in both ...
0
votes
1answer
51 views

Getting geohash of LINESTRING in PostGIS?

I have some LINESTRING in PostGIS. LINESTRING(104.011 30.637,104.014 30.638,104.022 30.640,104.026 30.645) LINESTRING(104.022 30.666,104.031 30.659) LINESTRING(104.044 30.655,104.056 30.655) I ...
2
votes
0answers
75 views

Add Line Layer from PostGIS to Leaflet

I have a line layer in PostGIS that I would like to add to a Leaflet map. I have the PHP setup, but I can't seem to get the Javascript correct. I know my issue is converting the line to geoJSON. The ...
2
votes
3answers
102 views

Can I reorder the coordinates of a line when importing into QGIS a WKT linestring?

I managed to import a csv file containing lines in QGIS but unfortunately the x y aren't in the correct order. that is, the csv has a field where there is a sequence of lat (y), lon (x), while qgis ...
0
votes
1answer
28 views

Converting CSV with LineString into shapefile using ArcGIS Desktop?

I have a CSV which I've imported into ArcGIS Desktop, and it contains a Linestring column. How do I convert it into a shapefile? Example of what one of the fields contain below: [[51.53878768021,...
2
votes
0answers
35 views

Shapefile lines disappear, but data remains

I'm working in QGIS 3.4 on a line type shapefile layer with +/-5000 records. I made an edit to the start/end nodes of a couple of lines to move them to a point node from another layer; then when I ...
0
votes
0answers
12 views

Geospark - Creating LineStringRDD from coordinates extracted from the sides of each polygon in a PolygonRDD

I am using geospark 1.1.3 with scala and I am trying to split into lines a polygon shapefile dataset which contains 189 polygons. I am expecting to get each side of each polygon as a LineString, ...
0
votes
0answers
48 views

Mark Dangle Error for linestring

I will create buffer for 5 meter in start point of line string, If any other line string is within the buffer but not snapped then to mark as the startpoint as dangle error.I have attached the sample ...
0
votes
0answers
48 views

Matching streets in two line datasets with PostGIS or QGIS?

Explanation: I have 2 tables on PostgreSQL, one table named 'city' that have linestrings wich represents streets from a city (using QGIS I downloaded OpenStreetMaps data and imported to PostgreSQL ...
0
votes
0answers
32 views

Segmentation of a line based on several overlapping lines within the first line

I stumbled over a problem which I can't figure out myself so maybe you can help me.. I have a line going from 0 to 100% of its length. On this line I have 1:n lines with different information and ...
0
votes
1answer
131 views

OpenLayers Linestring does not draw straight images

My problem:Add image along the LineString My problem has been solved here, but when I add a 32x32 image and I draw between two points, the images in the line don't go straight and there's a slight ...
0
votes
0answers
26 views

Stop detection on a dataset of (id,geometry points,timestamp) to be transformed into meaningful trajectories

My pretty large dataset consists of AIS transmitted messages. I load the dataset to a table in my db. Among other columns in this table, there are a longitude and a latitude column. I already ...
1
vote
0answers
43 views

How can I calculate the “average” or “median” result between a number of MultiLine Strings?

So I have a number (let's say 12) of multiline strings representing something that changes over time, like forest borders or shorelines. I want to create a single line that is the result of the ...
2
votes
1answer
358 views

Add image along the LineString

I am wondering how to place images on a line. For example, instead of a dotted or dashed line. I could include a symbol of a cloud a character (e.g. |) repeated along the line. it cannot show the ...
0
votes
0answers
37 views

How to add date to point?

I have a lot of points with a GPS tracker and I need to simplify them. I create view (location_view) in PostgreSQL (with PostGIS): SELECT location.id, location.added, location.latitude, ...
3
votes
0answers
46 views

Change from LineString to MultiLineString when saving layer edits in QGIS

In QGIS, when a user creates a new single part line in an open editing session for a “Multi-Line” SpatiaLite dataset, the QGIS data type is initially a “LineString”. But, when the user commits the ...
2
votes
2answers
49 views

PostGIS MakeLine issue

I am using GPS coordinates and I am trying to create lines (routes) from lon,lat. I create a geography column from my point and then I create the line as following: ST_MakeLine(point_geom order by ...
2
votes
1answer
144 views

Slow PostGIS line intersection even with indexes

I have line data contained in different graphs. Querying data over multiple graphs and using st_intersects results in slow queries. All lines are represented as geometry(LineString). I am querying ...
1
vote
0answers
60 views

Cluster LineStrings using HDBSCAN?

I am trying to cluster a set of LineStrings (made out of lat/lon Points) with the help of HDBSCAN (using the "haversine" metric). The objective is to define the most "usual" path. I have only managed ...
1
vote
0answers
44 views

SumLineLengths in QGIS 3.2 not working?

I'm trying to use the Vector > Analysis Tools > Sum Line Lengths in QGIS version 3.2.3-Bonn. I'm inputting a ploygon (Multi Polygon) and a Lines (MultiLineString) shape files. I'm hoping to get the ...
2
votes
1answer
102 views

Calculate polygon main dircetion and create line from it - POSTGIS

I would like to find out the orientation of a polygon and create a line of that direction. See image below.
0
votes
1answer
44 views

Lines overlaping in same layer - PostGIS

I have lines overlapping in one layer as in image below. How do I delete one of these lines and leave the other one in the dataset?
3
votes
1answer
124 views

Select only lines that touch both sides of polygon - PostGIS

I want to select lines that only touch both sides of a polygon. Is there a function in postgis that can do this? See image below. I only want to select lines from the circle on the left where the line ...
2
votes
1answer
68 views

Determining direction of traffic in road network?

I'm working with road segments as LineStrings in GeoPandas, for each segment I would like to determine the direction of travel (they drive on the right). This information is not encoded, how can I ...
1
vote
0answers
55 views

Is this a bug in Shapely's ops.snap?

I have two polylines whose endpoints are near to each other, but do not overlap. I've put them into this shapefile. I want to use shapely's ops.snap() to snap their endpoints, but it's not working as ...
1
vote
1answer
85 views

Shapely floating problems with split()

Based on the answer of sgillies I want to use Shapely's interpolate() to find the points at which to split. But I experience that split() is sensitive to the points being precisely on the geometry you ...
1
vote
1answer
48 views

Osm2pgsql - Lines instead of polygons that represent buildings

So I am using a PostgreSQL database with the PostGIS extension to extract building data with addresses from osm data. I just discovered that in my dataset, imported with osm2pgsql of the german city ...
0
votes
1answer
36 views

Query to return closest LineString given a Point [duplicate]

I have a road lines data in a table with field roads(id SERIAL ,the_line geometry(LineString,4326)) suppose an accident occurs in a middle or at any location in that waterline i want to stop the ...
0
votes
1answer
60 views

r - turn off automatic ordering of linestrings when applying sf::st_intersection

This question is about how while using sf::st_intersection on a LINESTRING and a set of POLYGONs to get several LINESTRINGs in the CORRECT order. sf::st_intersection automatically orders the newly ...
0
votes
0answers
44 views

Breaking LineString into MultilineString group by distance between two points and it's time

This is line string of my geometry column that created by postgis and shown in qgis: This is multiline string like above: I am new on gis and How can i do break line and convert it into multiline? I ...
2
votes
1answer
217 views

Sort a geopandas dataframe by location

I have a geopandas DataFrame (created from a shapefile) which represents the course of a public transport vessel. Exemplary DataFrame: | oid | geometry | |-----|---------------------| | ...
2
votes
0answers
28 views

Processing tool to fill all voids within a lines layer

I'm trying to convert a lines layer from Ordnance Survey which is made up of field boundaries, river banks, woodland boundaries and houses etc into a polygon layer, but only 'polygonise' the fields. ...
2
votes
1answer
66 views

Is there a way to calculate length of linestring from one point to another?

If I have one linestring and coordinates of two points on that linestring, what is the easiest way to calculate not shortest distance from those two points, but distance over the given road (given ...
3
votes
1answer
483 views

Access vertices of a line in Python

Given a shapely.geometry.linestring: How do you access single vertices using Python?
0
votes
1answer
116 views

Direction of two lines (turn right or left)

There are two connected lines (EPSG:4326 line1, line2). When the direction of the two lines is from line1 to line2, I want to do a calculation to determine whether the direction is left or right.
0
votes
0answers
219 views

Intersect a linestring with a collection of polygons in Shapely

I have a LineString that represents a trajectory and a Python list of Polygons that represent crossroads. I would like to insert new points into the LineString wherever it crosses any of the polygons, ...
1
vote
1answer
149 views

Convert a linestring into a closed polygon when the points are not in order

How can I convert an open linestring into a closed polygon, but when the points are not in order? Here is the easy case, when the points are in order (from an sf vignette): library(sf) #> Linking ...
0
votes
1answer
27 views

Locating geometries within a polygon/area

I have a postgis database table of boundary data which is made up of LineString geometry's, what I would like to do is create a query that will return only the rows that contain a LineString geometry ...
3
votes
1answer
54 views

How to cut the end of line in a QGIS style?

I want to create a style in QGIS, in which one line is offset from the other, but their ends form one point (as in the picture). How do can you remove the ends of the green line? In QGIS 3.2 there ...
-1
votes
0answers
148 views

Shapely get line string bounded by a BoundingBox

I have a line string and a bounding box. I want to get the points inside the bounding box including intersection points. (I have tried polygon.intersection(line) but this method only gives ...
0
votes
1answer
151 views

Getting width of road segment given its end points using Leaflet?

I want to highlight a road segment on a Leaflet Map. I have the coordinates of the end point of the road segment, so could plot it as a linestring. But the problem is how can I get the width of the ...
1
vote
1answer
151 views

How to increase length of linestring using Jts functions

lf l get a line string having a legth lesser than expected then l need to project or extend that line further in such a way that it meets minimum length requirement. For e.g. l have 2 coordinates A(...
0
votes
1answer
26 views

Seeking PostGIS query to find LineStrings (Route) entering or crossing circle area? [closed]

I need to know Postgis query to find LineStrings (Route) entering or crossing circle area. I tried using ST_Crosses function but it is not resulting with correct output. Any suggestions?
0
votes
0answers
28 views

Trying to merge convert mult linestrings with breaks

I am trying to clean up a road network file. The roads are encoded as multlinestrings I want them as linestrings. Normally I would use st_mergeline to convert from a multilinestring to linestring. ...
0
votes
0answers
23 views

Ghost points in LineString

I am getting Ghost points in linestring (marked in blue circles), when I check the attribute table it has no data regarding the Ghost points. So I tried to play around with it using NodeTool, and it ...
3
votes
1answer
257 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 ...
0
votes
1answer
419 views

LineString Adding and Removing

Following the example Draw Feature in openlayers 4 i was able to addInteraction and successfully drew a line. My questions here are How do i capture all the lines drawn and populate them on the ...
0
votes
0answers
657 views

Shapely and lines intersection

Is there a way in Shapely to calculate intersections of geometries with some tolerance? Imagine we have lines that are the same, but their coordinates are written with different precision. ...