Bug report #2806

ftools.dissolve and geoprocessing.dissolve "loose" polygons

Added by Anita Graser over 14 years ago. Updated over 7 years ago.

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

Description

Both dissolve tools fail on the attached shapefile. Polygons are lost in the process. Compare http://forum.qgis.org/viewtopic.php?f=2&t=6724

suelosenah.zip - shapefile that doesn't work as expected with dissolve (132 KB) Anita Graser, 2010-06-13 03:38 AM

suelo2_shp.zip (118 KB) Giovanni Manghi, 2011-10-15 04:13 AM

diss_0_areas.jpg (77.2 KB) Giovanni Manghi, 2011-10-15 04:13 AM

History

#1 Updated by Giovanni Manghi over 13 years ago

  • Assignee deleted (nobody -)
  • Pull Request or Patch supplied set to No
  • Category changed from Vectors to 44

#2 Updated by Paolo Cavallini over 13 years ago

  • Start date set to 2011-07-25
  • Tracker changed from Bug report to 4

#3 Updated by Giovanni Manghi about 13 years ago

  • Resolution set to invalid
  • Target version deleted (Version 1.7.0)
  • Tracker changed from 4 to Bug report
  • File diss_0_areas.jpg added
  • File suelo2_shp.zip added

The vector is in much bad conditions than it seem just looking at it (and the QGIS "check geometry" tool basically looks only for self-intersections as in the pseudo-topological model are both allowed holes and overlapping areas).

Importing it into GRASS it shows that there are 610 holes, 310 overlapping areas and a number of 0 size areas. If you dissolve the vector with GRASS, or with QGIS after exporting 1_polygon from GRASS (as shapefile, for example), you'll get the "expected" result, but the 0 size areas will show very clearly in the middle of the polygons (see attached image).

The solution is importing into GRASS and during the operation setting the parameters "snapping threshold for boundaries" (to remove the slivers/holes) and "minimum size area to be imported" (to remove 0 size areas). This way the resulting vector will be perfectly clean (attached) and it will dissolve with no problems.

You may want also to read this ticket, especially the last two comments in #3126-15

Resuming: Arc* does some kind tolerance/snapping when dissolving, GEOS (the engine QGIS uses) doesn't (to keep as much precision as possible during union operations), but the option exist and may make sense to expose in the QGIS gui. You may want to open a feature ticket about this.

This is the result of the import operation of the original vector into GRASS is the following

@v.in.ogr -o dsn=/home/gio/Desktop/suelosenah.shp output=suelo snap=-1 min_area=0.0001

Over-riding projection check

Layer: suelosenah

Counting polygons for 63 features...

Importing map 63 features...


Building topology for vector map ...

Registering primitives...

761 primitives registered

13901 vertices registered

Number of nodes: 741

Number of primitives: 761

Number of points: 0

Number of lines: 0

Number of boundaries: 761

Number of centroids: 0

Number of areas: -

Number of isles: -


Cleaning polygons, result is not guaranteed!


Break polygons:


Remove duplicates:


Break boundaries:


Remove duplicates:


Clean boundaries at nodes:


Break boundaries:


Remove duplicates:


Clean boundaries at nodes:


Change dangles to lines:


Remove bridges:


Merge boundaries:


Building topology for vector map ...

Building areas...

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

1038 areas built

59 isles built

Attaching islands...

Number of nodes: 9238

Number of primitives: 29041

Number of points: 0

Number of lines: 0

Number of boundaries: 29041

Number of centroids: 0

Number of areas: 1038

Number of isles: 59

Number of incorrect boundaries: 78

Number of areas without centroid: 1038

Cannot calculate area centroid

Cannot calculate area centroid

Cannot calculate area centroid

Cannot calculate area centroid

Cannot calculate area centroid

Cannot calculate area centroid

Cannot calculate area centroid

Cannot calculate area centroid

Cannot calculate area centroid


Find centroids for layer: suelosenah


Write centroids:

407 areas represent more (overlapping) features, because polygons overlap in input layer(s). Such areas are linked to more than 1 row in attribute table. The number of features for those areas is stored as category in layer 2


63 input polygons

Total area: 1.49304E+08 (1038 areas)

Overlapping area: 32.6961 (407 areas)

Area without category: 1262.18 (400 areas)


Building topology for vector map ...

Registering primitives...
1000 2000 3000
3951 primitives registered

17787 vertices registered

Building areas...

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

Area of size = 0.0 ignored

1038 areas built

59 isles built

Attaching islands...

Attaching centroids...

Number of nodes: 2839

Number of primitives: 3951

Number of points: 0

Number of lines: 0

Number of boundaries: 3322

Number of centroids: 629

Number of areas: 1038

Number of isles: 59

Number of incorrect boundaries: 78

Number of duplicate centroids: 201

Number of areas without centroid: 610
Successfully finished@

#4 Updated by Giovanni Manghi about 13 years ago

  • Status changed from Open to Closed

#5 Updated by Giovanni Manghi over 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