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.
555 questions
0
votes
1
answer
80
views
Convert a MultilLineString to LineString with sf
I have a bus route that is a multilinestring. In order to use the route for further analysis, I need to convert the route to a linestring. This is the route (download)
lines <- st_read("/.../...
2
votes
1
answer
113
views
Multilinestrings to Linestring using Python
I have a geodataframe (download link) that contains the geometry of bus lines. It is a Multilinestring. I need to transform the geometry into a single Linestring.
My first idea was to use .explode (...
2
votes
1
answer
50
views
Extracting linework from a GeoDataFrame
I have raster data where each pixel is assigned a feature id and the features form connected pixel regions. We could think of this as a rasterized map of different countries.
raster = np.array([
[...
2
votes
1
answer
64
views
"NameError: name 'JoinStyleRound' is not defined" error when offsetting feature of line type geometry with PyQGIS
I'm trying to offset a feature with line-type geometry, I found a suggestion to work based on the QgsGeometry.offsetCurve() method, see https://qgis.org/pyqgis/3.34/core/QgsGeometry.html#qgis.core....
0
votes
0
answers
28
views
Connecting point features by ID & Time columns in ArcGIS Pro
I am trying to measure distance between points in ArcGIS Pro. Specifically, I want to connect a series of points that have location, time-stamp (every 2-3 seconds), and ID columns. My dataset is large ...
0
votes
0
answers
49
views
Connecting two lines based on their value in ArcGIS Pro
In ArcGIS Pro 3.3 I have a layer of non-continuous lines that I want to connect based on depth values. Each line has a depth field (e.g., 0.3, 0.5, 0.8). I need to connect each line to the next one ...
2
votes
0
answers
86
views
Remove side branches from linestring
I'm trying to create a centerline from a (curved) polygon. To do this I'm using the PostGIS ST_ApproximateMedialAxis tool. However, this creates a lot of side branches, whereas I only want to keep the ...
2
votes
1
answer
210
views
Repeating linestring across farm field at 40 inch intervals to use r.report for pixel values
I am a new user of QGIS. I have found answers to most of my issues. This one has me stuck. I have included an image of the project I am attempting to create.
My plan is to place a linestring on every ...
0
votes
0
answers
64
views
How to group a List<LineString> which are connected to each other to a “MultilineString” in NetTopologySuite
I'm using NetTopologySuite and have a lot of lines in a List<LineString> and would like to group them in List<MultiLineString>. Every MultiLineString should contain the LineStrings which ...
0
votes
1
answer
344
views
How to bind two sf objects based on matching values in one column in r
I have two sf objects. The first has one object with 3 variables and the second 2 objects with 3 variables. The data looks like this:
Table 1
| River | length | geometry |
| ------ | ------ | --...
0
votes
0
answers
157
views
How to draw KML LineString with icons at each point
I'm trying to figure out how to draw a line in KML with some sort of indicators at each point in the line.
For an overly simplified example, say someone is hiking and they periodically record their ...
0
votes
1
answer
75
views
How to calculate the shortest geodetic(orthodomic?) distance from a Point to LineString using GeoTools?
First of all, sorry if used wrong terms. I have a LineString on and I need to calculate the shortest distance to it from a Point using java GeoTools library.
I don't need just geometric distance, ...
2
votes
1
answer
135
views
is this posible to extract coastline or border line from multipolygon geojson but keep them separate
i have multipolygon cities , how to get coastline or border line that not intersect with other cities, and keep separate each cities,
is that possible? there any software or programing method (like ...
4
votes
1
answer
194
views
TypeError when converting QgsMultiLineString to QgsGeometry using PyQGIS
I have previously written some PyQGIS code to replace the features in a LineString layer with new features. The outline of the code is below - I have left out the specific code to create data for the ...
2
votes
1
answer
136
views
Exploding lines with PyQGIS [closed]
Are there ways to realize exploding lines through PyQGIS?
I have layer with very complicated line and exploding lines is so slow, it doesn't end even after an hour. I've created spatial index and run ...
1
vote
2
answers
98
views
Find points x meters from a center in a specific direction (or line)
I just started to work with POSTGIS and I am currently working with signalised intersections. I have the center of the intersection as a point and the connecting roads as linestrings. I need to find ...
4
votes
2
answers
192
views
QGIS: Using marker line to calculate fence post positions and counts
I am making a farm plan in QGIS. One of the layers is the fencing layout (Shapefile / Line String). One of the fields is the post distance. Other is virtual field calculating post amount (length($...
0
votes
2
answers
301
views
Shapely intersection cuts LineString into MultiLineString instead of LineString
I ran into a problem where shapely.intersection cuts a LineString into a MultiLinestring with lots of short lines instead of a simple LineString. The intersection is made between a circle (Polygon) ...
1
vote
1
answer
66
views
QGIS - Unite many lines in a single Multiline (with branches)
I have a shapefile that contains many lines that connect to each other, forming branches, as shown in the picture:
How can I join all these lines into a single entity? I want the attribute table to ...
2
votes
1
answer
97
views
Combining two shapefiles containing roads of the same area
I have two layers both containing roads of the same area. One si from OSM, and the other is from another source. Both networks are quite dense and for the most part, they contain the same roads, ...
2
votes
1
answer
144
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
84
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
45
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
132
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 ...
2
votes
1
answer
159
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
208
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
79
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 ...
1
vote
1
answer
691
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
61
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 ...
2
votes
1
answer
119
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
78
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
121
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
40
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
538
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
122
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
73
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
73
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
99
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
192
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
67
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
84
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
164
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 ...
8
votes
2
answers
231
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 ...
1
vote
1
answer
231
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/...
6
votes
1
answer
874
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
329
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
76
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
610
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
238
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
377
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 ...