shortbread-docs icon indicating copy to clipboard operation
shortbread-docs copied to clipboard

What happens with conflicting attributes?

Open pnorman opened this issue 1 year ago • 1 comments

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 avatar Feb 16 '24 09:02 pnorman