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
1
vote
2answers
268 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
76 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
109 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
102 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
70 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
499 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
32 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
125 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
894 views

Access vertices of a line in Python

Given a shapely.geometry.linestring: How do you access single vertices using Python?
1
vote
1answer
218 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.
2
votes
1answer
429 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 ...
1
vote
1answer
36 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
61 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 ...
0
votes
1answer
270 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
255 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
30 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
42 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. ...
5
votes
1answer
580 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
525 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
950 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. ...
1
vote
1answer
4k views

Cannot access coords property of LineString in GeoDataFrame

How can I access the coords property of a LineString in GeoDataFrames? I can access other properties, such as area, length, etc, as documented in the Shapely documentation. See reproducible example ...
2
votes
1answer
511 views

Creating Multipolygon Shapefile from MultiLineString GeoJson using ogr2ogr?

Right now I have a GeoJson file with a structure like this: { "geometry": { "type": "MultiLineString", "coordinates": [ [ <Coords line 1> ], [ <Coords line ...
1
vote
3answers
6k views

Convert MultiLineString to LineString using QGIS

In QGIS, I've tried the following options to convert my GeoJSON file from MultiLineString to one or multiple LineStrings (translating the Danish version): Vector -> Geometry Tools -> Polygons to ...
3
votes
1answer
886 views

Multilinestring to Linestring PostGIS 2.3

I am trying, as the title suggests, to transform a geometry that was a MultiLinestring into a Linestring. I first create a copy of the table I want to change, as a temporary table from which I can ...
1
vote
2answers
1k views

Intersecting linestrings with polygons in Python [closed]

I have two shapefiles, one is a 1x1 km grid displayed as polygons and the other one is a street network displayed as linestrings. I want to cut the linestrings where they intersect the boundaries of a ...
4
votes
2answers
374 views

Find LineStrings with common segments in PostGIS 2.3

I would like to find LineStrings with common segments ('collinear', i.e. LineStrings that have 2 or more consecutive points in common) with PostGIS. I'm not shure if I'm missing something, but ...
4
votes
2answers
277 views

How to make QGIS place markers at greater distances evenly?

I am trying to get waterlines visualized with arrow lines, but when zoomed out I can't get them to be spacious enough. So as you can see on the markerline settings, i set 100 pixels as an interval, ...
2
votes
1answer
939 views

Concatenating string with space

I am adding a number of strings together to create a linestring but as such I need spaces between the initial XY values and the end XY values, plus a comma in between the two halves. Should result in ...
3
votes
3answers
2k views

Breaking long line segments into shorter ones in R using sf

I have a shapefile of river segments that I've imported into R. The segments range in length from 5-115km. I want to split the segments that are over 10km into 10km chunks. So I use st_segmentize. But ...
3
votes
3answers
1k views

GeoJSON convert Polygons and MultiPolygons to LineStrings and MultiLineStrings

Is there a gdal or python based tool for converting Polygons and MultiPolygons inside of GeoJSON to LineStrings and MultiLineStrings? I'm using rasterio / rio rasterize or gdal_rasterize to rasterize ...
0
votes
1answer
807 views

How to use leaflet-measure-path with GeoJSON Linestring?

I am trying to use the "leaflet-measure-path" plugin for leaflet to print the segment length of some geojson linestrings. I am using the "Leaflet Ajax" plugin to load the GeoJSON files into my map ...
2
votes
1answer
713 views

Cluster GeoJSON (linestrings and markers) into circles using Leaflet

I have different hiking routes (in geoJSON format) displayed on a map. They contain linestrings, multilinestrings and markers. Currently, it looks like this: http://www.hikethisway.today/Sweden.html. ...
1
vote
0answers
108 views

Combine two GeoJSON files [duplicate]

Is there a clever way to combine two or more geoJSON files? I would like to combine the two geoJSON files here: https://gist.github.com/szeconku/3c0d3021178d8598f04dc5273864bd81
2
votes
1answer
4k views

How to get leaflet polyline segment length?

I'm working on a project that plots out some pipes on a leaflet map, these are displayed on the map as polylines with arrows showing flow direction. i am feeding the data in as geojson linestrings ...
1
vote
2answers
489 views

How to check how many line intersects a intersecting point in same geometry

I want to know that how many line intersects a point. In figure below it can be seen that 3 lines crosses a point. 2 red lines and 1 blue line. I want to know in the same geometry that many lines ...
1
vote
1answer
302 views

How to find a substring of LINESTRING in SQL Server?

I am trying to find the part of a LINESTRING between two points in SQL Server 2012 and am looking for how to approach it. Here's one sample: declare @point1 geometry, @point2 geometry, @line ...
0
votes
1answer
646 views

Apply onEachFeature only on Points. Ignore LineStrings

I have a couple of GeoJSON files where each GeoJSON file contains a LineString and some Points (a LineString represents a hiking route and the points represent shelters). I would like to display the ...
2
votes
0answers
158 views

Postgis List of adjacent LineStrings ordered sequentially from one end of the MultiLineString to the other

I have LineStrings that represent a road network/address centerline that are segmented at intersections, etc. I have determined how to query collections of LineStrings that are adjacent to each other ...
1
vote
1answer
192 views

Why does a LINESTRING change in length after union with a shorter but completely-overlapping LINESTRING?

I have two linestrings that I am trying to merge and determine their total length: This is a contrived example: the green linestring B is fully-contained within the red linestring A (but this will ...
1
vote
1answer
571 views

Calculate length of Multilinestrings/Linestrings/Polygons in geoJSON file

I have a couple of routes on my map where I would like to display the length of each route. I think I've found what I was looking for here: https://github.com/tyrasd/geojson-length, but I'm not sure ...
2
votes
1answer
369 views

Sliding box on Area Python Shapely

I have a huge area of linestrings and I want to get the features of each portion of area. All the linestring parts are stored in a python list and they are not in order. One portion of area is shown ...
2
votes
2answers
143 views

Is it possible to adjust the length of a GeoJSON LineString?

Let's say I have the following GeoJSON: { "type": "FeatureCollection", "features": [{ "type": "Feature", "properties": {}, "geometry": { "...
2
votes
1answer
1k views

Bearing of Two close lines in python

In the picture below I am finding the bearing of two close lines. This is the picture of two complete lines. The brown line might be a bit large from the blue line. Should not be the bearing of these ...
2
votes
1answer
192 views

Breaking the line into small segments

I am using spatialite and it does not contains the method ST_dumppoints and ST_dump. I want to divide several linestring into smaller parts. I also have points that I combined and that resulted in a ...
1
vote
1answer
75 views

postgis create 100 foot linestring from scratch in well known text

I am beginning to learn about postgis linear referencing functions and just generally working with lines. I want to simply make a 100 foot line in 3424 (NJ stateplane) first I tried creating the ...
2
votes
1answer
173 views

Bringing two lines together and getting their difference

In the photo there are two lines that are parallel to each other. I want to bring them at same coordinates and carry out the difference between them, which will be the small part of red line from the ...
2
votes
1answer
81 views

When trying to find the nearest line to a point, how useful are nodes?

I am working with a dataset (OS Open Roads) which consists of lines and nodes in separate shapefiles. The lines represent the roads themselves. The nodes represent, for example, the end of a road, ...
3
votes
1answer
418 views

Split lines in segments based on distances in Oracle

I have a data set consisting of 2D linestrings which are stored in an Oracle database in table my_lines with an id and a geometry column (units are in meters). In a separate table my_intervals with a ...
2
votes
1answer
442 views

Change the geometry type from LineString to MultiLineString SQL Server

I have a SQL Server database table to contains two geometry types: LineString; and, MultiLineString. What is the best way to change the type of all of the LineString geometries to 1 part ...
0
votes
1answer
998 views

returning a LineString on selecting its midpoint

I have a list of shapely LineString, [<shapely.geometry.linestring.LineString object at 0x000001614D750CC0>, <shapely.geometry.linestring.LineString object at 0x000001614D750D68>, <...