I'm working with a shapefile of Enumeration Districts (Setores Censitários) of the 2010 Brazilian Census. Enumeration Districts (ED) are smallest areas for which Brazilian Census data is available. The 2010 Census had 318 thousand EDs. Created to facilitate Census logistics, EDs defined as areas containing from 250 to 350 households in urban areas and 150 to 250 in rural areas, so that they can be surveyed by one of Census surveyor. To avoid double counting or ignoring households, EDs must divide the space in a topologically consistent manner, with no overlaps or gaps.

To fix eventual overlaps and gaps, i'm using GRASS tools in QGIS, but the results are changing significantly the original topology. Here is an example of topological errors in the shape: enter image description here.

To import the shape vector to GRASS mapset i'm using the v.in.ogr.qgis tool with 0.0001 snap threshold and 0.1 mininum size of area. Just a few cases of overlaps and gaps are fixed and increasing those values didn't solve the problem, so i tried to use de v.clean tools to make these corrections in a controlled manner.

The v.clean.bpol didn't make much difference. The v.clean.snap with 0.0008 threshold solve the gaps problems, but it changed the original topology in other areas, as you can see in the image:enter image description here

Lower thresholds keeps the topology, but don't solve the gap problems.

The v.clean.rmarea with 10000 threshold solve some of the cases of overlap, but it erases some of the original areas that area very small as well. Lower threshold won't dissolve the overlap areas and greater threshold will dissolving original small areas.

There is anyway to fix these topology problems using GRASS or another tool but without changing the original topology in the process? A more controlled manner to do this validation?

Here is available a small portion of the shapefile that i've been working: https://www.dropbox.com/sh/daodgcww4afr2w1/AABCUiHMnscNJPE3zRmjKfVJa?dl=0

  • 1
    I'll just note that also PostGIS' ST_Snap is not perfect for this, as it is using heuristics. – lynxlynxlynx Aug 7 '15 at 18:09
  • I'm not used to handle data in latlon, so I have no idea what your snapping and minarea thresholds are in meters, which would make it much more understandable. Did you consider densifying your layer, so when importing, you have more vertices available to snap to? Don't know how that works in GRASS, in QGIS there is "Densify geometries" or "Densify geometries at given interval". When your average vertice distance is around/below your snapping threshold, you might get better results. Just an idea ... – Bernd V. Aug 8 '15 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.