2

Someone else created the shapefiles of the water district. There are some valves in a valve feature layer that are not on the water lines of the water lines feature layer. They are close but not snapped to the line features.

Is there some way to use QGIS to find those point features that are not on a line feature so I can correct them without checking every single point feature?

2 Answers 2

3

If you just want to automatically snap the point features to the line layer, you can try the Snap Geometries to Layer algorithm from the Processing Toolbox.

enter image description here

You will need to experiment with the snapping tolerance depending on your layer CRS and how far the wayward points are from the lines.

enter image description here

Results:

enter image description here

If the points need individual attention and you would like to select them instead, there are multiple ways to achieve this. One fairly straightforward way without using pyqgis or expressions, is to use the Select Within Distance algorithm from the Processing Toolbox.

enter image description here

The value you use for distance will depend on whether your layers are in a geographic or projected CRS. Obviously the tolerance will be more accurate if using a projected CRS.

enter image description here

Once you work out the correct distance value to use and run the tool, you can then invert the feature selection.

enter image description here

Now, all your point features which are not snapped to a line feature should be selected.

enter image description here

2

Use Select by expression with overlay_disjoint:

Returns whether the current feature is spatially disjoint from all the features of a target layer, or an array of expression-based results for the features in the target layer that are disjoint from the current feature.

overlay_disjoint('pipes')

Change pipes to the name of your line layer. Three of my valves are not snapped to the pipes:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.