[GRASS-dev] Re: [GRASS GIS] #397: v.clean creates polygons instead of holes

GRASS GIS trac at osgeo.org
Sat Jan 31 10:46:31 EST 2009


#397: v.clean creates polygons instead of holes
--------------------------+-------------------------------------------------
  Reporter:  cgsbob       |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect       |      Status:  new                      
  Priority:  major        |   Milestone:  6.4.0                    
 Component:  Vector       |     Version:  unspecified              
Resolution:               |    Keywords:                           
  Platform:  Unspecified  |         Cpu:  Unspecified              
--------------------------+-------------------------------------------------
Comment (by mmetz):

 The problem is the detail of the vector map and the threshold for v.clean
 tool=rmarea. With a threshold of 2800 you reduce the vector from input
 Number of areas: 27613, Number of isles: 17107 to output Number of areas:
 1362, Number of isles: 1127. This is far too much, too many boundaries and
 centroids are deleted or rewritten to the coor file, topology can not be
 properly maintained on the fly: sometimes an existing centroid for an area
 can not be found. Although the boundaries have been deleted, the centroid
 is still there and assigned to the (new) area it lies in when topo is
 fully built again (the output also has duplicate centroids, for the same
 reason). What was an area without centroid is now an area with centroid,
 GRASS speak meaning something similar like ESRI speak "polygon instead of
 hole". What may in theory work is to rewrite Vect_remove_small_areas() so
 that topo is completely and properly rebuild every time an area is
 removed, but that is not an option, cleaning would take ages. v.clean
 tool=rmarea seems to work fine as long as not more than roughly 25% of the
 areas and isles are removed.

 Since you are not interested in this high level of spatial detail present
 in the vector lszone10, you can also

 1. in the raster lszone replace NULL with 0

 2. run a neighborhood filter window size 5 operation median

 3. replace 0 with NULL in the filtered raster

 4. r.to.vect, gives me 3136 areas and 3001 isles

 optionally 5. v.clean tool=rmarea thresh=2800 if there is still too much
 detail

 Works like a charm, everything done in a few minutes.

 Regards,

 Markus M

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/397#comment:9>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list