logo separator

[mkgmap-dev] [PATCH] multipolygon

From Carlos Dávila cdavilam at jemila.jazztel.es on Fri Jul 10 18:26:12 BST 2009

Rudi escribió:
> I had several problems with the rendering of multipolygons on my Garmin
> Mobile XT. So I made a small patch. See attachment.
>
> Problem 1:
> Simple holes in a polygon are rendered correctly, but if the inner polygon
> has additional tags then this information is not rendered. In my example
> (Chiemsee in Germany) the lake (natural=water) has the role 'outer' and the
> islands have the role 'inner' with additional tags (natural=land,
> landuse=residential).
>
> Solution:
> The points of the inner polygon are no longer deleted. 
> (According to the wiki the inner polygon shouldn't have tags in the case of
> a simple hole, but in reality this is not always true. I remove identical
> tags from the inner polygon, so simple holes are still rendered correctly.)
>
> Problem 2:
> Multipolygon within a multipolygon. In my example the island has the role
> 'inner' and also the role 'outer' of another relation (wood inside the
> island). Now I have a problem: The order of the processing of the relations
> is not determined. If the lake relation is processed first then everything
> is ok. But if the island relation is processed first then the polygon of the
> island is changed (polygon is extended by the inner ways) and this has a
> negative influence on the lake relation. Now we have water within the island
> because the lake polygon is extended by the island way that was extended
> before.
>
> Solution:
> I duplicate the outer way and remove all tags of the original outer way. The
> new outer way is changed (adding the inner ways) but this doesn't influence
> other relations because they refer to the original outer way. By removing
> the tags of the original way it will never be used by the style.
>
> Problem 3:
> Small multipolygons are rendered correctly but I have a problem with larger
> multipolygons. The inner holes are visible at low zoom levels, but they
> disappear if I zoom in. I don't know if this is a problem of the Garmin
> software or if this is an effect of a filter in mkgmap.
>
> Solution:
> Nodes with identical coordinates (where the outer way is joined with the
> inner way) seem to be the reason. I shift two nodes by one unit, now the
> multipolygon is displayed correctly if I zoom in.
>
> To do:
> - I am a novice in java programming. A code review is suggested (if the
> patch is a candidate for trunk).
> - If problem 3 is caused by an mkgmap filter then it would be better to
> change the filter instead of moving the nodes.
>
> Rudi
I still could not try your patch, but I would like to know if you think
it would solve problem with this multipolygon [1]. It was correctly
rendered by mkgmap until OSM migration to 0.6 API. Due to this change, I
had to split outer polygon in three parts of less than 2000 nodes each
one. Since then it is not rendered by mkgmap. I have also noticed this
multipolygon is not correctly rendered by Osmarender [2], but it is by
Mapnik, so may be some problem in the data I didn't found.
Regards
Carlos
[1] http://www.openstreetmap.org/browse/relation/128102
[2]
http://www.openstreetmap.org/?lat=39.7939395904541&layers=0B00FTF&lon=-6.39816284179688&zoom=11



More information about the mkgmap-dev mailing list