logo separator

[mkgmap-dev] [PATCH v1] Decide in style file if a way is closed automatically

From WanMil wmgcnfg at web.de on Thu Oct 25 17:10:48 BST 2012

> In my styles, I want to render closed waterway polygons as areas by using the continue statement in my lines:
>
> waterway=canal & natural!=water   [0x1f resolution 23 continue]
>
> polygons file:
>
> waterway=canal  [0x3c resolution 23]
>
> Those closed bodies are rendered ok now, filled with water. If this waterway area consists of two or more separate ways, connected to each other,
> this is not rendered as water polygon but only as linear elements, which is excellent.
>
> Problem arise at the tile borders, where I get unwanted side effects, linear elements of waterways that cross the tiles are automatically closed by mkgmap and therefore rendered as areas (filled up with water), which I do not want. I like to distinguish those artifical polygons in my style file from the really closed waterway polygons. Are those artifcially closed polygons tagged internally by mkgmap somehow, so I can exclude them from my polygon style?

No. This situation cannot be detected by the style file. At the moment 
all ways with both endpoints outside the bbox are closed automatically.

I have attached a patch that does exactly what you want.
All ways are now tagged with two additional tags:
mkgmap:wayclosed true/false - signals if a way is closed (first point == 
last point)
mkgmap:autoclosing true/false - true if both end points of the way are 
outside the bbox and the way is automatically closed if a polygon rule 
matches.

The patch is superfluous if splitter ensures that a closed way is closed 
in all splitted tiles.

WanMil

>
>
>
> Background:
> In the Netherlands there are tons of areas of water tagged as waterway=* (canal, drain, river).
> According to the wiki this tagging is wrong (for polygons natural=water should be used, or for bigger rivers, waterway=riverbank).
> But since Potlatch, Josm and Mapnik automatically render closed waterways as areas, many mappers are making this mistake.
> (One could argue if maybe the wiki should be revised, why is only waterway=riverbank a polygon and a closed body of waterway=river not?)
>
> In Potlatch all natural=water polygons are called "Lake" so many mappers want to 'improve' those areas by tagging them as waterways.
> I have tried to contact the Potlatch developers about this issue but they dont seem to care to adjust it.
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: autoclose_polygons_v1.patch
Type: text/x-patch
Size: 2011 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20121025/be13b9c8/attachment.bin 


More information about the mkgmap-dev mailing list