diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-07-05 23:41:35 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-07-05 23:41:35 +1000 |
commit | 9e3708dca0c07765ea047846fac0015c067308a2 (patch) | |
tree | 82ab801189141e189ee61603126c0dfff2501458 /lib | |
parent | 6a9a77e4860b9c64ee1fd6de86025268570696cb (diff) |
fix reduce overlap where range is first
Diffstat (limited to 'lib')
-rw-r--r-- | lib/withinRange.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/withinRange.js b/lib/withinRange.js index b86da82..f8b61ad 100644 --- a/lib/withinRange.js +++ b/lib/withinRange.js @@ -53,12 +53,18 @@ module.exports = (feature, rangeFeature, options) => { let iFrom let iTo let iRange = false + let match if (iParts.length === 2) { iRange = true iFrom = iParts[0].match(regexp).groups iTo = iParts[1].match(regexp).groups + } else { + match = feature.properties['addr:housenumber'].match(regexp) + if (!match) { + console.log(`${feature.properties['addr:housenumber']} didn't match regexp`, feature) + } } - const i = !iRange ? feature.properties['addr:housenumber'].match(regexp).groups : null + const i = iRange ? null : match.groups if ( iRange ? ( Number.isInteger(Number(iFrom.num)) && Number.isInteger(Number(iTo.num)) && Number.isInteger(Number(from.num)) && Number.isInteger(Number(to.num)) && |