[OSM-dev] Coastlines and water - contact and technical

Jon Burgess jburgess777 at googlemail.com
Sun Jul 19 21:23:54 BST 2009


On Sun, 2009-07-19 at 16:04 -0400, Ben Supnik wrote:
> Hi Jon,
> 
> I started to summarize this on the wiki and realized something...
> 
> > documented. The algorithm osm2pgsql uses is to gather together all the
> > tags which are related to the polygon feature (e.g. landuse=, natural=
> > etc) and then compare those against the outer ways. If the way and
> > polygon match then it will exclude the way. If they do not match then
> > the way will be included.
> 
> What is the precise definition of "match"?

As I think I said - it is not documented anywhere, it is 'undefined
behaviour'. I described the algorithm osm2pgsql uses but osmarender,
Merkator etc may do something entirely different. For the precise
implementation details you will have to examine the source.

The expected behaviour for these sorts of things tends to evolve more by
consensus and common practices of existing data than by detailed
specification. I think someone put it best by saying that the definitive
reference for the OSM tags and API is the existing data and
implementation, not the documentation on the Wiki.

> > As above, the way needs to be exluded if it is untagged or is the same
> > as the polygon. If it is different then it does need to be rendered.
> 
> The implication of this is: a way might be "its own area" with regarding 
> to one set of tags and "part of a multipolygon" with another.

Correct

> If I tag an outer boundary as "park" and it forms the outer boundary of 
> a forest multipolygon that has holes, the park covers the area of the 
> forest, plus the hole.

Correct. Though I doubt many mappers would actually grasp this
distinction when tagging the ways.

> I think I need to understand the tag-matching rules to figure out the 
> right thing to do.
> 
> cheers
> Ben
> 





More information about the dev mailing list