Bug report #7708

Union produces the wrong output (plus progress bar does not move, too big output, error messages in log)

Added by Giovanni Manghi about 11 years ago. Updated almost 7 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:Processing/QGIS
Affected QGIS version:master Regression?:
Operating System: Easy fix?:
Pull Request or Patch supplied:No Resolution:fixed
Crashes QGIS or corrupts data:No Copied to github as #:16619

Description

Use the "union" with the two attached shapes "inputA" and "inputB".

On master the operation will return a warning

Warnings:
Feature geometry error: One or more output features ignored due to invalid geometry.
GEOS geoprocessing error: One or more input features have invalid geometry.
Some output geometries may be missing or invalid.

Would you like to add the new layer anyway?

even if the two input shapefiles do not have any kind of invalid geometries.

The output is missing a whole part belonging to one of the two inputs.

This warning does not show on 1.8 and the output seems (I underline the word seems) correct, but I have doubts about it. At least makes more sense than the result obtained on master.

On the attributes side the results is wrong since a long ago, see #4567

union.zip (231 KB) Giovanni Manghi, 2013-04-25 12:42 PM


Related issues

Related to QGIS Application - Bug report #7823: Vector\\Data management\\Merge shapefiles is not working ... Closed 2013-05-14
Related to QGIS Application - Bug report #7428: union progress bar does not move, wrong result, too big r... Closed 2013-03-24
Related to QGIS Application - Bug report #4567: Ftools - Union returns Wrong Table of Attributes Closed 2011-11-25
Related to QGIS Application - Bug report #8456: Union tool produces wrong result Closed 2013-08-12

Associated revisions

History

#2 Updated by Giovanni Manghi almost 11 years ago

Done again a round of tests, using the attached dataset, on the geometry side:

  • the result in master is (still) completely wrong
  • in QGIS 1.8 the result is also wrong, but less evident: have a look to a an accepted definition of "union"

http://resources.arcgis.com/en/help/main/10.1/index.html#//000800000010000000

and you will see that where features are overlapping, then in the union it is expected to have duplicated feature. In the attached result "union18", produced by QGIS 1.8, there areas where it is supposed to have overlapped/repeated features originating from overlapped parts in the input layers.

#3 Updated by Giovanni Manghi almost 11 years ago

See this #4567 and #4567-30 for a discussion about the resulting attributes.

#4 Updated by Giovanni Manghi almost 11 years ago

  • Subject changed from union produces the wrong output on master to Union produces the wrong output (plus progress bar does not move, too big output, error messages in log)

Files attached to #7428 do show also other issues:

the progress bar does not move, the log full of messages like

Feature geometry not imported (OGR error: )

Feature creation error (OGR error: Pointer 'hFeat' is NULL in 'OGR_L_SetFeature'.
)

and a way too big output, 282MB for 2MB worth of inputs.

See also #7428

#5 Updated by Daniel Vaz almost 11 years ago

Please see: https://github.com/qgis/Quantum-GIS/pull/760

It fix partially this issue

#6 Updated by Giovanni Manghi almost 11 years ago

Daniel Vaz wrote:

Please see: https://github.com/qgis/Quantum-GIS/pull/760

It fix partially this issue

Olá Daniel,
many thanks for your work!

I will test the patch, anyway the result of the union operation is (was) wrong also on qgis 1.8. The the above link (from an esri manual, but it could be other software/gis manual) about a common accepted definition of what the result should be.

#7 Updated by Daniel Vaz almost 11 years ago

Hi Giovanni, I am glad, in trying to help the QGIS community, in fixing bugs.
Thanks for the link, I need some time to read, comprehend and try to implement a good solution.
I hope that partial fix, may help QGIS users.

Thanks in advance

#8 Updated by Alexander Bruy over 10 years ago

Merged. Thanks, Daniel!

BTW, maybe it is better to close this ticket and open another one about incorrect union results?

#9 Updated by Daniel Vaz over 10 years ago

Yes, probably it is a good thing open a specific ticket about wrong union results and cite this ticket or move a test data set to the new one.

Thanks in advance

#10 Updated by Alexander Bruy over 10 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed

Closing this issue because 3e25f11845 "fixes" this tool (it produces now same result as 1.8 and progressbar works fine). New issue about union results is open, see #8456

#11 Updated by Giovanni Manghi almost 7 years ago

The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.

Also available in: Atom PDF