You could store it as a geometry and make use of the function ST_LineFromEncodedPolyline
Polygonize the lines using Shapely
Quoting the following snippets from Shapely manual
#Returns an iterator over polygons constructed from the input lines.
There is also another function called polygonize_full.
It creates polygons from a source of lines, returning the polygons and leftover ...
I eventually figured out what was the problem. Part of leaflet request:
//attribution: "Algum texto de teste",
was calling for layout:message WMS decorator which wasn't declared in Geoserver settings.
Hence, after removing these from leaflet request, everything worked fine.
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.
Create line intersections with ...
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), '')
Aggregate the grid layer based on the attribute created in step 2.
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 ...
You can use this script for single symbol line layers:
layers = iface.layerTreeView().selectedLayers()
for layer in layers:
Change the number in .setWidth(0.86) to the line thickness you want
Select the layers you want to ...
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 ...
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:
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 ...
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 &...
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:
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 ...
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 ...
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)
Aggregate voronoi polygons based on line ...