aboutsummaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
authorevansiroky <evan.siroky@yahoo.com>2016-06-17 08:37:51 -0700
committerevansiroky <evan.siroky@yahoo.com>2016-06-17 08:37:51 -0700
commit5d008130cf67d2c5ef831b4d59fca2ef563aed28 (patch)
tree9daa78125230d39f7ed23e5f6b23cfb855d9cc66 /index.js
parent35f6434011b38b3ba60cfbcabf2d64e5b3e557d3 (diff)
downloadtimezone-boundary-builder-5d008130cf67d2c5ef831b4d59fca2ef563aed28.tar.gz
Add ability to download cities from overpass
Diffstat (limited to 'index.js')
-rw-r--r--index.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/index.js b/index.js
index 7c848ef..1a5a5d5 100644
--- a/index.js
+++ b/index.js
@@ -89,6 +89,13 @@ var downloadOsmBoundary = function(boundaryId, boundaryCallback) {
'out body;>;out meta qt;'
boundaryFilename += '_' + cfg.code
debug += 'country: ' + cfg.code
+ } else if(cfg.type === 'city') {
+ query += '(relation["boundary"="administrative"]' +
+ '["admin_level"="8"]' +
+ '["name"="' + cfg.name + '"]);' +
+ 'out body;>;out meta qt;'
+ boundaryFilename += '_' + cfg.name
+ debug += 'city: ' + cfg.name
}
boundaryFilename += '.json'
@@ -96,7 +103,7 @@ var downloadOsmBoundary = function(boundaryId, boundaryCallback) {
console.log(debug)
async.auto({
- downloadFromOverpass: function(results, cb) {
+ downloadFromOverpass: function(cb) {
console.log('downloading from overpass')
fetchIfNeeded(boundaryFilename, boundaryCallback, function() {
overpass(query, cb, { flatProperties: true })