From 73280f487386fdb7267221c580a3f5b754b5bd4d Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Sat, 21 May 2022 16:36:13 +1000 Subject: only include addr:flats if not too long --- README.md | 2 +- bin/reduceOverlap.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5e6bede..ff3e314 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ Multiple points overlapping don't add any extra value to the OSM data and are ar Data consumers can still easily explode `addr:flats` out into overlapping nodes with varying `addr:unit` if desired. -Because OSM tag values are limited to 255 characters, if the constructed `addr:flats` exceeds this it is split across `addr:flats`, `addr:flats1`, etc. While not ideal I don't see any other option. +However to avoid creating too many immediate problems, given OSM Carto will include `addr:flats` as a map label, without truncating long strings, if the flats range includes more than 3 then `addr:flats` is ommitted. This is not ideal, but is more conservative given this is a bulk import. 3. Where all the overlapping points have no units and the same street, suburb, state, postcode but different housenumbers, the housenumbers are combined into a range. diff --git a/bin/reduceOverlap.js b/bin/reduceOverlap.js index cc73bed..2da84ec 100755 --- a/bin/reduceOverlap.js +++ b/bin/reduceOverlap.js @@ -177,7 +177,10 @@ const reduce = new Transform({ this.push(retainedFeature) } else { const flats = unitsToRanges(allOtherUnits, argv.verbose && featureGroup) - nonUnitFeature.properties['addr:flats'] = flats + // because OSM carto will render addr:flats regardless of length for the time being if there would be too many flat ranges then don't include addr:flats at all + if (flats.split(';').length <= 2) { + nonUnitFeature.properties['addr:flats'] = flats + } if (nonUnitFeature.properties._pfi) { nonUnitFeature.properties._pfi = featureGroup.map(f => f.properties._pfi).join(',') } -- cgit v1.2.3