summaryrefslogtreecommitdiff
path: root/create-db.sql
blob: c8068c2b49a09b2dd36b724015139a0d06cfcbab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
drop table uni_site;
create table uni_site as select way,name,loc_ref,uri,amenity,landuse from planet_osm_polygon where operator='University of Southampton' and building is null or osm_id=230335224;

drop table uni_building;
create table uni_building as select way, coalesce("addr:housename", name, '') as name, coalesce(height::int, "building:levels"::int * 10, 10) as height, loc_ref, uri, case when coalesce("addr:housename", name, '')='' or "addr:housename"="addr:housenumber" then true else false end as minor from planet_osm_polygon where (ST_Contains((select ST_Union(way) from uni_site), way) or operator='University of Southampton') and building is not null order by z_order,way_area desc;

drop table uni_parking;
create table uni_parking as select way,name,access,capacity,"capacity:disabled",fee from planet_osm_polygon where amenity='parking' and ST_Contains((select ST_Union(way) from uni_site), way);

drop table uni_bicycle_parking;
create table uni_bicycle_parking as select way,capacity,bicycle_parking,covered from planet_osm_polygon where amenity='bicycle_parking' and ST_Contains((select ST_Union(way) from uni_site), way) union select way,capacity,bicycle_parking,covered from planet_osm_point where amenity='bicycle_parking' and ST_Contains((select ST_Union(way) from uni_site), way);