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

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


On Sun, 2009-07-19 at 14:19 -0400, Ben Supnik wrote:
> Hi Jon,
> 
> Jon Burgess wrote:
> 
> > I believe (a). The wiki documentation for multipolgons has two slightly
> > contradictory recommendations:
> 
> Yeah - I just stumbled upon that...given the discussion it certainly 
> seems like tagging the relation is better than tagging the way...
> 
> - If we have a multipolygon, understanding the way without the relation 
> and sibbling ways is going to be impossible (that is, the results will 
> be spatially incorrect) in all but a very few cases.  So I think clients 
> need to be multipoylgon aware.
> 
> - Better to have the tags on the relation and not have any issues of 
> ambiguity.  Tagging the underlying ways seems like a way to get 
> inconsistent data.

I agree. Some of things were written like this to cope with legacy data
(relations were added in API 0.5).

> > That would be a good thing to do. Sometimes there is more than one way
> > to tag something and this does not necessarily mean that one of them is
> > incorrect.
> 
> I will try to output a list of problems as I process the file.
> 
> > If however the relation was also tagged, perhaps with a boundary tag
> > describing the name of the region then it would ignore the tags on the
> > ways.
> 
> Does pgsql exclude the way as a way-area due to its membership in a 
> multipolygon relation?
> 
> What I mean by this is: I have a closed way with landuse=water, which is 
> a lake in its own right.
> 
> I then put it in a multipolygon relation.
> 
> If I understand correctly, the lake from a single way is an "area" and 
> can be parsed as such...its area would then be re-processed when we 
> handle the multipolygon, which might have different tags.

This is one of the things which has to be done but is not really
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.

> Or do data interpreting clients have to recognize the way in the 
> relation and exclude its interpretation as an area?  This seems like an 
> inconsistent thing to do, particularly since holes can be areas in their 
> own right.

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.

In particular, there is some legacy data which has no tags on the
relation but identical tags on both the outer and inner ways . In this
case, the polygon needs to be rendered with the appropriate tags but
neither the inner nor outer ways are rendered.

If the inner way had different tags, like an island in a lake, then it
would need to be rendered.

	Jon

> cheres
> ben
> 





More information about the dev mailing list