[OSM-dev] Coastlines and water - my proposal

Andreas Kalsch andreaskalsch at gmx.de
Tue Jul 21 12:13:16 BST 2009


Hi,

I copy and paste a concept how I correct the tags of outer ways and 
relations with a script:

"correction of relation members und relations, if relation members are 
tagged instead of relation:

for all relations with type = multipolygon and no boundary = ..:
    for all members with role = outer from sequence_id = 1 .. n:
        accumulate member tags and add them to the relation
        remove the tags from member
    for all members with role = inner from sequence_id = 1 .. n:
        remove just member tags, which are now part of the relation"

After some /browsing/relation/... I found out that the misleading 
tagging (which is still necessary for the renderer?) is usually a 
practice for many multipolygons which are not boundaries. Best example 
were buildings:

- The outer way(s) are tagged with building=yes
- Even the inner way(s) are tagged with building=yes
- The relation remains untagged

Semantically, none of the ways should be tagged but just the relation 
itself. Of course, an inner way can be tagged, if it is another feature 
(like a lake inside a forest).
Imagine a parser which extracts all buildings. It has to find out which 
ways are part of a relation (and so not a building itself) and which 
ones are really buildings. Much overhead. Semantically, tagging the 
relation is the only correct way - from 0.5 on.

Andi


Jon Burgess schrieb:
> On Sun, 2009-07-19 at 16:10 -0400, Ben Supnik wrote:
>   
>> Hi Jon,
>>
>> Jon Burgess wrote:
>>     
>>> This is how the data appeared when the existing polygons with holes were
>>> run through the 0.4->0.5 conversion process. In 0.4 they consisted of a
>>> single tagged way with disjoint segments. In the conversion, the
>>> disjoint segments turned into multiple tagged ways and a relation was
>>> created with them all as members. The conversion process was not
>>> intelligent enough to assign them roles.
>>>       
>> Does that create rendering errors?  
>>     
>
> It probably does in some renderings.
>
>   
>> (E.g. holes not being rendered as 
>> holes?)  Or are clients somehow figuring out that the holes are holes 
>> via a heuristic?
>>     
>
> You would need to examine each of the clients to understand whether they
> cope with this or not.
>
>   
>> Sorry to beat this to death here...it looks like clients have to handle 
>> a number of special cases for legacy data...I want to make sure I get 
>> them all so that my shapefile output isn't grossly different from what 
>> users see on the map.
>>     
>
> Well, this specific case of having tags on the inner ways is probably
> disappearing. I believe someone wrote an automated tool to 'correct'
> this data some time ago. Even so, you sometimes need to know the history
> to understand why some of the things are the way they are.
>
> One obvious comparison you could do would be to compare the shapefiles
> to those generated by osm2shp or osm2pgsql+pgsql2shp.
>
> 	Jon
>
>   
>> cheers
>> bne
>>
>>
>>     
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev
>
>
>   





More information about the dev mailing list