New answers tagged


Here is a slighlty modified version, that transforms the layer in-place. It also works if the line layer and point layer have different CRS : def space_evenly_along_line(point_layer, line_layer): points_by_line = {line.geometry(): [] for line in line_layer.getFeatures()} # Reproject geometries if neeeded if !=


For me this worked: processing toolbox > 'Delete Holes' and run without any minimum area.


I've put together a Python script which should do what you want here. Open the Python console, and use the tool bar icon outlined in red below to open a new editor. Copy the code below and paste into the editor (not the Python prompt) and use the icon outlined in red below (green arrow) to run the code. *A couple of notes: Both your line and point layers ...


Deduplicating a polygon is possible, I use the following code: private LineString deDuplicate(LineString exteriorRing) { ArrayList<Coordinate> outRing = new ArrayList<>(); int nPoints = exteriorRing.getNumPoints(); Point lastPoint = exteriorRing.getPointN(0); for (int i = 1; i < nPoints; i++) { Point p = exteriorRing....


I found this high performance alternative: WITH segments AS ( SELECT gid, ST_AsText(ST_MakeLine(lag((pt).geom, 1, NULL) OVER (PARTITION BY gid ORDER BY gid, (pt).path), (pt).geom)) AS geom FROM (SELECT gid, ST_DumpPoints(geom) AS pt FROM lines) as dumps ) SELECT * FROM segments WHERE geom IS NOT NULL; source:

Top 50 recent answers are included