[GRASS-user] generalize polygons including holes

Moritz Lennert mlennert at club.worldonline.be
Thu Feb 5 02:50:08 PST 2015


On 05/02/15 10:06, Markus Metz wrote:
> On Thu, Feb 5, 2015 at 9:36 AM, Moritz Lennert
> <mlennert at club.worldonline.be> wrote:
>> [Please keep conversations on the list]
>>
>> On 04/02/15 16:12, Robert Nuske wrote:
>>>
>>> Hi Moritz
>>>
>>>>> is there a way to generalize polygons including their holes?
>>>>> I am not too worried about topology, there are only polygons of one
>>>>> class
>>>>> in the dataset.
>>>>>
>>>>>
>>>>> I tried the following
>>>>> v.generalize in=m3 out=m5 type=area method=douglas threshold=5000
>>>>>
>>>>> which simplified the "outer boundaries" okay but did not touch the
>>>>> "inner
>>>>> boundaries"/ holes of the polygon.
>>>>>
>>>>>
>>>>> Outer boundaries are on the left side in the picture and holes on the
>>>>> right
>>>>> http://i.imgur.com/hHKr15m.png
>>>>
>>>>
>>>> It looks like the red boundaries are the generalized version of the
>>>> original blue ones. Is that correct ? Are you sure that the original
>>>> boundaries of the holes are identical to the new ones ? Could you
>>>> display the result with polygon fill color set to transparent ?
>>>
>>>
>>> That's right.
>>> Original vector map is blue and simplified vector is red.
>>> Both layers are 50% opaque in the following image
>>> http://i.imgur.com/Rsx7Kh1.png
>>
>>
>> I imagine you are using GRASS 6 ? I can confirm the issue there with GRASS
>> 6.4.4, but it has been solved in GRASS 7. See the attached image where you
>> have two holes: both have been generalized with method=douglas (black =
>> original, red=lower threshold, blue=higher threshold). You can clearly see
>> that generalization is also happening for the hole boundaries.
>
> The right hole has not been generalized properly, the resultant
> boundary intersects with itself. This has been fixed in GRASS 7
> recently. Do you get the same result with recent GRASS 7.1?

No. The example was with GRASS 7.0 from a week or two ago. In GRASS 7.1 
no more intersection, but actually for that hole the generalization is 
less with a higher threshold (see attached image). I've attached the 
vector file I used as a GRASS 7 vector pack for the NC location.

The settings I used were:

v.generalize test method=douglas thresh=100 out=test_gen_100
v.generalize test method=douglas thresh=500 out=test_gen_500

>
> v.generalize does not distinguish between outer and inner rings, it
> simply goes through all boundaries and generalizes each one.

And this has always been the case or this is specific to GRASS7 ?

Moritz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_generalize_holes.png
Type: image/png
Size: 82130 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20150205/3c596681/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.pack
Type: application/octet-stream
Size: 3304 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20150205/3c596681/attachment-0001.obj>


More information about the grass-user mailing list