From b516f748d86d4bd2685a5543fa811806e06610ec Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Tue, 8 Jun 2021 22:13:02 +1000 Subject: fix compareSuburbs now addr:suburb not included by default --- .gitlab-ci.yml | 2 +- Makefile | 5 +++++ bin/vicmap2osm.js | 7 ++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2a9c2fb..d159d7f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -237,7 +237,7 @@ build compareSuburb: - touch data/VICMAP_ADDRESS.zip - touch data/vicmap/ll_gda94/sde_shape/whole/VIC/VMADD/layer/address.shp - touch --no-create data/vicmap.geojson - - time make dist/vicmap-osm.geojson + - time make dist/vicmap-osm-with-suburb.geojson - time make dist/vicmapSuburbDiffersWithOSM.geojson - rm -f dist/vicmap-osm.geojson - make printDifferentSuburbs diff --git a/Makefile b/Makefile index 71d1b2d..9b8a437 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,11 @@ dist/vicmap-osm.geojson: data/vicmap.geojson ./bin/vicmap2osm.js $< $@ wc -l $@ +dist/vicmap-osm-with-suburb.geojson: data/vicmap.geojson + mkdir -p dist + ./bin/vicmap2osm.js --preserve-derivable-propreties $< $@ + wc -l $@ + dist/vicmap-osm.mbtiles: dist/vicmap-osm.geojson tippecanoe --force -o $@ --minimum-zoom=12 --maximum-zoom=12 --no-feature-limit --no-tile-size-limit --no-tile-stats --read-parallel $< diff --git a/bin/vicmap2osm.js b/bin/vicmap2osm.js index dfd1eeb..597043e 100755 --- a/bin/vicmap2osm.js +++ b/bin/vicmap2osm.js @@ -20,6 +20,11 @@ const argv = require('yargs/yargs')(process.argv.slice(2)) type: 'boolean', description: 'Includes _pfi tags to aid debugging' }) + .option('preserve-derivable-properties', { + type: 'boolean', + default: false, + description: 'If set, preserves addr:suburb, addr:postcode, addr:state, otherwise omits them' + }) .argv if (argv._.length < 2) { @@ -52,7 +57,7 @@ const transform = new Transform({ const osm = toOSM(feature, { tracing: argv.tracing, /* omit addr:suburb, addr:postcode, addr:state */ - includeDerivableProperties: false + includeDerivableProperties: argv.preserveDerivableProperties }) // some addresses we skip importing into OSM, see README.md#omitted-addresses -- cgit v1.2.3