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

Jon Burgess jburgess777 at googlemail.com
Sun Jul 19 18:44:46 BST 2009


On Sun, 2009-07-19 at 13:22 -0400, Ben Supnik wrote:
> Hi Jon,
> 
> Jon Burgess wrote:
> 
> >> ... if a user incorrectly tries to make a lake by creating a 
> >> multipolygon and putting the water-related attribute (e.g.
> >> landuse=water 
> >> or natural=lake) on the relation and __not__ at least one outer
> >> polygon
> >>
> >> ... then pgsql will create a polygon without those water tags.
> 
> > No. If the relation is tagged then the tags on the outer ways are
> > ignored. If the user puts all the relevant tags on the relation instead
> > of the outer ways then osm2pgsql is perfectly happy with that and should
> > do the right thing.
> 
> Sorry to ask the same thing about 6 ways...I think my brain be crossed. 
>   Is this a situation where:
> 
> (a) the "spec" allows the tagging of area attributes on the 
> multi-polygon relation and pgsql understand this or...
> 
> (b) the "spec" disallows the tagging of area attributes on multi-polygon 
> relations, but people do it anyway, so pgsql is lenient and grabs the 
> data anyway to try not to lose the features?

I believe (a). The wiki documentation for multipolgons has two slightly
contradictory recommendations:

(near the start)
"Tags describing the multipolygon should go on the outer way."

(in the advanced section)
"It is suggested to apply all tags which describe the area to the
relation, and not to the ways."

osm2pgsql handles this ambiguity by saying hat tags on the relation will
be used if they exist, otherwise it will look at the tags on the outer
ways.

> I realize it is a slightly moot question...since my goal is to reproduce 
> what I see on the map, if pgsql produces sane polygons from meta data on 
> the relation, then that's what users see when they browse the map.  But 
> in the long term I could provide some validation to my user base to 
> limit how much the practice continues.

> > If you have specific relation or way IDs then I can lookup how they have
> > been handled.
> 
> I do not yet...I found one multipolygon water body in an area I am 
> familiar with for the purpose of debugging...but I am processing the 
> entire planet file so...I could pretty easily produce a list of 
> multipolygons where the relation passed the attribute filter that would 
> have been used on the outer ways, but the ways did not.

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.

> For that matter, if a multipolygon relation has multiple outer ways (for 
> exapmle, the outer boundary has for some reason been split) and there 
> are conflicting outer boundary tags, how is that case handle?  (E.g. one 
> is landuse=water and one is landuse=forest.)

I think the current code will just pick one at random. 

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.

	Jon






More information about the dev mailing list