diff options
author | Christopher Baines <cbaines8@gmail.com> | 2013-08-27 11:42:58 +0100 |
---|---|---|
committer | Christopher Baines <cbaines8@gmail.com> | 2013-08-27 11:42:58 +0100 |
commit | 0a5c3ccd31d2e38ce68719a4e8e3ca912737c73c (patch) | |
tree | b54897c288226215810151dc486b6851d00aa19c | |
parent | e80a6d986ea83fa49899a8e70b1d52f80e327ad3 (diff) | |
download | sum-carto-0a5c3ccd31d2e38ce68719a4e8e3ca912737c73c.tar sum-carto-0a5c3ccd31d2e38ce68719a4e8e3ca912737c73c.tar.gz |
Add db
-rw-r--r-- | create-db.sql | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/create-db.sql b/create-db.sql new file mode 100644 index 0000000..0177b34 --- /dev/null +++ b/create-db.sql @@ -0,0 +1,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) 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); + |