Hot answers tagged

5 votes
Accepted

Forbid create line between the same point through geometry expression

You dont need to use geometry by expression if you are going to use PyQGIS anyway. With itertools.combinations you can generate all pairwise point combinations, then build linestrings between them: ...
BERA's user avatar
  • 71.2k
4 votes
Accepted

Exploding lines with PyQGIS

Let's assume there is a polyline layer called 'to_explode' (three features) with its attribute tables, see the image below. Proceed with Plugins > Python Console > Show Editor and paste the ...
Taras's user avatar
  • 32.6k
3 votes
Accepted

Split line by another line doesn't work

I assume it is because your lines to not actually cross the other lines in most cases, they just touch (or eventually not even that). That they sometimes do touch/cross / do not touch/cross may be due ...
MrXsquared's user avatar
  • 33.8k
2 votes
Accepted

QGIS - Find point position on line (lengthwise)

You can use the field calculator on the POINT_Layer. I don't think there is a one-click tool. line_locate_point(aggregate('YOUR_LINE_LAYER_NAME','collect',$geometry),$geometry) EDIT - Based on ...
Xeppit's user avatar
  • 1,110
1 vote
Accepted

Incorrect output when smoothing line that intersects multiline with PyQGIS

There are several suggestions regarding your code: Break your '9 boundary 3 collected' lines with the "Multipart to singleparts": bound_layer = QgsProject.instance().mapLayersByName("...
Taras's user avatar
  • 32.6k
1 vote

Selecting roads covered by point features QGIS

I see two possible solutions for this task, but unfortunately, both have some limits. If you have an ordering field for your points (as John's comment mentions), you can use the processing algorithm ...
crafter6029's user avatar
1 vote

Selecting points near lines in QGIS

You can try to use the select-by-expression tool in qgis. With selected POINT_Layer use the fowlling expression (substitute 100 by the wanted buffer width): within($geometry, buffer(aggregate('...
Xeppit's user avatar
  • 1,110

Only top scored, non community-wiki answers of a minimum length are eligible