shortbread-tiles / shortbread-docs

Documentation of the Shortbread vector tile schema
https://shortbread-tiles.org
Creative Commons Zero v1.0 Universal
25 stars 7 forks source link

What happens with conflicting attributes? #32

Open pnorman opened 6 months ago

pnorman commented 6 months ago

The water_polygons layer contains a number of features with definitions that can overlap because they're coming from different OSM keys.

As an example, something with landuse=river natural=water would meet the criteria for kind of river and of reservoir.

The osm2pgsql-themepark implementation is

if t.natural == 'glacier' then
    kind = 'glacier'
elseif t.natural == 'water' then
    if t.water == 'river' then
        kind = 'river'
    else
        kind = 'water'
    end
elseif t.waterway == 'riverbank' then
    kind = 'river'
elseif t.waterway == 'dock' or t.waterway == 'canal' then
    kind = t.waterway
elseif t.landuse == 'basin' or t.landuse == 'reservoir' then
    kind = t.landuse
end

This is the logical way to read the spec as it goes down the table and takes the first condition that is met, but it's not ideal since landuse=reservoir natural=water would have a kind of the generic water.

pnorman commented 6 months ago

Another example is the sites layer where there can be objects tagged with matching military and amenity tags. For this one it might make sense to have the object appear multiple times, or it might make sense to define a priority order.