diff options
author | Christopher Baines <cb15g11@soton.ac.uk> | 2014-08-20 18:25:41 +0100 |
---|---|---|
committer | Christopher Baines <cb15g11@soton.ac.uk> | 2014-08-20 18:25:41 +0100 |
commit | 0fe9d05d8756e4839cc2d1baba1da7a11a736c05 (patch) | |
tree | 80f77457f18454d88eee0b3e8f618997a081e3fe | |
parent | 96744e1ef5e10a7bcf22803df7180cabdc42989f (diff) | |
download | leaflet-soton-0fe9d05d8756e4839cc2d1baba1da7a11a736c05.tar leaflet-soton-0fe9d05d8756e4839cc2d1baba1da7a11a736c05.tar.gz |
Improve SQL for matching University sites and buildings in OSM
Now uses the 'http://id.southampton.ac.uk/site/' prefix to match sites.
-rwxr-xr-x | create-data.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/create-data.js b/create-data.js index 039f58b..a365e2c 100755 --- a/create-data.js +++ b/create-data.js @@ -175,8 +175,8 @@ function createTables(callback) { var tableSelects = { site: "select way,name,loc_ref,uri,amenity,landuse \ from planet_osm_polygon \ - where operator='University of Southampton'", - building: 'select way,coalesce("addr:housename", name, \'\') as name,coalesce(height::int, "building:levels"::int * 10, 10) as height,loc_ref,leisure,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', + where uri like 'http://id.southampton.ac.uk/site/%'", + building: "select way,coalesce(\"addr:housename\", name, \'\') as name,coalesce(height::int, \"building:levels\"::int * 10, 10) as height,loc_ref,leisure,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 uri like 'http://id.southampton.ac.uk/building/%') and building is not null order by z_order,way_area desc", parking: '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)', bicycle_parking: "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)" }; |