Skip to content

Union (multiple) and Intersect on lines results in holes and incorrect lenghts in the resulting overlaps #62134

@bhazoo

Description

@bhazoo

What is the bug or the crash?

The Union (multiple) tool does not work as expected; it gives some unexpected results, as these images will show.
Trying to get a correct result by using the Intersect tool, layer by layer, produces the same erroneous results that are shown below.

Here is the project used for all the following images
project.zip

The network:
Image

Result of the overlap for two of the layers (same result if the tool is run with only 2 overlap layers instead of 3):

Image

Resulting 7 features look weird (this does not matter as much as the attributes seem generally correct):

Image

Showing the holes in the result:

Image

Steps to reproduce the issue

  1. Have 3 multi-lines that overlap each other, with the overlaps not ending on vertices from overlapping layers. (it is an output from the network service area tool).
  2. Merge the lines
  3. Dissolve the merged lines (to use as input layer)
  4. Open Union (Multiple)
    • Input layer: merged lines
    • Overlay layers: the 3 lines - drag and dropping when there are 3 points always removes the layers from the layers panel on all user profiles (has probably been reported already)
    • run
  5. result:
    • Checking the overlaps by using the attribute table to group them with symbology (also checking the symbol levels) shows the unexpected results.

lines have their own feature (correct)
- the a-b, b-c and c-a overlaps seem generally correct, but the endlines are not at the correct place
- the overlaps have portions that are cut out and joined as a multipart feature, and have often incorrect attributes (are joined with layers from another overlap, as confirmed from the attributes).
-

Also:
Using the Union (not multiple) directly with a layer that has the 3 lines as 3 separate features (such as an output from the service area tool) runs but does not create an output.

Versions

3.42.3

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

I am trying to evaluate the where the outputs for my service area overlap. Then I can evaluate (from the attributes) where my requirements are met on these overlaps.

My project will have much more than 3 service area lines (and some added complexity) but I am not able to create a workflow that gives me the result. but I cannot simply get the correct overlap geometries (holes and incorrect lengths).

Using Intersect with the same layers can give me holes.

I knew about the arcgis identity tool, so I tried it using the same inputs (actually using the merged layer); it gives a result with no holes and correct lengths, with duplicate line segments on different sections that overlap. It also has some weird looking segmentation at some places.

But then I can use dissolve using the segment lengths as the dissolve field, and with a summarize field (arcgis dissolve has an option to summarize, concatenate, etc. one or multiple fields) I can evaluate my overlap requirements.
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugEither a bug report, or a bug fix. Let's hope for the latter!ProcessingRelating to QGIS Processing framework or individual Processing algorithms

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions