[GRASS-user] v.generalize for polygons?

Wolf Bergenheim wolf+grass at bergenheim.net
Mon Mar 3 10:01:00 EST 2008


Hamish,

I played around with the map you gave me, and I think I found a way 
around the problem (though I'm still not very sure about what the real 
problem is, perhaps too many small areas or too many shorter segments 
(the boundary seems to be built of a number of smaller lines). I'll try 
to create another problematic map.
Anyway, here is how I was able to generalize it:

# First I fuse the short segments into one long boundary
v.build.polylines --o input=rc_merge_coast3 output=fused
# Then I clean away some (relatively) small islands
v.clean --o in=fused out=clean tool=rmarea thresh=500000.0
# finally generalize
v.generalize -r --o input=clean output=gen method=douglas_reduction 
reduction=20

The generalized map contains about 20% of the original points.

--Wolf

On 28.02.2008 06:16, Hamish wrote:
> Hamish:
>>> I have a high-res vector area map of regional districts which I
>>> wish to generalize. I am having trouble with finding the correct
>>> method in v.generalize to use. Currently every thing I try tends
>>> to break the area topology and leave only a portion of the now-
>>> open boundary.
> 
> I have now tried with a related vector, linked below, and it worked
> (very!) nicely for that. But it fails with a derivative vector map.
> v.digit shows no problems with topography.
> 
> Wolf:
>> What methods did you try?
> 
> many of them.. mainly douglas with a number of threshold values.
> 
>> What exact commands have you tried that fail? 
> 
> at the simplest:   v.generalize in= out=
> but some areas are missing.
> 
> 
>> Can you share the problematic map? (you can email it to me directly)
> 
> sure,
> 
> starting with:
> http://www.stats.govt.nz/statistics-by-area/regional-statistics/geography-mapping/download-digital-boundaries.htm
> -- Census based NZMG 2006 (37mb shapefile .zip)
> 
> I am looking at regional boundaries (RC) from REGC06_LV2.shp
> 
> this map generalizes nicely, but it includes the 12 nautical mile
> territorial buffer around the coastline. When I overlay that map with a
> detailed coastline is when I see the problem.
> 
> I'll send a sample of the v.overlay output off-list.
> 
> 
>> v.generalize does preserve nodes, and as long as the input map is 
>> topologically correct so should the output map be.
> 
> ok. (confirmed, it does a very nice job simplifying the above
> shapefile)
> 
>> Perhaps your threshold is way off?
> 
> Possible, as I am just learning. But I did try a number of ranges and
> slowly increase. All would be ok for slight generalization then big
> breakage.
> 
> e.g. it has a big jump between thresh=0.4865 and 0.487
> 
> Good:
>    v.generalize in=rc_merge_coast3 out=rc_gen thresh=0.4865 --o
>    ...
>    Number of vertices was reduced from 569815 to 521969 [91%]
> 
> Bad:
>    v.generalize in=rc_merge_coast3 out=rc_gen thresh=0.487 --o
>    ...
>    Number of vertices was reduced from 569815 to 336380 [59%]
> 
> 
> Daniel:
>> However, there is a flag(-r?) which prevents the module from removing
>> them.
> 
> Flags:
>   -c   Copy attributes
>   -r   Remove lines and areas smaller than threshold
> 
> 
> 
> thanks,
> Hamish
> 
> 
> 
> 
>       ____________________________________________________________________________________
> Looking for last minute shopping deals?  
> Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> 

-- 

<:3 )---- Wolf Bergenheim ----( 8:>



More information about the grass-user mailing list