Skip to content

Instantly share code, notes, and snippets.

@pnorman
Created September 30, 2013 08:59
Show Gist options
  • Save pnorman/6761110 to your computer and use it in GitHub Desktop.
Save pnorman/6761110 to your computer and use it in GitHub Desktop.
SQL statements from openstreetmap-carto
(select way, religion,
coalesce (aeroway, amenity, landuse, leisure, military, "natural", power, tourism, highway) as feature from (
select way,
('aeroway_' || (case when aeroway in ('apron', 'aerodrome') then aeroway else null end)) as aeroway,
('amenity_' || (case when amenity in ('parking', 'university', 'college', 'school', 'hospital', 'kindergarten', 'grave_yard') then amenity else null end)) as amenity,
('landuse_' || (case when landuse in ('quarry', 'vineyard', 'orchard', 'cemetery', 'grave_yard', 'residential', 'garages', 'field', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'recreation_ground', 'conservation', 'village_green', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'greenfield', 'construction') then landuse else null end)) as landuse,
('leisure_' || (case when leisure in ('swimming_pool', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'golf_course') then leisure else null end)) as leisure,
('military_' || (case when military in ('barracks', 'danger_area') then military else null end)) as military,
('natural_' || (case when "natural" in ('field','beach','desert','heath','mud','grassland','wood','sand','scrub') then "natural" else null end)) as "natural",
('power_' || (case when power in ('station','sub_station','generator') then power else null end)) as power,
('tourism_' || (case when tourism in ('attraction', 'camp_site', 'caravan_site', 'picnic_site', 'zoo') then tourism else null end)) as tourism,
('highway_' || (case when highway in ('services', 'rest_area') then highway else null end)) as highway,
case when religion in ('christian','jewish') then religion else 'INT-generic'::text end as religion
from planet_osm_polygon
where landuse is not null
or leisure is not null
or aeroway in ('apron','aerodrome')
or amenity in ('parking','university','college','school','hospital','kindergarten','grave_yard')
or military in ('barracks','danger_area')
or "natural" in ('field','beach','desert','heath','mud','grassland','wood','sand','scrub')
or power in ('station','sub_station','generator')
or tourism in ('attraction','camp_site','caravan_site','picnic_site','zoo')
or highway in ('services','rest_area')
order by z_order,way_area desc
) as landcover
) as features
select way
from planet_osm_line
where man_made='cutline'
) as leisure
(select way,leisure,
case when leisure='pitch' then 2
when leisure='track' then 1
else 0 end as prio
from planet_osm_polygon
where leisure in ('sports_centre','stadium','pitch','track')
order by z_order,prio,way_area desc
) as sports_grounds
(select way,waterway
from planet_osm_line
where waterway in ('stream','drain','ditch')
and (tunnel is null or tunnel != 'yes')
) as water_lines
(select way,"natural",waterway,landuse,name
from planet_osm_polygon
where (waterway in ('dock','mill_pond','riverbank','canal')
or landuse in ('reservoir','water','basin')
or "natural" in ('lake','water','land','glacier','mud'))
and building is null
order by z_order,way_area desc
) as water_areas
(select way,"natural"
from planet_osm_polygon
where "natural" in ('marsh','wetland') and building is null
order by z_order,way_area desc
) as water_area
(select way,name,way_area
from planet_osm_polygon
where "natural"='glacier' and building is null
order by way_area desc
) as glaciers
(select way,waterway,disused,lock,name,
case when tunnel in ('yes','true','1') then 'yes'::text else tunnel end as tunnel
from planet_osm_line
where waterway in ('weir','river','canal','derelict_canal','stream','drain','ditch','wadi')
and (bridge is null or bridge not in ('yes','true','1','aqueduct'))
order by z_order
) as water_lines
(select way,name from planet_osm_line where waterway='dam') as dam
(select way from planet_osm_polygon where leisure ='marina') as marinas
(select way,man_made from planet_osm_polygon where man_made in ('pier','breakwater','groyne')) as piers
(select way,man_made from planet_osm_line where man_made in ('pier','breakwater','groyne')) as piers
(select way,waterway from planet_osm_point where waterway='lock_gate') as locks
(select way,highway from planet_osm_line where highway in ('motorway','motorway_link','trunk','trunk_link','primary','primary_link','secondary','secondary_link','tertiary','tertiary_link','residential','unclassified') and tunnel in ('yes','true','1') order by z_order) as roads
(select way,highway,horse,foot,bicycle from planet_osm_line where highway in ('bridleway','footway','cycleway','path') and tunnel in ('yes','true','1') order by z_order) as roads
(select way,tracktype from planet_osm_line where highway='track' and tunnel in ('yes','true','1')) as tracks
(select way from planet_osm_line where "historic"='citywalls') as citywalls
(select way from planet_osm_line where "historic"='castle_walls') as castle_walls
(select way from planet_osm_polygon where "historic"='castle_walls') as castle_walls
(select way,landuse,leisure
from planet_osm_polygon
where (landuse = 'military' or leisure='nature_reserve') and building is null
) as landuse_overlay
(select way, barrier from planet_osm_line where barrier is not null) as roads
(select way,"natural",man_made from planet_osm_line where "natural" = 'cliff' or man_made = 'embankment') as roads
(select way,barrier from planet_osm_polygon where barrier is not null) as barriers
(select way from planet_osm_line where route='ferry' ) as routes
(select distinct on (p.way) p.way as way,l.highway as int_tc_type
from planet_osm_point p
join planet_osm_line l
on ST_DWithin(p.way,l.way,0.1)
join (values
('tertiary',1),
('unclassified',2),
('residential',3),
('living_street',4),
('service',5)
) as v (highway,prio)
on v.highway=l.highway
where p.highway='turning_circle'
order by p.way,v.prio
) as turning_circle
(select way,coalesce(('highway_' || (case when highway in ('residential','unclassified','pedestrian','service','footway','track','path','platform') then highway else null end)), ('railway_' || (case when railway in ('platform') then railway else null end))) as feature from planet_osm_polygon
where highway in ('residential','unclassified','pedestrian','service','footway','track','path','platform')
or railway in ('platform')
order by z_order,way_area desc) as roads
(select way,highway,
case when tunnel in ('yes','true','1') then 'yes'::text else 'no'::text end as tunnel,
case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service
from planet_osm_line
where highway in ('motorway','motorway_link','trunk','trunk_link','primary','primary_link','secondary','secondary_link','tertiary','tertiary_link','residential','unclassified','road','service','pedestrian','raceway','living_street')
order by z_order) as roads
(select way,coalesce(('highway_' || (case when highway in ('residential','unclassified','pedestrian','service','footway','living_street','track','path','platform','services') then highway else null end)), ('railway_' || (case when railway in ('platform') then railway else null end)), (('aeroway_' || case when aeroway in ('runway','taxiway','helipad') then aeroway else null end))) as feature from planet_osm_polygon
where highway in ('residential','unclassified','pedestrian','service','footway','living_street','track','path','platform','services')
or railway in ('platform')
or aeroway in ('runway','taxiway','helipad')
order by z_order,way_area desc) as roads
(select way,building,railway,amenity from planet_osm_polygon
where railway='station'
or building in ('station','supermarket')
or amenity='place_of_worship'
order by z_order,way_area desc) as buildings
(select way,aeroway,
case
when building in ('residential','house','garage','garages','detached','terrace','apartments') then 'INT-light'::text
else building
end as building
from planet_osm_polygon
where (building is not null
and building not in ('no','station','supermarket','planned')
and (railway is null or railway != 'station')
and (amenity is null or amenity != 'place_of_worship'))
or aeroway = 'terminal'
order by z_order,way_area desc) as buildings
(select way,tracktype,
coalesce(('highway_' || (case when highway is not null then highway else null end)), ('railway_' ||(case when railway='preserved' and service in ('spur','siding','yard') then 'INT-preserved-ssy'::text
when railway in ('spur','siding')
or (railway='rail' and service in ('spur','siding','yard'))
then 'spur-siding-yard'
when railway in ('light_rail','narrow_gauge','funicular','rail','subway','tram','spur','siding','monorail','platform','preserved','disused','abandoned','construction','miniature','turntable')
then railway else null end)), ('aeroway_' || (case when aeroway in ('runway', 'taxiway') then aeroway else null end))) as feature,
horse,bicycle,foot,construction,
case when tunnel in ('yes','true','1') then 'yes'::text else 'no'::text end as tunnel,
case when bridge in ('yes','true','1','viaduct') then 'yes'::text else 'no'::text end as bridge,
case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service
from planet_osm_line
where highway is not null
or aeroway in ('runway','taxiway')
or railway in ('light_rail','narrow_gauge','funicular','rail','subway','tram','spur','siding','monorail','platform','preserved','disused','abandoned','construction','miniature','turntable')
order by z_order) as roads
(select distinct on (p.way) p.way as way,l.highway as int_tc_type
from planet_osm_point p
join planet_osm_line l
on ST_DWithin(p.way,l.way,0.1)
join (values
('tertiary',1),
('unclassified',2),
('residential',3),
('living_street',4),
('service',5)
) as v (highway,prio)
on v.highway=l.highway
where p.highway='turning_circle'
order by p.way,v.prio
) as turning_circle
(select way,access,highway,
case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service
from planet_osm_line
where access is not null and highway is not null
and (bridge is null or bridge not in ('yes','true','1','viaduct'))
) as access
(select way,
case when oneway in ('yes','true','1') then 'yes'::text else oneway end as oneway
from planet_osm_line
where oneway is not null
and (highway is not null or railway is not null or waterway is not null)
and (bridge is null or bridge not in ('yes','true','1','viaduct'))
) as directions
(select way,aerialway from planet_osm_line where aerialway is not null) as aerialways
(select way,coalesce(('highway_' || (case when highway is not null then highway else null end)), ('railway_' || (case when railway in ('rail','tram','light_rail','funicular','narrow_gauge') then railway else null end))) as feature,
case when tunnel in ('yes','true','1') then 'yes'::text else tunnel end as tunnel
from planet_osm_roads
where highway is not null
or (railway is not null and railway!='preserved' and (service is null or service not in ('spur','siding','yard')))
order by z_order
) as roads
(select way,name from planet_osm_line where waterway='canal' and bridge in ('yes','true','1','aqueduct') order by z_order) as water
(select way,coalesce(('highway_' || (case when highway is not null then highway else null end)), ('railway_' || (case when railway in ('spur', 'siding') or (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' when railway in ('light_rail','subway','narrow_gauge','rail','spur','siding','disused','abandoned','construction') then railway else null end)), ('aeroway_' || (case when aeroway in ('runway', 'taxiway') then aeroway else null end))) as feature,horse,bicycle,foot,tracktype from planet_osm_line
where (highway is not null
or aeroway in ('runway','taxiway')
or railway in ('light_rail','subway','narrow_gauge','rail','spur','siding','disused','abandoned','construction'))
and bridge in ('yes','true','1','viaduct')
and (layer is null or layer = '0')
order by z_order
) as roads
(select way,access,highway,
case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service
from planet_osm_line
where access is not null and highway is not null
and bridge in ('yes','true','1','viaduct')
and (layer is null or layer in ('-5','-4','-3','-2','-1','0'))
) as access
(select way,
case when oneway in ('yes','true','1') then 'yes'::text else oneway end as oneway
from planet_osm_line
where oneway is not null
and (highway is not null or railway is not null or waterway is not null)
and bridge in ('yes','true','1','viaduct')
and (layer is null or layer in ('-5','-4','-3','-2','-1','0'))
) as directions
(select way,coalesce(('highway_' || (case when highway is not null then highway else null end)), ('railway_' || (case when railway in ('spur', 'siding') or (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' when railway in ('light_rail','subway','narrow_gauge','rail','spur','siding','disused','abandoned','construction') then railway else null end)), ('aeroway_' || (case when aeroway in ('runway', 'taxiway') then aeroway else null end))) as feature,horse,bicycle,foot,tracktype from planet_osm_line
where (highway is not null
or aeroway in ('runway','taxiway')
or railway in ('light_rail','subway','narrow_gauge','rail','spur','siding','disused','abandoned','construction'))
and bridge in ('yes','true','1','viaduct')
and layer = '1'
order by z_order
) as roads
(select way,access,highway,
case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service
from planet_osm_line
where access is not null and highway is not null
and bridge in ('yes','true','1','viaduct')
and layer = '1'
) as access
(select way,
case when oneway in ('yes','true','1') then 'yes'::text else oneway end as oneway
from planet_osm_line
where oneway is not null
and (highway is not null or railway is not null or waterway is not null)
and bridge in ('yes','true','1','viaduct')
and layer = '1'
) as directions
(select way,coalesce(('highway_' || (case when highway is not null then highway else null end)), ('railway_' || (case when railway in ('spur', 'siding') or (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' when railway in ('light_rail','subway','narrow_gauge','rail','spur','siding','disused','abandoned','construction') then railway else null end)), ('aeroway_' || (case when aeroway in ('runway', 'taxiway') then aeroway else null end))) as feature,horse,bicycle,foot,tracktype from planet_osm_line
where (highway is not null
or aeroway in ('runway','taxiway')
or railway in ('light_rail','subway','narrow_gauge','rail','spur','siding','disused','abandoned','construction'))
and bridge in ('yes','true','1','viaduct')
and layer = '2'
order by z_order
) as roads
(select way,access,highway,
case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service
from planet_osm_line
where access is not null and highway is not null
and bridge in ('yes','true','1','viaduct')
and layer = '2'
) as access
(select way,
case when oneway in ('yes','true','1') then 'yes'::text else oneway end as oneway
from planet_osm_line
where oneway is not null
and (highway is not null or railway is not null or waterway is not null)
and bridge in ('yes','true','1','viaduct')
and layer = '2'
) as directions
(select way,coalesce(('highway_' || (case when highway is not null then highway else null end)), ('railway_' || (case when railway in ('spur', 'siding') or (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' when railway in ('light_rail','subway','narrow_gauge','rail','spur','siding','disused','abandoned','construction') then railway else null end)), ('aeroway_' || (case when aeroway in ('runway', 'taxiway') then aeroway else null end))) as feature,horse,bicycle,foot,tracktype from planet_osm_line
where (highway is not null
or aeroway in ('runway','taxiway')
or railway in ('light_rail','subway','narrow_gauge','rail','spur','siding','disused','abandoned','construction'))
and bridge in ('yes','true','1','viaduct')
and layer = '3'
order by z_order
) as roads
(select way,access,highway,
case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service
from planet_osm_line
where access is not null and highway is not null
and bridge in ('yes','true','1','viaduct')
and layer = '3'
) as access
(select way,
case when oneway in ('yes','true','1') then 'yes'::text else oneway end as oneway
from planet_osm_line
where oneway is not null
and (highway is not null or railway is not null or waterway is not null)
and bridge in ('yes','true','1','viaduct')
and layer = '3'
) as directions
(select way,coalesce(('highway_' || (case when highway is not null then highway else null end)), ('railway_' || (case when railway in ('spur', 'siding') or (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' when railway in ('light_rail','subway','narrow_gauge','rail','spur','siding','disused','abandoned','construction') then railway else null end)), ('aeroway_' || (case when aeroway in ('runway', 'taxiway') then aeroway else null end))) as feature,horse,bicycle,foot,tracktype from planet_osm_line
where (highway is not null
or aeroway in ('runway','taxiway')
or railway in ('light_rail','subway','narrow_gauge','rail','spur','siding','disused','abandoned','construction'))
and bridge in ('yes','true','1','viaduct')
and layer = '4'
order by z_order
) as roads
(select way,access,highway,
case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service
from planet_osm_line
where access is not null and highway is not null
and bridge in ('yes','true','1','viaduct')
and layer = '4'
) as access
(select way,
case when oneway in ('yes','true','1') then 'yes'::text else oneway end as oneway
from planet_osm_line
where oneway is not null
and (highway is not null or railway is not null or waterway is not null)
and bridge in ('yes','true','1','viaduct')
and layer = '4'
) as directions
(select way,coalesce(('highway_' || (case when highway is not null then highway else null end)), ('railway_' || (case when railway in ('spur', 'siding') or (railway='rail' and service in ('spur','siding','yard')) then 'INT-spur-siding-yard' when railway in ('light_rail','subway','narrow_gauge','rail','spur','siding','disused','abandoned','construction') then railway else null end)), ('aeroway_' || (case when aeroway in ('runway', 'taxiway') then aeroway else null end))) as feature,horse,bicycle,foot,tracktype from planet_osm_line
where (highway is not null
or aeroway in ('runway','taxiway')
or railway in ('light_rail','subway','narrow_gauge','rail','spur','siding','disused','abandoned','construction'))
and bridge in ('yes','true','1','viaduct')
and layer = '5'
order by z_order
) as roads
(select way,access,highway,
case when service in ('parking_aisle','drive-through','driveway') then 'INT-minor'::text else 'INT-normal'::text end as service
from planet_osm_line
where access is not null and highway is not null
and bridge in ('yes','true','1','viaduct')
and layer = '5'
) as access
(select way,
case when oneway in ('yes','true','1') then 'yes'::text else oneway end as oneway
from planet_osm_line
where oneway is not null
and (highway is not null or railway is not null or waterway is not null)
and bridge in ('yes','true','1','viaduct')
and layer = '5'
) as directions
(select way,railway,bridge from planet_osm_line where railway='tram' and (tunnel is null or tunnel not in ('yes','true','1'))) as trams
(select way from planet_osm_line where highway='bus_guideway' and (tunnel is null or tunnel not in ('yes','true','1'))) as guideways
(select way,admin_level
from planet_osm_roads
where "boundary"='administrative'
and admin_level in ('0','1','2','3','4')
) as admin
(select way,admin_level
from planet_osm_roads
where "boundary"='administrative'
and admin_level in ('5','6','7','8')
) as admin
(select way,admin_level
from planet_osm_roads
where "boundary"='administrative'
and (admin_level is null or admin_level not in ('0','1','2','3','4','5','6','7','8'))
) as admin
(select way from planet_osm_line where "power"='minor_line') as power_minorline
(select way from planet_osm_line where "power"='line') as power_line
(select way,place,name,ref
from planet_osm_point
where place in ('country','state')
) as placenames
(select way,place,name,ref
from planet_osm_point
where place in ('city','metropolis','town') and capital='yes'
) as placenames
(select way,place,name
from planet_osm_point
where place in ('city','metropolis','town','large_town','small_town')
and (capital is null or capital != 'yes')
) as placenames
(select way,place,name
from planet_osm_point
where place in ('suburb','village','large_village','hamlet','locality','isolated_dwelling','farm')
) as placenames
(select way,name,railway,aerialway,disused
from planet_osm_point
where railway in ('station','halt','tram_stop','subway_entrance')
or aerialway='station'
) as stations
(select way,name,railway,aerialway,disused
from planet_osm_polygon
where railway in ('station','halt','tram_stop')
or aerialway='station'
) as stations
(select *
from planet_osm_point
where aeroway in ('airport','aerodrome','helipad')
or barrier in ('bollard','gate','lift_gate','block')
or highway in ('mini_roundabout','gate')
or man_made in ('lighthouse','power_wind','windmill','mast')
or (power='generator' and ("generator:source"='wind' or power_source='wind'))
or "natural" in ('peak','volcano','spring','tree','cave_entrance')
or railway='level_crossing'
) as symbols
(select *
from planet_osm_polygon
where aeroway in ('airport','aerodrome','helipad')
or barrier in ('bollard','gate','lift_gate','block')
or highway in ('mini_roundabout','gate')
or man_made in ('lighthouse','power_wind','windmill','mast')
or (power='generator' and ("generator:source"='wind' or power_source='wind'))
or "natural" in ('peak','volcano','spring','tree')
or railway='level_crossing'
) as symbols
(select way,amenity,shop,tourism,highway,man_made,access,religion,waterway,lock,historic,leisure
from planet_osm_point
where amenity is not null
or shop is not null
or tourism in ('alpine_hut','camp_site','caravan_site','guest_house','hostel','hotel','motel','museum','viewpoint','bed_and_breakfast','information','chalet')
or highway in ('bus_stop','traffic_signals','ford')
or man_made in ('mast','water_tower')
or historic in ('memorial','archaeological_site')
or waterway='lock'
or lock='yes'
or leisure in ('playground','slipway')
) as points
(select way,amenity,shop,tourism,highway,man_made,access,religion,waterway,lock,historic,leisure
from planet_osm_polygon
where amenity is not null
or shop is not null
or tourism in ('alpine_hut','camp_site','caravan_site','guest_house','hostel','hotel','motel','museum','viewpoint','bed_and_breakfast','information','chalet')
or highway in ('bus_stop','traffic_signals')
or man_made in ('mast','water_tower')
or historic in ('memorial','archaeological_site')
or leisure='playground'
) as points
(select way from planet_osm_point where power='tower') as power_towers
(select way from planet_osm_point where power='pole') as power_poles
(select way,highway,ref,char_length(ref) as length
from planet_osm_roads
where highway in ('motorway','trunk','primary','secondary')
and ref is not null
and char_length(ref) between 1 and 8
) as roads
(select way,ref,name
from planet_osm_point
where highway='motorway_junction'
) as junctions
(select way,coalesce(highway,aeroway) as highway,ref,char_length(ref) as length,
case when bridge in ('yes','true','1') then 'yes'::text else 'no'::text end as bridge
from planet_osm_line
where (highway is not null or aeroway is not null)
and ref is not null
and char_length(ref) between 1 and 8
) as roads
(select way,highway,name
from planet_osm_line
where waterway IS NULL
and leisure IS NULL
and landuse IS NULL
and name is not null
) as roads
(select way,amenity,shop,access,leisure,landuse,man_made,"natural",place,tourism,ele,name,ref,military,aeroway,waterway,historic,'yes'::text as point
from planet_osm_point
where amenity is not null
or shop in ('supermarket','bakery','clothes','fashion','convenience','doityourself','hairdresser','department_store','butcher','car','car_repair','bicycle','florist')
or leisure is not null
or landuse is not null
or tourism is not null
or "natural" is not null
or man_made in ('lighthouse','windmill')
or place='island'
or military='danger_area'
or aeroway='gate'
or waterway='lock'
or historic in ('memorial','archaeological_site')
) as text
(select way,aeroway,shop,access,amenity,leisure,landuse,man_made,"natural",place,tourism,NULL as ele,name,ref,military,waterway,historic,'no'::text as point
from planet_osm_polygon
where amenity is not null
or shop in ('supermarket','bakery','clothes','fashion','convenience','doityourself','hairdresser','department_store', 'butcher','car','car_repair','bicycle')
or leisure is not null
or landuse is not null
or tourism is not null
or "natural" is not null
or man_made in ('lighthouse','windmill')
or place='island'
or military='danger_area'
or historic in ('memorial','archaeological_site')
) as text
(select way,way_area,name
from planet_osm_polygon
where name is not null
and (waterway is null or waterway != 'riverbank')
and place is null
order by way_area desc
) as text
(select way from planet_osm_line where "addr:interpolation" is not null) as interpolation
(select way,"addr:housenumber" from planet_osm_polygon where "addr:housenumber" is not null and building is not null
union
select way,"addr:housenumber" from planet_osm_point where "addr:housenumber" is not null
) as housenumbers
(select way,"addr:housename" from planet_osm_polygon where "addr:housename" is not null and building is not null
union
select way,"addr:housename" from planet_osm_point where "addr:housename" is not null
) as housenames
(select way,waterway,disused,lock,name,
case when tunnel in ('yes','true','1') then 'yes'::text else tunnel end as tunnel
from planet_osm_line
where waterway in ('weir','river','canal','derelict_canal','stream','drain','ditch','wadi')
order by z_order
) as water_lines
(select way,way_area,name,boundary from planet_osm_polygon where boundary='national_park' and building is null) as boundary
(select way,name,tourism from planet_osm_polygon where tourism='theme_park') as theme_park
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment