diff options
-rw-r--r-- | Makefile | 15 | ||||
-rw-r--r-- | README.md | 16 | ||||
-rwxr-xr-x | bin/building.js | 4 | ||||
-rwxr-xr-x | bin/candidates.js | 8 | ||||
-rwxr-xr-x | bin/conflate.js | 2 |
5 files changed, 31 insertions, 14 deletions
@@ -191,6 +191,14 @@ convertConflationResultsToFGB: ogr2ogr -f FlatGeobuf dist/conflate/noExactMatch.fgb dist/conflate/noExactMatch.geojson ogr2ogr -f FlatGeobuf dist/conflate/noOSMAddressWithinBlock.fgb dist/conflate/noOSMAddressWithinBlock.geojson +dist/vicmap-complex-conflation: dist/vicmap-complex.geojson + mkdirp -p $@ + ./bin/complex.js $< data/victoria-named-features.osm.geojson $@ + +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 data/victoria-admin.osm.pbf: data/victoria.osm.pbf osmium tags-filter --remove-tags --output=$@ $< r/boundary=administrative @@ -216,10 +224,3 @@ dist/candidates: data/victoria-admin-level10.osm.geojson dist/conflate mkdir -p $@ ./bin/candidates.js $^ $@ -dist/vicmap-complex-conflation: dist/vicmap-complex.geojson - mkdirp -p $@ - ./bin/complex.js $< data/victoria-named-features.osm.geojson $@ - -dist/vicmap-building-conflation: dist/vicmap-building.geojson - mkdirp -p $@ - ./bin/building.js $< data/victoria-named-features.osm.geojson $@ @@ -22,7 +22,11 @@ We use GitLab CI/CD to automate data processing. ## Build candidate files (pre-conflation) -Download source Vicmap data and convert to GeoJSON (_prepare_ stage): +Download source Vicmap data (_prepare_ stage): + + data/vicmap/ll_gda94/sde_shape/whole/VIC/VMADD/layer/address.shp + +Convert to GeoJSON (_prepare_ stage): make data/vicmap.geojson @@ -241,6 +245,16 @@ This produces outputs in `dist/conflate`: 4. `exactMatch` - `addr:housenumber` and `addr:street` match an existing address within the same block. These should be reviewed for import. 5. `noExactMatch` - the Vicmap addresses exists within a block with existing OSM addresses, however no exact match on the `addr:housenumber` and `addr:street` was found. This likely can be imported automatically, but may want to be manually reviewed. +These results are in GeoJSON format, for easier viewing in QGIS convert to FGB with: + + make convertConflationResultsToFGB + +Further processing to conflate Vicmap complex and building names with OSM can be done via: + + make data/victoria-named-features.osm.geojson + make dist/vicmap-complex-conflation + make dist/vicmap-building-conflation + - [ ] we need to deal with addresses represented in OSM as interpolation ways. If there is community consensus to replace these existing interpolation ways with individual point nodes or leave the existing interpolation ways. - [ ] we need a better way to review matches where some attributes differ, potentially as a quick fix MapRoulette for tricky cases, or done as a bulk import for easy cases (eg. simply adding `addr:suburb`, `addr:state` and `addr:postcode`) diff --git a/bin/building.js b/bin/building.js index 2b18aad..f991be2 100755 --- a/bin/building.js +++ b/bin/building.js @@ -72,6 +72,7 @@ outputKeys.forEach(key => { }) let sourceCount = 0 +let exactMatchCount = 0 const conflate = new Transform({ readableObjectMode: true, writableObjectMode: true, @@ -108,7 +109,7 @@ const conflate = new Transform({ // a single nearby OSM features found with similar name if (nearbyMatchedFeatures[0].properties.name.toLowerCase() === name.toLowerCase()) { // name exactly matched - console.log(`Exact match: ${properties.name} = ${nearbyMatchedFeatures[0].properties.name}`) + exactMatchCount++ } else { // name was similar but not an exact match // create a MapRoulette task to investigate further @@ -163,6 +164,7 @@ pipeline( console.log(err) process.exit(1) } else { + console.log(`${exactMatchCount} Vicmap building names exactly matched OSM features`) outputKeys.forEach(key => { outputStreams[key].end() diff --git a/bin/candidates.js b/bin/candidates.js index e350f6f..6e2e7b0 100755 --- a/bin/candidates.js +++ b/bin/candidates.js @@ -145,7 +145,7 @@ function outputCandidates() { } // first pass to index by geometry -console.log('Step 1/X: Reading suburbs') +console.log('Step 1/4: Reading suburbs') pipeline( fs.createReadStream(suburbsFile), ndjson.parse(), @@ -155,13 +155,13 @@ pipeline( console.log(err) process.exit(1) } else { - console.log('Step 2/X: Creating index of Suburbs') + console.log('Step 2/4: Creating index of Suburbs') lookupSuburbs = new PolygonLookup({ type: 'FeatureCollection', features: suburbs }) - console.log('Step 3/X: noOSMAddressWithinBlock') + console.log('Step 3/4: noOSMAddressWithinBlock') pipeline( fs.createReadStream(path.join(conflatePath, 'noOSMAddressWithinBlock.geojson')), ndjson.parse(), @@ -172,7 +172,7 @@ pipeline( process.exit(1) } else { - console.log('Step 4/X: noExactMatch') + console.log('Step 4/4: noExactMatch') pipeline( fs.createReadStream(path.join(conflatePath, 'noExactMatch.geojson')), ndjson.parse(), diff --git a/bin/conflate.js b/bin/conflate.js index c64706f..c2eb813 100755 --- a/bin/conflate.js +++ b/bin/conflate.js @@ -141,7 +141,7 @@ const conflate = new Transform({ } else { // other OSM addresses found within this block, so need to conflate if (!('id' in block)) { - console.error('Expected id for block') + console.error('Expected id for block, maybe you are missing the polygon-lookup patch, try cp src/polygon-lookup-patch.js node_modules/polygon-lookup/index.js') process.exit(1) } |