[OSM-dev] Advice sought on polygon-with-hole drawing

Robert Vollmert rvollmert-lists at gmx.net
Fri Mar 14 08:45:20 GMT 2008


On Mar 14, 2008, at 00:05, Frederik Ramm wrote:
>    I'm currently working on a Perl re-implementation of Osmarender. It
> is already almost feature complete; I've made an early announcement on
> the tiles at home list:

Great!

> change is the way polygons with holes are drawn. I want to switch from
> the default evenodd rule (that relies on the directions of ways) to
> the nonzero rule, and use it like so (pseudo code, omitting all the
> filtering and layering stuff):
>
> for each way with area tagging
>    if way is member of multipoly relation
>       if role is "inner"
>          ignore way

I agree with Cartinus here -- inner ways should be rendered as usual.  
You could ignore tags on the inner way that are also on the outer way  
as suggested. Ultimately, I think this should not be necessary. It is  
straightforward to remove these duplicate tags once.

> Do you think this would work? I'm a bit unsure about ignoring the tags
> on the relation; ideally these should override tags on the outer way,
> if specified (or no?). But since nobody supports that anyway at the
> moment, I thought we can leave that for later.

I think it depends on how you view the relation.

1. The area is the relation, inner and outer ways are just borders.
2. The area is the outer way, which has holes as described by the  
relation.

I tend towards the second, which implies tags on the outer way. It  
has the advantage of generalizing normal areas directly. If tags were  
to go on the relation, adding a hole to an area would require moving  
the tags from the way to the relation.

Cheers
Robert





More information about the dev mailing list