diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-15 21:13:00 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-15 21:13:00 +1000 |
commit | b8e3db9f16fe2e82cd6ab80a6f5ad97cc881ebd7 (patch) | |
tree | 3b30bae037b54d5ae81f05d579809a20671044d4 /bin | |
parent | 3f5a8c25bba4d459238deeaf7042f59f69e9d4ab (diff) |
test flats inside range
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reduceRangeDuplicates.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/reduceRangeDuplicates.js b/bin/reduceRangeDuplicates.js index 6322e94..67dbf4e 100755 --- a/bin/reduceRangeDuplicates.js +++ b/bin/reduceRangeDuplicates.js @@ -234,11 +234,13 @@ const reduceNonRange = new Transform({ const range = ranges[i] // if the range wasn't just removed in filter A, and the feature is within the range if (!(hash(range) in rangesRemovedInFilterA) && withinRange(feature, range)) { - // found within a range, drop feature unless would drop addr:unit information - if ('addr:unit' in feature.properties) { - // safe to drop if the same addr:unit is also on the range - if ('addr:unit' in range.properties && - feature.properties['addr:unit'] === range.properties['addr:unit']) { + // found within a range, drop feature unless would drop addr:unit or addr:flats information + if ('addr:unit' in feature.properties || 'addr:flats' in feature.properties) { + // safe to drop if the same addr:unit and addr:flats is also on the range + if ( + 'addr:unit' in feature.properties ? ('addr:unit' in range.properties && feature.properties['addr:unit'] === range.properties['addr:unit']) : true && + 'addr:flats' in feature.properties ? ('addr:flats' in range.properties && feature.properties['addr:flats'] === range.properties['addr:flats']) : true + ) { dropFeature = true } else { // since the non-range feature has a unit that the range doesn't have, don't drop it |