summaryrefslogtreecommitdiff
path: root/create-data.js
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-04-04 22:40:15 +0100
committerChristopher Baines <cb15g11@soton.ac.uk>2014-04-04 22:40:15 +0100
commit860ca767c8ba0d5d33befc233f1a8047b36eef37 (patch)
tree759b84570822ac206e2aa9bc1b65af560cf0b131 /create-data.js
parent18c5740c3aa4d4f89c8cb5fef1111016b130ad37 (diff)
downloadleaflet-soton-860ca767c8ba0d5d33befc233f1a8047b36eef37.tar
leaflet-soton-860ca767c8ba0d5d33befc233f1a8047b36eef37.tar.gz
Better display of vertical passageways
Diffstat (limited to 'create-data.js')
-rwxr-xr-xcreate-data.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/create-data.js b/create-data.js
index 0d2fcb1..149a5b4 100755
--- a/create-data.js
+++ b/create-data.js
@@ -325,12 +325,16 @@ function createRooms(buildings, workstations, callback) {
callback();
});
}, function(err) {
+ // Assign levels to parts
+
for (var i=0; i<buildingParts.length; i++) {
var part = buildingParts[i];
if (part.id in osmIDToLevels) {
part.properties.level = osmIDToLevels[part.id];
+ part.properties.level.sort(function(a,b){return a-b});
+
if (part.properties.level.length === 1) {
part.properties.level = part.properties.level[0];
}
@@ -466,7 +470,7 @@ function getBuildingPartMemberRefs(levelRelation, callback) {
}
function getBuildingParts(callback) {
- var query = "select ST_AsGeoJSON(ST_Transform(way, 4326), 10) as polygon,ST_AsText(ST_Transform(ST_Centroid(way), 4326)) as center,osm_id,name,buildingpart,ref,uri,amenity,unisex,male,female from planet_osm_polygon where buildingpart is not null";
+ var query = "select ST_AsGeoJSON(ST_Transform(way, 4326), 10) as polygon,ST_AsText(ST_Transform(ST_Centroid(way), 4326)) as center,osm_id,name,buildingpart,\"buildingpart:verticalpassage\",ref,uri,amenity,unisex,male,female from planet_osm_polygon where buildingpart is not null";
pg.query(query, function(err, results) {
if (err) {