1

In QGIS, Service area (from point) or Service area (from layer) geoprocessing tools create 1 resp. n multipart line features which (usually) contain many overlapping sections.

Most of them can be removed by running Dissolve and Split with lines (with itself) on the resulting service area layer.

However, overlapping lines remain that can't be removed using Delete duplicate geometries.

Here's an example of a service area that has been dissolved and split with lines:

enter image description here

All start and end points of the lines have been extracted as vertices here. I selected two vertices that are start or end points but seem to be located in the middle of a network edge because the respective line makes a "180 degree turn" and then partly overlaps itself. The other few cases with (partly) overlapping lines can be visualized using the "Identify feature" tool. In the following screenshot, only one feature is selected, but obviously there is a start or end point of another line located along this edge:

enter image description here

This seems like a bug within the service area or the split with lines tool—-and leads us to the detailed question:

How can these remaining overlaps (self overlaps and short lines overlapping longer lines) be removed in a performant way?

Delete duplicate geometries obviously only works for complete geometries and I have not found another tool yet to solve the issue.

This question came up when working on solutions for the question Extract all dangles of service areas in QGIS.

2
  • You could try the Explode lines tool, and then Delete duplicate geometries.
    – Matt
    Nov 22, 2023 at 9:18
  • Thanks, @Matt. I tried that. The problem is that the remaining overlaps don't lead to duplicate geometries as the highlighted vertices in the screenshots belong only to one of the overlapping edges and somehow are not detected as "lying exactly on another edge" - and thus not included when exploding the lines. At least I suppose that this is the cause of the issue.
    – winnewoerp
    Nov 24, 2023 at 7:07

3 Answers 3

4
  1. Multipart to Singleparts the Service area
  2. Snap the singleparts to themselves. I use a 2m tolerance
  3. Fix geometries
  4. Delete duplicate geometries

enter image description here

1
  • 1
    "Snap geometries to layer" was the crucial point here and helped me to solve the issue. Thanks again. See my respective answer gis.stackexchange.com/a/470889/52808 with the modified version of what you proposed.
    – winnewoerp
    Nov 25, 2023 at 7:10
4

Here's what finally worked for me:

Model for cleaned service areas

Description of the algorithms used to clean the service area:

  • Multipart to singleparts: Needed for snapping to work correctly
  • Snap geometries to layer: Snap singleparts to singleparts, minor tolerance was enough in my case
  • Fix geometries: Was not necessary in my case, but it seems valuable to include it
  • Dissolve: Dissolve again (here by a temporary ID added for each start point to get separate features in case of multiple start points)

Explanation: Unfortunately, BERA's version did not work completely. Instead of deleting duplicate geometries I had do dissolve the service area to clean it up.

2

Depending on what you want, dissolving the result might be the quickest and easiest option. You might want to convert multipart to single part features afterwards.

If you still have duplicate lines, then run shortest path network tool on the layer - ideally from all dangles to a point in the center of the network to cover the whole network, but avoid "sidetracks". See here for details.

5
  • Thank you. Sorry, I forgot to say that I tried that as well (see my edited question). I will check again and maybe extend the question again afterwards. If you say that it should work then I am maybe missing an important detail.
    – winnewoerp
    Nov 20, 2023 at 19:54
  • 1
    I tried to address this, see updated answer
    – Babel
    Nov 20, 2023 at 21:40
  • Thank you. That may be a solution. But I need to run my tool on lots of different service areas and a complex solution including another network analysis tool results in heavy performance issues.
    – winnewoerp
    Nov 21, 2023 at 6:35
  • Ok, do not sure what is the reason for duplicate lines . Maybe a sample of your data could help
    – Babel
    Nov 21, 2023 at 6:52
  • Maybe the problem is related to the problem described here: gis.stackexchange.com/a/470514/52808
    – winnewoerp
    Nov 21, 2023 at 12:20

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.