From 063c97feb6a9cafc822fab0b53e66ff1cd0c10a3 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 6 Sep 2014 18:22:54 +0100 Subject: Precalculate centers for buildings Currently done because this is the simplist way of doing it. --- create-data.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'create-data.js') diff --git a/create-data.js b/create-data.js index d97092c..d0e8202 100755 --- a/create-data.js +++ b/create-data.js @@ -209,8 +209,9 @@ function createTable(name, query, callback) { function createCollections(callback) { var collectionQueries = { - buildings: 'select ST_AsGeoJSON(ST_Transform(way, 4326), 10) as \ - polygon,name,loc_ref,uri,leisure,height \ + buildings: 'select ST_AsGeoJSON(ST_Transform(way, 4326), 10) as polygon,\ + ST_AsText(ST_Transform(ST_Centroid(way), 4326)) as center,\ + name,loc_ref,uri,leisure,height \ from uni_building where uri is not null', parking: 'select ST_AsGeoJSON(ST_Transform(way, 4326), 10) as polygon,\ name,access,capacity,"capacity:disabled",fee from uni_parking', -- cgit v1.2.3