
generalized_tables:

  # etldoc: imposm3 -> osm_landcover_polygon_gen7
  landcover_polygon_gen7:
    source: landcover_polygon_gen6
    sql_filter: area>power(ZRES5,2)
    tolerance: ZRES7

  # etldoc: imposm3 -> osm_landcover_polygon_gen6
  landcover_polygon_gen6:
    source: landcover_polygon_gen5
    sql_filter: area>power(ZRES6,2)
    tolerance: ZRES8

  # etldoc: imposm3 -> osm_landcover_polygon_gen5
  landcover_polygon_gen5:
    source: landcover_polygon_gen4
    sql_filter: area>power(ZRES7,2)
    tolerance: ZRES9

  # etldoc: imposm3 -> osm_landcover_polygon_gen4
  landcover_polygon_gen4:
    source: landcover_polygon_gen3
    sql_filter: area>power(ZRES8,2)
    tolerance: ZRES10

  # etldoc: imposm3 -> osm_landcover_polygon_gen3
  landcover_polygon_gen3:
    source: landcover_polygon_gen2
    sql_filter: area>power(ZRES8,2)
    tolerance: ZRES11

  # etldoc: imposm3 -> osm_landcover_polygon_gen2
  landcover_polygon_gen2:
    source: landcover_polygon_gen1
    sql_filter: area>power(ZRES9,2)
    tolerance: ZRES12

  # etldoc: imposm3 -> osm_landcover_polygon_gen1
  landcover_polygon_gen1:
    source: landcover_polygon
    sql_filter: area>power(ZRES10,2) AND ST_IsValid(geometry)
    tolerance: ZRES13

tables:
  # etldoc: imposm3 -> osm_landcover_polygon
  landcover_polygon:
    fields:
    - name: osm_id
      type: id
    - name: geometry
      type: validated_geometry
    - name: area
      type: area
    - name: subclass
      type: mapping_value
    - name: mapping_key
      type: mapping_key
    mapping:
      landuse:
      - allotments
      - farm
      - farmland
      - orchard
      - plant_nursery
      - vineyard
      - grass
      - grassland
      - meadow
      - forest
      - village_green
      - recreation_ground
      # There are 600 parks tagged with landuse=park instead of leisure=park
      - park
      natural:
      - wood
      - wetland
      - fell
      - grassland
      - heath
      - scrub
      - tundra
      - glacier
      - bare_rock
      - scree
      - beach
      - sand
      - dune
      leisure:
      - park
      - garden
      - golf_course
      wetland:
      - bog
      - swamp
      - wet_meadow
      - marsh
      - reedbed
      - saltern
      - tidalflat
      - saltmarsh
      - mangrove
    type: polygon
