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.
536
questions
2
votes
1
answer
75
views
Generating offset line from MultiLineString in QGIS
I have a MULTILINESTRING in my CSV file, and I want to generate a copy of it offset to the right by a few meters. I've run Single Sided Buffer, and Offset Lines, and neither of them seem to generate ...
0
votes
0
answers
61
views
Calculating from GPS time duration of a linestringM within a polygon
I am analyzing trajectories from GPS points, including timestamp (Linestring M).
I need to clip trajectories that cross polygons, and calculate time spent within those polygons.
However, I have 2 ...
1
vote
1
answer
30
views
QGIS 3.22.16. Layouts Atlas option: Adding all the data in the last map of the Atlas
I created an Atlas to get different location maps of one data. Is it possible to add a map at the end of the atlas that shows the data in the entire county?
0
votes
1
answer
62
views
Calculating distance between two points on line string
I have a line string and two points with me. I need to understand how to calculate the distance between two points along the provided line string. Also, note that in some cases, the provided points ...
1
vote
1
answer
36
views
Why do a line and polygon still intersect after using st_difference() in R?
I have a line that intersects a polygon, and I would like to get only the portion of the line that does not intersect the polygon. Using sf::st_difference() does indeed trim the line, but the result ...
1
vote
1
answer
50
views
Line string label text letters overlapping in OpenLayers
I have a Map in OpenLayers 8.1.0 with a VectorLayer, containing a single LineString feature with a Text label. The line is a curve following the Great Circle with 100 vertices.
At certain zoom levels, ...
1
vote
2
answers
53
views
Treating a feature as both a single line (for length) and a multi line (to colour each segment)
I am tracking progress made each day along a path, so that I can show in QGIS each day's progress in a different colour with a label showing the day number and distance covered.
However in this case ...
0
votes
1
answer
102
views
Buffers around linestrings have weird shapes (sf in R)
Update 10.11.23
Question (1) has been resolved, but answering question (2) is still in progress.
Original Post
I am trying to create buffers around (multi)linestrings representing international land ...
1
vote
0
answers
41
views
Visualize a linestring and point from a PostGIS database in QGIS?
I ran a query in PostGIS table using a table of roads/linestrings in Hawaii and another table with 400,000 (longitude,latitude) points in Hawaii. The output table is meant to provide nearest road in ...
0
votes
0
answers
37
views
QGIS - Electrical Power Grid: getting the value from a previous line
I am working with two layers. One of them is a set of lines supposed to represent the electrical grid of a city. And the other one is a set of points representing the utility poles of the grid.
The ...
2
votes
1
answer
64
views
Iterating over LineString and applying filter in PostGIS
I want to iterate over a LineString and apply a filter so that I create a new LineString with those points that succeed in the test. How do I do that?
My goal is to find some outliers that are too far ...
0
votes
0
answers
39
views
Finding the center of a line using OpenLayers?
Code Pen
OpenLayers had a getCentroid function that would provide the line center, but that function went away at some point.
What is working is getting the center of the extent of the line:
ol.extent....
0
votes
0
answers
41
views
Converting polygon into line segment in OpenLayers
I have a polygon which should be converted to line segment. How can this be achieved?
I have tried the following code but it didn't work
Here is my code :
selectedPointGeom = interactionselect....
0
votes
0
answers
31
views
Visually merge lines without merging the attributes of each segment using QGIS
I am tracing the existing cycle network in my city. Some cycle paths are continuous but present different features, which correspond to different attributes per segment. I would like these lines to be ...
2
votes
1
answer
309
views
Python length of roads inside polygons
I have two datasets: one about each road in a country (and its linestring), and another one about the polygons of each region. I want to estimate the length of each road in the polygon that is ...
3
votes
0
answers
81
views
Split an array of GeoJSON linestrings (from Overpass Turbo) into an array of road intersections
I've got a query that pulls in a bbox of GeoJSON LineStrings representing roads from the Overpass Turbo API. I'm working in Typescript and have been using the TurfJS library extensively.
I want to ...
1
vote
0
answers
49
views
Adding overlapping routes when there is no overlapping route using buffer and union
I am trying to do something to do with routes, Let's say I have 3 routes rt1 and rt2 are overlapping routes that share some length but r3 does not overlap with either of them. How would I just add the ...
1
vote
0
answers
49
views
Mapping self-intersections of a transformed LineString
I’m using shapely to solve a problem in physic. My problem can be represented in 2D with a LineString. In order to solve my problem I need to :
Apply a transformation to the original LineString
Find ...
2
votes
1
answer
88
views
Prevent lines from joining automatically with lines on another layer and over running them in QGIS
I am having an issue where I draw a series of individual connected lines and then I want to continue on but with a different line type so I Duplicate the Layer and make the line style adjustments but ...
9
votes
1
answer
173
views
Creating one meter line from a point in the direction of a other line using PyQGIS
Consider I have a line_layer and point_layer. I want to create a one meter line at every point in the direction of the line flow.
Output should be:
So far I tried:
point_layer = QgsProject.instance()...
1
vote
0
answers
49
views
PyQGIS: Save as KML doesn't work using QgsVectorFileWriter
I have a line layer (multiple lines but not large) that I'm working with in my PyQGIS plugin and I need to save the layer as a KML file in the end. My code looks like this:
saveLocation = filePath + &...
3
votes
2
answers
63
views
Slice circular linestring by shortest distance between 2 points
I have a polygon of a farming field. I am dropping 2 Points along the field borders in order to easily measure the distance between those points.
This works great most of the time, but in some ...
4
votes
1
answer
118
views
Avoid losing overlapping areas when buffering line with Python
LineString is the path of the transport on the field with attached equipment. Is it possible to use GeoPandas or third-party Python libraries to find overlapping areas when buffering a path line to a ...
0
votes
0
answers
20
views
Get Point coordinates on a Linestring in specific distance along the line - in PostGIS [duplicate]
I would like to get the coords of a point which lays on a linestring in a known distance from the line's starting point in PostGIS.
Any idea?
8
votes
2
answers
198
views
Randomly offset duplicate points along linestring X meters using PostGIS
The query below selects all duplicate points on a line, which overlay one another, then randomly assigns each point location within a certain radius. The last step assigns each point back on what I ...
0
votes
0
answers
90
views
Translate GeoJSON tile coordinates to X,Y coordinates on canvas 500 by 500
I have GeoJSON vector tile which I want to render to HTML canvas 500 by 500. How can I translate the lat, lon coordinates of a line string to X,Y points on the canvas?
{
"type": "...
1
vote
1
answer
128
views
Parquet files and PySpark: creating linestring column from node references
I've used osm-parquetizer to convert my pbf files to parquet to parallelise my actions using PySpark and Apache Sedona to query as such. The schemas created by the parquetizer didn't have a geometry/...
4
votes
1
answer
389
views
Offsetting horizontal line labels in QGIS
In QGIS 3.22.8 I have 100s of linear features on a map. I want to label them horizontally, but don't want the label sitting over the line. I can find the Horizontal placement setting, but no offset ...
4
votes
1
answer
248
views
Quantizing the value of straightness or waviness of line segment in QGIS
Is there a tool in QGIS that can calculate how smooth or zigzagy a line is in the XY plane (not Z profile) between two points, or how can I quantize this value so that I can compare the straightness ...
1
vote
0
answers
57
views
Flip line only on selected rows with arcpy.da.UpdateCursor and calculate new line bearing on it
I'm trying to use arcpy.da.UpdateCursor to flip line only on selected records in shapefile that are greater than value 180. Then I would like to recalculate Line Bearing on the attribute called "...
3
votes
1
answer
313
views
Getting the polygons contained in closed MultiLinestring using Python
Given a set of "streets", how can I get the "blocks" contained in those streets?
For example, I'd like to extract four blocks / polygons from this 2 x 2 "checkerboard":
...
3
votes
1
answer
162
views
clustering similar linestring with direction in PostgreSQL(PostGIS)
Linestrings with directions are stored in the form of geometry in PostgreSQL, as shown in the figure below.
I would like to cluster similar(location, length, and direction) shapes through functions ...
5
votes
0
answers
211
views
QGIS - How can I draw multiple lines [bus route] to be transparent and aesthetic?
PROBLEM: So on this map 3 you can observe that there are buses which follows the same route when you zoom in the original resolution after while you can tell which line is which number, but it is not ...
3
votes
1
answer
112
views
How to split a linestring by its Z dimension
I have a tracks table with a geom column of type geometry(LineStringZM,4326). I now need to find out how much time a user has spent at a given elevation range. For this I'm gonna create a materialized ...
3
votes
1
answer
321
views
Using GeoPandas object.touches(geometry array) to have full list of Trues and Falses
I try to pass a number of line strings inside the parentheses to have something like this in the output, I tried different formats but it did not work.
a1.iloc[0].geometry.touches(a1['geometry']....
8
votes
5
answers
2k
views
Is the LineString straight? [closed]
Is there a way to check whether or not a line string is straight?
there is a line.is_ring() method in shapely for rings but I could not find something similar to straight lines. I use shapely and ...
2
votes
0
answers
290
views
Calculating distance between two points with obstacle using PostGIS
I'm a new user of Postgis, I try to find which point is closer to start_point and end_point.
for example:
start_point is POINT(19.9948526769673, 0.001437951055402)
end_point is POINT(19....
1
vote
0
answers
153
views
How to extract segment of LineString depends on given first and last Point
I am finding the Sub Segment on line String
I am having the First and Last point from Longer Line String, trying to extract the sub Line string from longer Line String, where new line string contains ...
3
votes
1
answer
416
views
Automatically delete side branches from a multipart linestring in QGIS
Question
I have a multipart line representing a river, downloaded from OSM. It includes minor branches as well (see screenshot). For cartographic purpose, I want to convert the line to a single part ...
0
votes
1
answer
110
views
how to store a road with multiple routes?
I assume everybody knows google maps. When you get any direction to you destination there is always mutliple options. Let's say I want to store such a geometry in PostGIS? What is the best approach to ...
0
votes
1
answer
846
views
Shapely Split a LineString based on Intersections with other LineStrings
I'm new to using Shapely, and I have some question. I have a LineString and I wish to split it based on intersections of other LineStrings.
If the intersection turns out to be a single point, then we ...
-1
votes
1
answer
231
views
Can't find LineString or Point for Python
I am trying to use PolyLabel. I did a pip install shapely first. But the
from shapely import LineString
fails to find LineString.
Also, in polylabel there is an
from ..geometry import Point
which ...
1
vote
2
answers
698
views
How to show points on LineString in QGIS?
I created a shape file with the following schema in python:
schema = {
"geometry": "LineString",
"properties": {"id": "int"},
}...
1
vote
1
answer
80
views
How to split up Linestrings based on type and connectivity using Python? [closed]
I am working with a road network, where I extracted only the three main road types. In the next step, I would like to union all Linestrings based on their road type and connectivity. That means that I ...
1
vote
1
answer
43
views
Select lines that are no 'islands'
I have one table with several linestrings. I want to select all these linestrings, that do not touch any other linestrings, thus are "islands", are not connected to any other linestring. How ...
2
votes
1
answer
174
views
Count points on linestring
I have a table table_point with points that are located on linestrings (table_line). How would I count for each segement of the a linestring of table_lines the number of points that are located on it?
1
vote
1
answer
374
views
Splitting multiple Linestrings into 1 metre parts with GeoPandas shapely
I have a GeoPandas dataframe which contains many rows and also a column named 'geometry' with the following input:
geometry LINESTRING (445125.050522556 5536587.67127983, 445124.450035...
I ...
6
votes
2
answers
383
views
Splitting lines by multiple polygons, taking length of particular segment, using PostGIS
I have a table of 100k+ non-overlapping POLYGON features, and a table of 50k+ simple LINESTRING features (each line has only 2 vertices). The below is a common arrangement of these features on a map, ...
1
vote
0
answers
27
views
Snapping points to lines returns unexpected results [duplicate]
I have a linenetwork lines and a lot of points points.
The table lines has 42869 rows, the table points has 11264 rows. I am trying to snap each point to its closes line.
SELECT
p.id,
...
4
votes
1
answer
250
views
Locate ways (multilinestring) that intersect points
I have two tables: crimes (points/ST_MakePoint) and ways (multilinestring). Initially what I did was reposition the points to the point closest to the track using the following:
UPDATE renzagoras....