From 2be0a8015327fe4d76aef6217cbaa7fd9f656cf5 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 8 Sep 2014 12:36:01 +0100 Subject: Add centers to sites --- create-data.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'create-data.js') diff --git a/create-data.js b/create-data.js index d0e8202..60947d2 100755 --- a/create-data.js +++ b/create-data.js @@ -216,7 +216,9 @@ function createCollections(callback) { parking: 'select ST_AsGeoJSON(ST_Transform(way, 4326), 10) as polygon,\ name,access,capacity,"capacity:disabled",fee from uni_parking', bicycleParking: 'select ST_AsGeoJSON(ST_Transform(way, 4326), 10) as polygon,capacity,bicycle_parking,covered from uni_bicycle_parking', - sites: 'select ST_AsGeoJSON(ST_Transform(way, 4326), 10) as polygon,name,loc_ref,uri from uni_site', + sites: 'select ST_AsGeoJSON(ST_Transform(way, 4326), 10) as polygon,\ + ST_AsText(ST_Transform(ST_Centroid(way), 4326)) as center,\ + name,loc_ref,uri from uni_site', pointsOfService: "select ST_AsGeoJSON(ST_Transform(way, 4326), 10) as polygon,ST_AsText(ST_Transform(ST_Centroid(way), 4326)) as center,name,shop,amenity,uri from planet_osm_polygon where (amenity in ('cafe', 'bar', 'restaurant') or shop in ('kiosk', 'convenience')) and ST_Contains((select ST_Union(way) from uni_site), way);" }; -- cgit v1.2.3