aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Harvey <andrew@alantgeo.com.au>2022-05-21 14:51:59 +1000
committerAndrew Harvey <andrew@alantgeo.com.au>2022-05-21 14:51:59 +1000
commit76bd33f95e5a47afe6966744a2a28eb624c06913 (patch)
tree512a33fd56a62c76b8a64eace5ed060b55d19cad
parentc668a54f9dff33a4784a757cfc531d7e3c848e4b (diff)
suburb/locality was moved to admin_level=9 in OSM
-rw-r--r--Makefile24
-rw-r--r--README.md16
-rwxr-xr-xbin/compareSuburb.js6
3 files changed, 23 insertions, 23 deletions
diff --git a/Makefile b/Makefile
index 5a26abc..346210b 100644
--- a/Makefile
+++ b/Makefile
@@ -161,12 +161,12 @@ data/blocks.fgb: data/victoria-roads.fgb
qgis_process run native:polygonize -- INPUT=$< KEEP_FIELDS=FALSE OUTPUT=$@
# blocks from roads mostly works well, except for the coastal area where we end up with one large thin polygon along the coastline
-# we split this one up by suburb/locality boundaries (admin_level=10) to make it smaller and more manageable
+# we split this one up by suburb/locality boundaries (admin_level=9) to make it smaller and more manageable
data/coastalStrip.fgb: data/blocks.fgb
qgis_process run native:extractbylocation -- INPUT='$<|layername=blocks' INTERSECT=src/pointInPortPhillipBay.geojson OUTPUT=$@ PREDICATE=0
-data/coastalStripBySuburb.fgb: data/coastalStrip.fgb data/victoria-admin-level10.osm.fgb
- qgis_process run native:intersection -- INPUT='$<|layername=coastalStrip' OVERLAY='data/victoria-admin-level10.osm.fgb|layername=victoria-admin-level10.osm' OUTPUT=$@
+data/coastalStripBySuburb.fgb: data/coastalStrip.fgb data/victoria-admin-level9.osm.fgb
+ qgis_process run native:intersection -- INPUT='$<|layername=coastalStrip' OVERLAY='data/victoria-admin-level9.osm.fgb|layername=victoria-admin-level9.osm' OUTPUT=$@
# replace large coastal strip in blocks with costalStripBySuburb
data/blocksExcludingCoastalStrip.fgb: data/blocks.fgb
@@ -176,7 +176,7 @@ data/blocksWithCoastalStripSplit.fgb: data/blocksExcludingCoastalStrip.fgb data/
qgis_process run native:mergevectorlayers -- LAYERS='data/blocksExcludingCoastalStrip.fgb|layername=blocksExcludingCoastalStrip' LAYERS='data/coastalStripBySuburb.fgb|layername=coastalStripBySuburb' OUTPUT=$@
data/osmSuburbLines.fgb:
- qgis_process run native:polygonstolines -- INPUT=data/victoria-admin-level10.osm.geojson OUTPUT=$@
+ qgis_process run native:polygonstolines -- INPUT=data/victoria-admin-level9.osm.geojson OUTPUT=$@
data/suburbLinesInCoastalStrip.fgb: data/osmSuburbLines.fgb
qgis_process run native:extractbylocation -- INPUT='$<|layername=osmSuburbLines' INTERSECT='data/coastalStrip.fgb|layername=coastalStrip' OUTPUT=$@ PREDICATE=0
@@ -225,20 +225,20 @@ dist/vicmap-building-conflation: dist/vicmap-building.geojson
mkdirp -p $@
./bin/building.js $< data/victoria-named-features.osm.geojson $@
-# extract admin_level=10 from OSM
+# extract admin_level=9 from OSM
data/victoria-admin.osm.pbf: data/victoria.osm.pbf
osmium tags-filter --remove-tags --overwrite --output=$@ $< r/boundary=administrative
-data/victoria-admin-level10.osm.pbf: data/victoria-admin.osm.pbf
- osmium tags-filter --remove-tags --overwrite --output=$@ $< r/admin_level=10
+data/victoria-admin-level9.osm.pbf: data/victoria-admin.osm.pbf
+ osmium tags-filter --remove-tags --overwrite --output=$@ $< r/admin_level=9
-data/victoria-admin-level10.osm.geojson: data/victoria-admin-level10.osm.pbf
- osmium export --overwrite --config=config/osmium-export-config-adminlevel10.json --geometry-types=polygon --add-unique-id=type_id --output-format=geojsonseq --format-option=print_record_separator=false --output $@ $<
+data/victoria-admin-level9.osm.geojson: data/victoria-admin-level9.osm.pbf
+ osmium export --overwrite --config=config/osmium-export-config-adminlevel9.json --geometry-types=polygon --add-unique-id=type_id --output-format=geojsonseq --format-option=print_record_separator=false --output $@ $<
-data/victoria-admin-level10.osm.fgb: data/victoria-admin-level10.osm.geojson
+data/victoria-admin-level9.osm.fgb: data/victoria-admin-level9.osm.geojson
ogr2ogr -f FlatGeobuf $@ $<
-dist/vicmapSuburbDiffersWithOSM.geojson: dist/vicmap-osm-with-suburb.geojson data/victoria-admin-level10.osm.geojson
+dist/vicmapSuburbDiffersWithOSM.geojson: dist/vicmap-osm-with-suburb.geojson data/victoria-admin-level9.osm.geojson
rm -f dist/postalCodeURLs.txt
./bin/compareSuburb.js $^ $@ dist/suburbsWithPostcodeCounts.geojson dist/postalCodeInstructions.json dist/postalCodeURLs.txt
wc -l $@
@@ -247,7 +247,7 @@ printDifferentSuburbs: dist/vicmapSuburbDiffersWithOSM.geojson
echo "OSM Suburb,Vicmap Suburb"
ogr2ogr -f CSV -select '_osmSuburb,addr:suburb' /vsistdout/ $< | tail -n+2 | sort | uniq
-dist/candidates: data/victoria-admin-level10.osm.geojson dist/conflate
+dist/candidates: data/victoria-admin-level9.osm.geojson dist/conflate
mkdir -p $@
./bin/candidates.js $^ $@
diff --git a/README.md b/README.md
index 90f4605..525f5c9 100644
--- a/README.md
+++ b/README.md
@@ -110,13 +110,13 @@ These are converted into simply "Hillside", the full list of special cases is in
### Inclusion of `addr:suburb`, `addr:postcode` and `addr:state`
Some within the OSM community advocate including full address attributes `addr:suburb`, `addr:postcode`, `addr:state` on all address objects even when they can be derived from a `boundary` object already mapped. Others advocate excluding these attributes from each address object where they can be derived from the `boundary` object.
-I undertook analysis (see [`bin/compareSuburb.js`](bin/compareSuburb.js) and the _build compareSuburb_ stage) to see how consistent Vicmap `addr:suburb` was with OSM `admin_level=10` boundaries and `addr:postcode` with a potential `postal_code` tag on each OSM level 10 boundary.
+I undertook analysis (see [`bin/compareSuburb.js`](bin/compareSuburb.js) and the _build compareSuburb_ stage) to see how consistent Vicmap `addr:suburb` was with OSM `admin_level=9` boundaries and `addr:postcode` with a potential `postal_code` tag on each OSM level 9 boundary.
After excluding some special cases, there were 62 Vicmap addresses with a reported suburb/locality different to what would be derived from the OSM admin boundary. It looks like a bunch are bad Vicmap data, most of the rest are address points practically on the admin boundary line, there's only a [small handful otherwise to deal with](https://gitlab.com/alantgeo/vicmap2osm/-/jobs/1279647817/artifacts/raw/dist/vicmapSuburbDiffersWithOSM.geojson).
-This analysis supports it is mostly fine from a data consistency point of view to rely on the `admin_level=10` suburb, except for a handful of cases (and even then it's not clear between Vicmap or OSM which is correct).
+This analysis supports it is mostly fine from a data consistency point of view to rely on the `admin_level=9` suburb, except for a handful of cases (and even then it's not clear between Vicmap or OSM which is correct).
-For postcodes, of the 2988 `admin_level=10` suburb/localities in OSM:
+For postcodes, of the 2988 `admin_level=9` suburb/localities in OSM:
- 2912 have only one distinct postcode from Vicmap data,
- 9 have >1 postcode from Vicmap
@@ -124,11 +124,11 @@ For postcodes, of the 2988 `admin_level=10` suburb/localities in OSM:
Of the 9 that have >1 postcode, 7 have only 1 address with a different postcode, 1 has only 3 addresses with a different postcode, and one suburb/locality (Melbourne suburb) has two main postcodes 3000 with 51,458 addresses and postcode 3004 with 12,158 postcodes. In the Melbourne suburb, it's clear that the Melbourne CBD is 3000 and areas south of the Yarra River are 3004 (see img/postcodes_melbourne.png). A separate `boundary=postal_code` already exists for [3000](https://www.openstreetmap.org/relation/8383583) and [3004](https://www.openstreetmap.org/relation/3402721).
-My analysis supports adding `postal_code` to the level 10 admin boundary is safe for pretty much the whole state, except for Melbourne where `postal_code` boundaries [have already been mapped](https://overpass-turbo.eu/s/18eS) (`boundary=postal_code in "VIC, AU"`).
+My analysis supports adding `postal_code` to the level 9 admin boundary is safe for pretty much the whole state, except for Melbourne where `postal_code` boundaries [have already been mapped](https://overpass-turbo.eu/s/18eS) (`boundary=postal_code in "VIC, AU"`).
-At the time of writing 360 `admin_level=10` boundaries have a `postal_code` tag [see map](https://overpass-turbo.eu/s/18eU) (`(type=boundary and boundary=administrative and admin_level=10 and postal_code=*) in "VIC, AU"`), 2613 `admin_level=10` boundaries don't have a `postal_code` tag [see map](https://overpass-turbo.eu/s/18eV) (`(type=boundary and boundary=administrative and admin_level=10 and postal_code is null) in "VIC, AU"`).
+At the time of writing 360 `admin_level=9` boundaries have a `postal_code` tag [see map](https://overpass-turbo.eu/s/18eU) (`(type=boundary and boundary=administrative and admin_level=9 and postal_code=*) in "VIC, AU"`), 2613 `admin_level=9` boundaries don't have a `postal_code` tag [see map](https://overpass-turbo.eu/s/18eV) (`(type=boundary and boundary=administrative and admin_level=9 and postal_code is null) in "VIC, AU"`).
-As part of this import, `postal_code` will be added to `admin_level=10` boundaries derived from Vicmap, see [Stage 1 - postal_code](#stage-1-postal_code).
+As part of this import, `postal_code` will be added to `admin_level=9` boundaries derived from Vicmap, see [Stage 1 - postal_code](#stage-1-postal_code).
After lengthy engagement with the local community, we opt to omit `addr:suburb`, `addr:postcode`, `addr:state` tags in the current import.
@@ -309,7 +309,7 @@ These outputs are described in the [Building Name](#building-name) and [Complex
make dist/candidates
-This will split the conflation results into the following import candidate categories, then again split into suburb/locality (`admin_level=10`).
+This will split the conflation results into the following import candidate categories, then again split into suburb/locality (`admin_level=9`).
### Candidate Categories
1. `newAddressesWithoutConflicts` - new addresses from Vicmap where it's unlikely to conflict with existing OSM addresses, can be imported automatically.
@@ -329,7 +329,7 @@ The dedicated import account used for the import is [`vicmap_import`](https://ww
### Stage 1 - postal_code
For background see [Inclusion of `addr:suburb`, `addr:postcode` and `addr:state`](#inclusion-of-addrsuburb-addrpostcode-and-addrstate).
-Using JOSM RemoteControl commands [`postal_code`](https://wiki.openstreetmap.org/wiki/Key:postal_code) will be added to the existing Victorian `admin_level=10` boundaries using the postcode derived from Vicmap Addresses. Except for Melbourne suburb because there are two postal codes in use, and the `postal_code` boundaries are already mapped.
+Using JOSM RemoteControl commands [`postal_code`](https://wiki.openstreetmap.org/wiki/Key:postal_code) will be added to the existing Victorian `admin_level=9` boundaries using the postcode derived from Vicmap Addresses. Except for Melbourne suburb because there are two postal codes in use, and the `postal_code` boundaries are already mapped.
The tag changes are created by [`bin/compareSuburb.js`](bin/compareSuburb.js) which creates the JOSM RemoteControl URLs into the file at `dist/postalCodeURLs.txt`, [https://gitlab.com/alantgeo/vicmap2osm/-/snippets/2133851](https://gitlab.com/alantgeo/vicmap2osm/-/snippets/2133851).
diff --git a/bin/compareSuburb.js b/bin/compareSuburb.js
index 27c6553..db99100 100755
--- a/bin/compareSuburb.js
+++ b/bin/compareSuburb.js
@@ -3,7 +3,7 @@
/**
* Compare the addr:suburb reported from Vicmap with the corresponding suburb/locality boundary existing in OSM
* to report any Vicmap addresses where addr:suburb conflicts with OSM's boundaries
- *
+ *
* For each OSM suburb/locality, report the distribution of Vicmap addr:postcode's falling with the boundary.
*/
@@ -20,7 +20,7 @@ const argv = require('yargs/yargs')(process.argv.slice(2))
.argv
if (argv._.length < 6) {
- console.error("Usage: ./compareSuburb.js vicmap-osm.geojson osm_admin_level_10.geojson dist/vicmapSuburbDiffersWithOSM.geojson dist/suburbsWithPostcodeCounts.geojson dist/postalCodeInstructions.json dist/postalCodeURLs.txt")
+ console.error("Usage: ./compareSuburb.js vicmap-osm.geojson osm_admin_level_9.geojson dist/vicmapSuburbDiffersWithOSM.geojson dist/suburbsWithPostcodeCounts.geojson dist/postalCodeInstructions.json dist/postalCodeURLs.txt")
process.exit(1)
}
@@ -93,7 +93,7 @@ const compare = new Transform({
if (osmFeature) {
// address within an OSM suburb
if (feature.properties['addr:suburb'] !== osmFeature.properties['name']) {
- // Vicmap suburb different to OSM admin_level=10
+ // Vicmap suburb different to OSM admin_level=9
// console.log('Suburb differs', feature.properties['addr:suburb'], osmFeature.properties['name'])
feature.properties._osmSuburb = osmFeature.properties['name']
this.push(feature)