[GRASS-user] generalize polygons including holes
Markus Metz
markus.metz.giswork at gmail.com
Thu Feb 5 05:49:02 PST 2015
On Thu, Feb 5, 2015 at 11:50 AM, Moritz Lennert
<mlennert at club.worldonline.be> wrote:
> 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.
OK, the test was missing in 7.0, I have now backported it to 7.0 in r64471
> In GRASS 7.1 no
> more intersection, but actually for that hole the generalization is less
> with a higher threshold (see attached image).
That hole is actually not generalized at all with thresh=500 because
it would damage topology.
> 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 ?
This has always been the case.
Markus M
More information about the grass-user
mailing list