New answers tagged

3

You could store it as a geometry and make use of the function ST_LineFromEncodedPolyline ex: select st_asText(ST_LineFromEncodedPolyline('ezdvBcps}Lt@W@F@BVKl@UK]Wc@}@kAOKBEzA{BdA}Ab@s@LBf@RjARZBv@?rAAfBIX?f@FLBf@^b@hATbAF~@BvB?hALjBHpCLjAVdAd@dAxCbGlA~BbBvCpAbD`AnCVpB\\hBf@nB|@tAb@f@RVXLbDj@jCl@nAf@`DbBdC`B`@b@HNN`@lA~DnAvBvB`G\\fA^p@j@z@~E`FbBpBxDfFXh@|@pD`...


1

Polygonize the lines using Shapely Quoting the following snippets from Shapely manual shapely.ops.polygonize(lines) #Returns an iterator over polygons constructed from the input lines. There is also another function called polygonize_full. shapely.ops.polygonize_full(lines) It creates polygons from a source of lines, returning the polygons and leftover ...


0

I eventually figured out what was the problem. Part of leaflet request: format_options: 'layout:message', //attribution: "Algum texto de teste", layout: 'message' was calling for layout:message WMS decorator which wasn't declared in Geoserver settings. Hence, after removing these from leaflet request, everything worked fine.


4

Solution 1 Run Menu Processing / Toolbox / Line Intersections (see documentation) to get a new layer with points showing where lines cross (red dots in the screenshot). You can select twice the same layer as Input and and Intersect layer or two different layers, depending which intersections you're looking for. Solution 2 Create line intersections with ...


5

Another possibility: Create a polygon grid (rectangles, hexagons) with the extent of the polygon. Create a new field to get the $id of the nearest line to each grid cell with this expression: if(overlay_intersects('polygon'), overlay_nearest('line', $id)[0], '') Aggregate the grid layer based on the attribute created in step 2.


7

Make sure your lines layer has a unique identifier (I used a field called Label with 'A', 'B', 'C' etc. A unique number will also work but the label field is a bit easier to spot later). Densify your lines by a given interval and Extract Vertices Use Voronoi Polygons (with a sufficient buffer region) Dissolve the Voronoi output using the unique identifier ...


7

You can use this script for single symbol line layers: layers = iface.layerTreeView().selectedLayers() for layer in layers: layer.renderer().symbol().setWidth(0.86) layer.triggerRepaint() iface.layerTreeView().refreshLayerSymbology(layer.id()) Change the number in .setWidth(0.86) to the line thickness you want Select the layers you want to ...


0

WhiteboxTools' RasterToVectorLines function might be what you're looking for.


1

The basic idea is the create a dissolved buffer around every bird species and create the intersection of this buffer with the river. There is a direct way to do that by creating a virtual layer with this query: select st_intersection (st_union (st_buffer(b.geometry, 100)),l.geometry) as geom from line as l, birds as b where b.species =4 replace line and ...


1

Meanwhile (since QGIS 3.16), there is the new overlay_nearest function you can use for that with QGIS expressions. For each point, 1) get the nearest line with overlay_nearest, 2) get the closest point on this line to the point using closest_point. The expression to be used with Geoemtry generator or Geomtry by expresssion (see here for details) look like: ...


0

The solution: principle Create a buffer around the street with variable width (until the nearest building), extend it slightly and than get all the boundary lines from the buildings completely inside the buffer. Remark: as @Spacedman remarked, any solution to this problem is confronted with a general problem, inherent to the nature of the data: using ...


6

Use Menu Processing / Toolbox / Split lines by maximum length. Red dots are start-points of the line segments after applying the tool:


0

To remove unwanted connections, simply identify lines shorter than a certain threshold and delete them. Depending on how the data is structured, first convert your lines to single part features: Select all lines of the layer, toggle edit mode, Merge selected features. Then run Multipart to single parts. Use Select by expression with the expression $length &...


6

Explode lines Create a new attribute with field calculator and this expression: array_length(overlay_intersects( @layer, $id)) Set stroke width to data driven override and use the attribute from step 2 as input. Lines are set in different colors based on the initial line's unique id to better discern how different lines overlap:


8

I assume your routes is one layer. You can create a virtual layer with the code: with cte as ( Select st_intersection(a.geometry, b.geometry) geom --3: Return the intersecting geometry from "routes" a join "routes" b on st_intersects(a.geometry, b.geometry) --1: If two lines intersect where a.id<>b.id) --2: And the id is not the ...


0

Based on your screenshot it seems that the length of all parallel lines are equal but the width spacing between them is not uniform. In such a case, to find a centerline programatically, you can Resample your polylines at regular interval for eg. 1 point / meter to obtain uniform sampling rate across all polylines Next find midpoints of line segments ...


6

To create "buffers" along the mid line between irregularily spaced lines, create voronoi polygons: Densify lines and Extract vertices. Create voronoi polygons for the densified points Join the line id to the voronoi polygons, using Field calculator with this expression overlay_intersects ('line',$id)[0] Aggregate voronoi polygons based on line ...


Top 50 recent answers are included