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
0
votes
1answer
11 views

How to add intersection vertices to a ShapelyLinestring?

Assume that I have two shapely LineStrings. I want to find their intersection and then add the intersection point as vertices into the respective LineStrings. from shapely.geometry import LineString #...
-1
votes
0answers
23 views

Most efficient method for large volume line comparison

I am looking for efficient ways of comparing two large line datasets (both ~ 100 Million features or more) to gauge their similarity. For sake of this question I'll call them Source (S) and Compare (C)...
1
vote
1answer
58 views

Density per grid cell

I have a shapefile with the following format. These are storm tracks and each unique "Serial" represents one storm track. import matplotlib.pyplot as plt import geopandas as gpd input = &...
3
votes
2answers
124 views

Selecting lines intersecting lines on two points in QGIS 3.14

I have two shapes of lines: one A with exploded red lines, the other B with closed black lines. In a virtual layer I want to select the yellow ones (A) i.e. those having only 2 points in common with B....
1
vote
0answers
27 views

How to make a PostGIS LINESTRING with only one initial point

I have a service that will be sending GPS coordinates as it moves, and these will be added to my PostgreSQL / PostGIS database. Right now, created a table with one column that is a Geometry("...
2
votes
1answer
52 views

Group geometry points and create a linestring for each group

I have a table of points at a Postgres database that have two main columns (geom geometry, time timestamp). I need a query to retrieve as linestrings or as array of the geometries the points that are ...
1
vote
1answer
39 views

Get all geom points that are more than 3 meters from the linestring, at big scale

With the help of Osmosis i was able to import all the data of a Open Street Map city, (Nodes, ways, etc...). In another table at same db, i have Millions locations in that city, these locations are ...
1
vote
1answer
38 views

How can I convert a LineString GeoDataFrame to a Points GeoDataFrame while retaining the vertice order?

I have a LineString GeoDataframe that I am trying to convert into a Points GeoDataframe, but I want to retain the GroupBy and SortBy features inherent in a LineString (i.e., all the vertices that make ...
0
votes
0answers
40 views

Display Features based on Zoom Level using OpenLayers

I want to display roads(linestring) on the map using OpenLayers.currently, I manage to assign styling based on road type but when I run the server I can see all the data displayed. I want to change ...
2
votes
1answer
37 views

Combining linesegments that are contionous into one feature in QGIS 3.10.7

I have a dissolved line, where I have clipped some segments where I would like to create a feature for each individual segment. I have tried using "Vector Geometry -> Multipart to singlepart&...
1
vote
1answer
62 views

Pandas dataframe to Shapely LineString using GroupBy & SortBy

I have a pandas dataframe that contains information to construct (poly)lines, and I want to use shapely & geopandas tools to make a SHP. In the example below, I have 3 lines differentiated by &...
0
votes
1answer
25 views

How to efficiently get the length of linestrings intersecting a huge raster file? [duplicate]

I have a huge shapefile (roadnetwork of Europe) and a raster file (Europe, 100x100m resolution). I want to calculate the length of the roadnetwork for each raster cell, resulting in a new raster layer....
1
vote
0answers
107 views

Road distances between lakes QGIS

I've got a dataset of about ~120 lakes (multipolygon) and and another one of roads (multistring line), and I need to determine the road distance from each lake to every other lake in the dataset, ...
0
votes
1answer
41 views

Linestring table (of MultiLinestrings) ST_Intersection

I'm moving from GeoPandas to PostGIS and GeoAlchemy. I've a table full of multilinestring geometries (timezones from NaturalEarth.com) and I've a linestring which represents what will be the route of ...
1
vote
0answers
18 views

Importing a Tracked Line Geometry (from LineString) in a CSV into QGIS (3.4)

I'm very new to GIS work and I hope this is the right place to post this. I haven't been able to find/understand an explanation on how to deal with my issue so I hope that I'm not asking an already ...
1
vote
2answers
34 views

Creating Line (MultiLineString) layer out of CSV file

I need to replicate a *.qgs-file that has 4 different layers as shown in the picture below: The layer that I am currently trying to replicate is the "links" layer. The information of the ...
1
vote
0answers
18 views

Points within “normal bounds” of a linestring in Python

I am working in Python (using Shapely). I have a list of Point(s) (the small circles in the image) and a LineString (the solid line with an arrow). I want to select only the points which are within ...
5
votes
1answer
50 views

Use tracing when extending linestrings in QGIS

In QGIS 3 it is possible to extend an existing linestring by clicking on the 'virtual endpoint' cross marker as described in https://docs.qgis.org/3.10/de/docs/user_manual/working_with_vector/...
0
votes
0answers
22 views

LineString Heatmap with Open Layers 3

I need to make a heatmap with a bunch of linestrings using AngularJS and Open Layers 3. I didn't find any examples, just a question answered here but that don't worked for me. In the question he do a ...
0
votes
1answer
21 views

Cut linestring segment at centroid in PostGIS

In a table of linestring three segments are connected. first--second--third could Postgis generate the centroid of second segment and merge first and third at center? Is it possible? first--...
1
vote
0answers
23 views

Formula to determine polygon points of a bounding box created from this equation

I have a series of points making a linestring I am trying to detect when a user is within a few meters of any section on the linestring with a tolerance factor For this, I use this java code (unsure ...
1
vote
0answers
88 views

How to find and remove invalid geometry in a multilinestring python geodataframe?

I have original data as a 700000's rows excel, with geometry data in hexwkb format. I want to plot it and make some spatial operations on it like intersect, distance and buffer, on a jupyter notebook. ...
1
vote
2answers
72 views

Merge Linestring that intersects without making them MultiLinestring

I am working on PostGIS 2.5.3 and PostgreSQL 11.2 As seen in the example below, I have 3 LineString that I would like to Merge to form one single Linestring. The squares represent the vertices, so we ...
1
vote
1answer
28 views

How to calculate the distance of points to line in R?

I need the distance from each point of the object found to the transect line. 'id' is a research transect, and 'obj.id' is the object found. in this case, 1 object was found in transect A and 2 ...
1
vote
0answers
23 views

Distance between different points

I am looking for a way to calculate the distance between different points in a linestring. In practice I created a linestring from a X and Y coordinate by means of st_linestring(asNumericMatrix(...
1
vote
1answer
64 views

BigQuery GIS table to GeoJSON type Feature Collection with SQL and/or Python

I have some BigQuery tables with spatial data (lon, lat, point, and linestring) representing boat tracks. I'm trying to get them into a GeoJSON featurecollection like [https://geojson.org/], for an ...
2
votes
2answers
72 views

Get LineString length in meters

I have a series of LineString that I want to have the length in meters. I use the shapely.geometry module, and importing LineString. I've seen this post, explaining how to do it, but it seems using ...
0
votes
1answer
36 views

set z-value from table

In qgis 3, postgis, no DEM and zero python knowledge. I've got linestring 3d but Z coordinates is empty, Z-values are stored in table. Z1 for the first node, Z2 for the last node. I found a lot of ...
0
votes
0answers
16 views

Find modified rows in two GeoDataFrames having split features

I have 2 GeoDataFrames having features that are essentially LineString and they are identified with a feature_id column. The first GeoDataFrames consists of the original features, while the second ...
2
votes
1answer
125 views

Is there a faster way to see if a polyline intersects itself?

I have several large polyline feature classes and I need to find how many times each polyline intersects itself (where it intersects is of no importance). I wrote the following code, which works fine,...
1
vote
0answers
58 views

Drawing the Tropics on D3.js geojson using Linestring

I am using the geoMercator projection on D3.js and want to draw the Tropic of Cancer and Tropic of Capricorn on my map. Right now I added the Equator using plot.append("path") .datum({type: "...
1
vote
0answers
35 views

Remove/hide the long connecting line in plotting GeoJSON linestring using Leaflet [duplicate]

I encounter this long connecting line when plotting a GeoJSON linestring. How do I hide/remove this connecting line? When I plot it in linestring: When I plot it manually (slower than using ...
2
votes
1answer
41 views

How to find the line is self intersected or not in python using QGIS

I have to find the line feature is self intersected or not. I have tried the below logic but not getting it.. Kindly suggest a way to find the solution. lineLayerName=self.lineLayer.name() for ...
1
vote
0answers
62 views

What to add as “measure” to a linestringM in PostGIS?

I am kind of new into the GIS world. I have a couple of GPS data in a CSV file as LonLat coordinates. I used PostGIS to create points from those coordinates using ST_MakePoint(). Then I tried to ...
1
vote
0answers
132 views

Failure to write LineString record to shapefile

I have some coordinates from which I am creating a shapefile. tafo_boundary_coords = [(652316, 742792), (652161, 742920), (651897, 743166), (652210, 743477), (652298, 743448),(652375, 743458), (...
1
vote
0answers
20 views

Populating linestring column based on other table values (OSM nodes/ways)

I'm trying to populate a linestring column using points from another table. After reading a lot in this site and many experiments I'm still stuck. This is the table which I want to fill the road ...
4
votes
1answer
56 views

Calculate difference of two LineString

The tool I'm developing is written in Java with Spring Boot, using PostgreSQL as database (PostGIS extension). I also make use of GeoTools. I want to calculate the geometrical difference between two ...
-1
votes
1answer
49 views

Spatially join linestrings (which can overlap or not overlap) in R and provide output in a data format that I can add other variables

I am using R to exam road infrastructure. The sf dataset I am using is very granular e.g. for the same road two or three observations may exist that are differentiated by different coloured tarmac ...
-1
votes
1answer
29 views

Weird problem with st_polygon in the sf package

I would like to create a simple polygon using the sf package. From my understanding, I have to create a two column matrix where the last row is identical to the first one to close the ring of the ...
6
votes
1answer
95 views

Does QGIS 3.10.2 change the line.xAt(0) function?

Is there a recent change to the way a LineStringZ nodes are referenced? I am getting the error Error 'QgsMultiLineString' object has no attribute 'xAt'. I have submitted it as a bug (#34094) but it ...
2
votes
1answer
59 views

Polygonizing LineString features to Polygon features and keeping Attribute table values using PyQGIS

i am trying to create a circular raster in Qgis3.8.3-Zanzibar with the Python console. I am able to make it with LineStrings (combine of Polyline and Circular String) and fill each feature with ...
0
votes
0answers
21 views

What is causing the error “more than one linestring in KML”

I exported a KML from Mapinfo as a single combined line, however when i try to uploaded into a different mapper I get an error indicating that there are multiple linestring tags in my KML. I can see ...
2
votes
1answer
207 views

Split linestring by selecting two points in OpenLayers?

I have a project where people can drag and drop a gpx file. This results in a multilinestring. People should be able to take a piece of their route and submit that. I was thinking of letting the user ...
1
vote
1answer
60 views

Length of longest street using Spatial SQL

I have a table with the geometry of streets and I`d like to find out, which is the longest and which length (in kilometers) it is. How can I summarize the individual street segments?
1
vote
1answer
86 views

Adding points every X distance along a LineString [closed]

I have a list of LineString coords: list = [(90, 170), (99.0, 159.0), (321.0, 159.0), (300, 146), (296, 23)] which looks like this. How to interpolate a point at every X distance along the line ...
2
votes
0answers
51 views

Problem when trying to cut linestring at multiple points after conversion from Multi-linestring

This is my script: def cut_line_at_points(line, points): ''' line is gdf format points are series of points in gdf format ''' # union all geometries - convert the gdf to shpely (...
4
votes
2answers
249 views

How can I extend a linestring to the edge of an enclosing polygon in PostGIS?

I have linestrings that are each entirely within a polygon. I want to extend the first and last segments to touch the first rings of the polygon in line with them.
0
votes
1answer
55 views

Spatial Analysis: use of buffer function inside GeoDjango's LineString model

I'm trying to make a buffer around a line. I've a model with a LineString field and I would to use the buffer function like this to make my buffer. The aim of this is render the buffer on a webmap ...
2
votes
1answer
2k views

How to create a linestring from a geopandas data frame?

I am trying to create a linestring from a geopandas dataframe with points as geometries date_time latitude longitude year data01 hour minute data02 0 2019-11-08 08:21:38 36.830444 -...
1
vote
1answer
45 views

Seeking algorithm that can re-locate vertices on linestring so that line does not intersect land polygons

I'm currently working with GPS data gathered from boats. The data has low temporal resolution (every 5 minutes) which causes the linestrings that display the boat's trajectory to be jagged. An example ...

1
2 3 4 5
8