@mailwoman/resolver-wof-sqlite 10.0.0 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -8
- package/lib/address/point/interpolation.ts +45 -39
- package/lib/address/point/schema.ts +17 -40
- package/lib/address/point.ts +316 -0
- package/lib/{address/index.ts → address.ts} +1 -1
- package/lib/ancestry/backfill.ts +20 -86
- package/lib/{ancestry/index.ts → ancestry.ts} +19 -15
- package/lib/build/candidate.ts +122 -174
- package/lib/build/population-corrections.ts +64 -0
- package/lib/build/slim.ts +44 -114
- package/lib/candidate/alias-bags.ts +16 -17
- package/lib/candidate/ancestors/schema.ts +77 -61
- package/lib/candidate/ancestors/sidecar.ts +15 -22
- package/lib/candidate/country-display-names.ts +6 -20
- package/lib/candidate/extract-fold.ts +10 -55
- package/lib/candidate/fts.ts +5 -23
- package/lib/candidate/importance.ts +65 -68
- package/lib/candidate/lookup.ts +124 -415
- package/lib/candidate/name-roles.ts +15 -33
- package/lib/candidate/own-name.ts +35 -32
- package/lib/candidate/place-attrs.ts +20 -13
- package/lib/candidate/schema.ts +29 -65
- package/lib/candidate/scoring.ts +54 -93
- package/lib/capital-schema.ts +21 -17
- package/lib/capitals.ts +29 -27
- package/lib/coincident-roles.ts +85 -55
- package/lib/convention/schema.ts +15 -16
- package/lib/convention.ts +144 -0
- package/lib/coverage-manifest-schema.ts +40 -45
- package/lib/currency-backfill.ts +34 -79
- package/lib/env.ts +1 -1
- package/lib/exact-match.ts +32 -21
- package/lib/extracts.ts +97 -74
- package/lib/fst/autocomplete.ts +54 -37
- package/lib/fst/builder.ts +37 -41
- package/lib/fst/deserialize-web.ts +16 -17
- package/lib/fst/format.ts +41 -23
- package/lib/fst/freshness.ts +43 -120
- package/lib/fst/matcher.ts +7 -5
- package/lib/fst/serialize.ts +54 -74
- package/lib/fst/types.ts +78 -75
- package/lib/{fst/index.ts → fst.ts} +1 -0
- package/lib/fts/query.ts +5 -36
- package/lib/fts.ts +280 -0
- package/lib/geonames/aliases.ts +73 -144
- package/lib/geonames/postal.ts +162 -71
- package/lib/index.ts +9 -8
- package/lib/interpolation.ts +48 -100
- package/lib/lookup.ts +155 -270
- package/lib/name-score.ts +9 -7
- package/lib/nsul/lookup.ts +37 -54
- package/lib/nsul/schema.ts +16 -43
- package/lib/paths.ts +159 -0
- package/lib/place-importance-schema.ts +62 -169
- package/lib/poi/lookup.ts +104 -121
- package/lib/poi/schema.ts +42 -26
- package/lib/polygon-schema.ts +10 -6
- package/lib/postal/city/alias/lookup.ts +22 -40
- package/lib/postal/city/alias/schema.ts +14 -10
- package/lib/postal/city/candidate-schema.ts +26 -20
- package/lib/postcode-point-lookup.ts +8 -27
- package/lib/primary-preference.ts +46 -126
- package/lib/proximity-rerank.ts +44 -33
- package/lib/ranking-weights.ts +105 -78
- package/lib/region-keys.ts +70 -42
- package/lib/reverse.ts +149 -86
- package/lib/schema.ts +73 -50
- package/lib/search-fetch.ts +90 -68
- package/lib/sqlite/convention-source.ts +15 -23
- package/lib/sqlite/utils.ts +19 -22
- package/lib/street/centroid/schema.ts +37 -42
- package/lib/street/{centroid/index.ts → centroid.ts} +16 -25
- package/lib/street/morphology/fst/builder.ts +60 -42
- package/lib/street/morphology/fst/loader.ts +40 -32
- package/lib/street/name-lookup.ts +45 -41
- package/lib/street/normalize.ts +88 -219
- package/lib/street/segment-schema.ts +116 -43
- package/lib/{street/index.ts → street.ts} +1 -1
- package/lib/types.ts +109 -150
- package/lib/unified-schema.ts +29 -29
- package/lib/uprn/existence.ts +30 -19
- package/lib/uprn/lookup.ts +29 -68
- package/lib/uprn/schema.ts +18 -40
- package/lib/weights-overlay-linker.ts +236 -252
- package/out/address/point/interpolation.d.ts +20 -23
- package/out/address/point/interpolation.d.ts.map +1 -1
- package/out/address/point/interpolation.js +42 -39
- package/out/address/point/interpolation.js.map +1 -1
- package/out/address/point/schema.d.ts +12 -35
- package/out/address/point/schema.d.ts.map +1 -1
- package/out/address/point/schema.js +3 -19
- package/out/address/point/schema.js.map +1 -1
- package/out/address/point.d.ts +57 -0
- package/out/address/point.d.ts.map +1 -0
- package/out/address/point.js +206 -0
- package/out/address/point.js.map +1 -0
- package/out/{address/index.js → address.d.ts} +2 -2
- package/out/address.d.ts.map +1 -0
- package/out/{address/index.d.ts → address.js} +2 -2
- package/out/address.js.map +1 -0
- package/out/ancestry/backfill.d.ts +11 -64
- package/out/ancestry/backfill.d.ts.map +1 -1
- package/out/ancestry/backfill.js +14 -74
- package/out/ancestry/backfill.js.map +1 -1
- package/out/ancestry.d.ts +49 -0
- package/out/ancestry.d.ts.map +1 -0
- package/out/ancestry.js +59 -0
- package/out/ancestry.js.map +1 -0
- package/out/build/candidate.d.ts +82 -112
- package/out/build/candidate.d.ts.map +1 -1
- package/out/build/candidate.js +17 -100
- package/out/build/candidate.js.map +1 -1
- package/out/build/population-corrections.d.ts +52 -0
- package/out/build/population-corrections.d.ts.map +1 -0
- package/out/build/population-corrections.js +40 -0
- package/out/build/population-corrections.js.map +1 -0
- package/out/build/slim.d.ts +8 -44
- package/out/build/slim.d.ts.map +1 -1
- package/out/build/slim.js +33 -94
- package/out/build/slim.js.map +1 -1
- package/out/candidate/alias-bags.d.ts +6 -6
- package/out/candidate/alias-bags.d.ts.map +1 -1
- package/out/candidate/alias-bags.js +16 -17
- package/out/candidate/alias-bags.js.map +1 -1
- package/out/candidate/ancestors/schema.d.ts +73 -57
- package/out/candidate/ancestors/schema.d.ts.map +1 -1
- package/out/candidate/ancestors/schema.js +56 -48
- package/out/candidate/ancestors/schema.js.map +1 -1
- package/out/candidate/ancestors/sidecar.d.ts +3 -8
- package/out/candidate/ancestors/sidecar.d.ts.map +1 -1
- package/out/candidate/ancestors/sidecar.js +15 -22
- package/out/candidate/ancestors/sidecar.js.map +1 -1
- package/out/candidate/country-display-names.d.ts +5 -15
- package/out/candidate/country-display-names.d.ts.map +1 -1
- package/out/candidate/country-display-names.js +6 -20
- package/out/candidate/country-display-names.js.map +1 -1
- package/out/candidate/extract-fold.d.ts +7 -15
- package/out/candidate/extract-fold.d.ts.map +1 -1
- package/out/candidate/extract-fold.js +5 -47
- package/out/candidate/extract-fold.js.map +1 -1
- package/out/candidate/fts.d.ts +5 -23
- package/out/candidate/fts.d.ts.map +1 -1
- package/out/candidate/fts.js +5 -23
- package/out/candidate/fts.js.map +1 -1
- package/out/candidate/importance.d.ts +60 -65
- package/out/candidate/importance.d.ts.map +1 -1
- package/out/candidate/importance.js +56 -63
- package/out/candidate/importance.js.map +1 -1
- package/out/candidate/lookup.d.ts +18 -55
- package/out/candidate/lookup.d.ts.map +1 -1
- package/out/candidate/lookup.js +82 -385
- package/out/candidate/lookup.js.map +1 -1
- package/out/candidate/name-roles.d.ts +9 -21
- package/out/candidate/name-roles.d.ts.map +1 -1
- package/out/candidate/name-roles.js +15 -33
- package/out/candidate/name-roles.js.map +1 -1
- package/out/candidate/own-name.d.ts +23 -25
- package/out/candidate/own-name.d.ts.map +1 -1
- package/out/candidate/own-name.js +35 -32
- package/out/candidate/own-name.js.map +1 -1
- package/out/candidate/place-attrs.d.ts +20 -13
- package/out/candidate/place-attrs.d.ts.map +1 -1
- package/out/candidate/place-attrs.js +4 -5
- package/out/candidate/place-attrs.js.map +1 -1
- package/out/candidate/schema.d.ts +27 -62
- package/out/candidate/schema.d.ts.map +1 -1
- package/out/candidate/schema.js +10 -22
- package/out/candidate/schema.js.map +1 -1
- package/out/candidate/scoring.d.ts +7 -8
- package/out/candidate/scoring.d.ts.map +1 -1
- package/out/candidate/scoring.js +52 -89
- package/out/candidate/scoring.js.map +1 -1
- package/out/capital-schema.d.ts +21 -17
- package/out/capital-schema.d.ts.map +1 -1
- package/out/capital-schema.js +17 -15
- package/out/capital-schema.js.map +1 -1
- package/out/capitals.d.ts +27 -25
- package/out/capitals.d.ts.map +1 -1
- package/out/capitals.js +23 -21
- package/out/capitals.js.map +1 -1
- package/out/coincident-roles.d.ts +60 -43
- package/out/coincident-roles.d.ts.map +1 -1
- package/out/coincident-roles.js +72 -50
- package/out/coincident-roles.js.map +1 -1
- package/out/convention/schema.d.ts +14 -14
- package/out/convention/schema.d.ts.map +1 -1
- package/out/convention/schema.js +6 -4
- package/out/convention/schema.js.map +1 -1
- package/out/convention.d.ts +97 -0
- package/out/convention.d.ts.map +1 -0
- package/out/convention.js +81 -0
- package/out/convention.js.map +1 -0
- package/out/coverage-manifest-schema.d.ts +34 -39
- package/out/coverage-manifest-schema.d.ts.map +1 -1
- package/out/coverage-manifest-schema.js +25 -34
- package/out/coverage-manifest-schema.js.map +1 -1
- package/out/currency-backfill.d.ts +16 -38
- package/out/currency-backfill.d.ts.map +1 -1
- package/out/currency-backfill.js +19 -46
- package/out/currency-backfill.js.map +1 -1
- package/out/env.d.ts +1 -1
- package/out/env.js +1 -1
- package/out/exact-match.d.ts +19 -10
- package/out/exact-match.d.ts.map +1 -1
- package/out/exact-match.js +32 -21
- package/out/exact-match.js.map +1 -1
- package/out/extracts.d.ts +66 -55
- package/out/extracts.d.ts.map +1 -1
- package/out/extracts.js +63 -55
- package/out/extracts.js.map +1 -1
- package/out/fst/autocomplete.d.ts +29 -21
- package/out/fst/autocomplete.d.ts.map +1 -1
- package/out/fst/autocomplete.js +39 -28
- package/out/fst/autocomplete.js.map +1 -1
- package/out/fst/builder.d.ts.map +1 -1
- package/out/fst/builder.js +37 -41
- package/out/fst/builder.js.map +1 -1
- package/out/fst/deserialize-web.d.ts +4 -4
- package/out/fst/deserialize-web.d.ts.map +1 -1
- package/out/fst/deserialize-web.js +15 -16
- package/out/fst/deserialize-web.js.map +1 -1
- package/out/fst/format.d.ts +41 -23
- package/out/fst/format.d.ts.map +1 -1
- package/out/fst/format.js +41 -23
- package/out/fst/format.js.map +1 -1
- package/out/fst/freshness.d.ts +19 -81
- package/out/fst/freshness.d.ts.map +1 -1
- package/out/fst/freshness.js +31 -94
- package/out/fst/freshness.js.map +1 -1
- package/out/fst/matcher.d.ts +5 -4
- package/out/fst/matcher.d.ts.map +1 -1
- package/out/fst/matcher.js +2 -2
- package/out/fst/matcher.js.map +1 -1
- package/out/fst/serialize.d.ts +28 -28
- package/out/fst/serialize.d.ts.map +1 -1
- package/out/fst/serialize.js +53 -71
- package/out/fst/serialize.js.map +1 -1
- package/out/fst/types.d.ts +78 -74
- package/out/fst/types.d.ts.map +1 -1
- package/out/fst/types.js +1 -4
- package/out/fst/types.js.map +1 -1
- package/out/{fst/index.js → fst.d.ts} +2 -1
- package/out/fst.d.ts.map +1 -0
- package/out/{fst/index.d.ts → fst.js} +2 -1
- package/out/fst.js.map +1 -0
- package/out/fts/query.d.ts +2 -27
- package/out/fts/query.d.ts.map +1 -1
- package/out/fts/query.js +5 -36
- package/out/fts/query.js.map +1 -1
- package/out/fts.d.ts +126 -0
- package/out/fts.d.ts.map +1 -0
- package/out/fts.js +188 -0
- package/out/fts.js.map +1 -0
- package/out/geonames/aliases.d.ts +26 -62
- package/out/geonames/aliases.d.ts.map +1 -1
- package/out/geonames/aliases.js +45 -117
- package/out/geonames/aliases.js.map +1 -1
- package/out/geonames/postal.d.ts +84 -44
- package/out/geonames/postal.d.ts.map +1 -1
- package/out/geonames/postal.js +115 -73
- package/out/geonames/postal.js.map +1 -1
- package/out/{geonames/index.js → geonames.d.ts} +1 -1
- package/out/geonames.d.ts.map +1 -0
- package/out/{geonames/index.d.ts → geonames.js} +1 -1
- package/out/geonames.js.map +1 -0
- package/out/index.d.ts +9 -8
- package/out/index.d.ts.map +1 -1
- package/out/index.js +6 -5
- package/out/index.js.map +1 -1
- package/out/interpolation.d.ts +18 -55
- package/out/interpolation.d.ts.map +1 -1
- package/out/interpolation.js +27 -69
- package/out/interpolation.js.map +1 -1
- package/out/lookup.d.ts +23 -51
- package/out/lookup.d.ts.map +1 -1
- package/out/lookup.js +136 -234
- package/out/lookup.js.map +1 -1
- package/out/name-score.d.ts +2 -2
- package/out/name-score.d.ts.map +1 -1
- package/out/name-score.js +9 -7
- package/out/name-score.js.map +1 -1
- package/out/nsul/lookup.d.ts +33 -34
- package/out/nsul/lookup.d.ts.map +1 -1
- package/out/nsul/lookup.js +26 -40
- package/out/nsul/lookup.js.map +1 -1
- package/out/nsul/schema.d.ts +16 -43
- package/out/nsul/schema.d.ts.map +1 -1
- package/out/nsul/schema.js +9 -35
- package/out/nsul/schema.js.map +1 -1
- package/out/{nsul/index.d.ts → nsul.d.ts} +1 -1
- package/out/nsul.d.ts.map +1 -0
- package/out/{nsul/index.js → nsul.js} +1 -1
- package/out/nsul.js.map +1 -0
- package/out/paths.d.ts +124 -0
- package/out/paths.d.ts.map +1 -0
- package/out/paths.js +104 -0
- package/out/paths.js.map +1 -0
- package/out/place-importance-schema.d.ts +51 -143
- package/out/place-importance-schema.d.ts.map +1 -1
- package/out/place-importance-schema.js +28 -143
- package/out/place-importance-schema.js.map +1 -1
- package/out/poi/lookup.d.ts +40 -47
- package/out/poi/lookup.d.ts.map +1 -1
- package/out/poi/lookup.js +69 -96
- package/out/poi/lookup.js.map +1 -1
- package/out/poi/schema.d.ts +41 -25
- package/out/poi/schema.d.ts.map +1 -1
- package/out/poi/schema.js +25 -17
- package/out/poi/schema.js.map +1 -1
- package/out/{poi/index.js → poi.d.ts} +1 -1
- package/out/poi.d.ts.map +1 -0
- package/out/{poi/index.d.ts → poi.js} +1 -1
- package/out/poi.js.map +1 -0
- package/out/polygon-schema.d.ts +10 -6
- package/out/polygon-schema.d.ts.map +1 -1
- package/out/polygon-schema.js +2 -2
- package/out/polygon-schema.js.map +1 -1
- package/out/postal/city/alias/lookup.d.ts +20 -23
- package/out/postal/city/alias/lookup.d.ts.map +1 -1
- package/out/postal/city/alias/lookup.js +17 -30
- package/out/postal/city/alias/lookup.js.map +1 -1
- package/out/postal/city/alias/schema.d.ts +14 -10
- package/out/postal/city/alias/schema.d.ts.map +1 -1
- package/out/postal/city/alias/schema.js +10 -8
- package/out/postal/city/alias/schema.js.map +1 -1
- package/out/postal/city/candidate-schema.d.ts +25 -19
- package/out/postal/city/candidate-schema.d.ts.map +1 -1
- package/out/postal/city/candidate-schema.js +21 -17
- package/out/postal/city/candidate-schema.js.map +1 -1
- package/out/{postal/index.d.ts → postal.d.ts} +1 -1
- package/out/postal.d.ts.map +1 -0
- package/out/{postal/index.js → postal.js} +1 -1
- package/out/postal.js.map +1 -0
- package/out/postcode-point-lookup.d.ts +6 -24
- package/out/postcode-point-lookup.d.ts.map +1 -1
- package/out/postcode-point-lookup.js +5 -17
- package/out/postcode-point-lookup.js.map +1 -1
- package/out/primary-preference.d.ts +38 -92
- package/out/primary-preference.d.ts.map +1 -1
- package/out/primary-preference.js +15 -99
- package/out/primary-preference.js.map +1 -1
- package/out/proximity-rerank.d.ts +41 -30
- package/out/proximity-rerank.d.ts.map +1 -1
- package/out/proximity-rerank.js +38 -29
- package/out/proximity-rerank.js.map +1 -1
- package/out/ranking-weights.d.ts +98 -64
- package/out/ranking-weights.d.ts.map +1 -1
- package/out/ranking-weights.js +26 -25
- package/out/ranking-weights.js.map +1 -1
- package/out/region-keys.d.ts +50 -31
- package/out/region-keys.d.ts.map +1 -1
- package/out/region-keys.js +68 -40
- package/out/region-keys.js.map +1 -1
- package/out/reverse.d.ts +78 -50
- package/out/reverse.d.ts.map +1 -1
- package/out/reverse.js +98 -61
- package/out/reverse.js.map +1 -1
- package/out/schema.d.ts +72 -49
- package/out/schema.d.ts.map +1 -1
- package/out/schema.js +4 -5
- package/out/schema.js.map +1 -1
- package/out/search-fetch.d.ts +16 -12
- package/out/search-fetch.d.ts.map +1 -1
- package/out/search-fetch.js +83 -63
- package/out/search-fetch.js.map +1 -1
- package/out/sqlite/convention-source.d.ts +12 -16
- package/out/sqlite/convention-source.d.ts.map +1 -1
- package/out/sqlite/convention-source.js +13 -22
- package/out/sqlite/convention-source.js.map +1 -1
- package/out/sqlite/utils.d.ts +19 -19
- package/out/sqlite/utils.d.ts.map +1 -1
- package/out/sqlite/utils.js +14 -15
- package/out/sqlite/utils.js.map +1 -1
- package/out/street/centroid/schema.d.ts +37 -42
- package/out/street/centroid/schema.d.ts.map +1 -1
- package/out/street/centroid/schema.js +9 -21
- package/out/street/centroid/schema.js.map +1 -1
- package/out/street/centroid.d.ts +30 -0
- package/out/street/centroid.d.ts.map +1 -0
- package/out/street/{centroid/index.js → centroid.js} +13 -24
- package/out/street/centroid.js.map +1 -0
- package/out/street/morphology/fst/builder.d.ts +20 -10
- package/out/street/morphology/fst/builder.d.ts.map +1 -1
- package/out/street/morphology/fst/builder.js +44 -34
- package/out/street/morphology/fst/builder.js.map +1 -1
- package/out/street/morphology/fst/loader.d.ts +33 -26
- package/out/street/morphology/fst/loader.d.ts.map +1 -1
- package/out/street/morphology/fst/loader.js +23 -22
- package/out/street/morphology/fst/loader.js.map +1 -1
- package/out/street/name-lookup.d.ts +24 -18
- package/out/street/name-lookup.d.ts.map +1 -1
- package/out/street/name-lookup.js +34 -35
- package/out/street/name-lookup.js.map +1 -1
- package/out/street/normalize.d.ts +35 -136
- package/out/street/normalize.d.ts.map +1 -1
- package/out/street/normalize.js +77 -194
- package/out/street/normalize.js.map +1 -1
- package/out/street/segment-schema.d.ts +79 -39
- package/out/street/segment-schema.d.ts.map +1 -1
- package/out/street/segment-schema.js +71 -21
- package/out/street/segment-schema.js.map +1 -1
- package/out/{street/index.js → street.d.ts} +2 -2
- package/out/street.d.ts.map +1 -0
- package/out/{street/index.d.ts → street.js} +2 -2
- package/out/street.js.map +1 -0
- package/out/types.d.ts +84 -149
- package/out/types.d.ts.map +1 -1
- package/out/types.js +0 -6
- package/out/types.js.map +1 -1
- package/out/unified-schema.d.ts +8 -12
- package/out/unified-schema.d.ts.map +1 -1
- package/out/unified-schema.js +29 -29
- package/out/unified-schema.js.map +1 -1
- package/out/uprn/existence.d.ts +28 -17
- package/out/uprn/existence.d.ts.map +1 -1
- package/out/uprn/existence.js +26 -16
- package/out/uprn/existence.js.map +1 -1
- package/out/uprn/lookup.d.ts +14 -44
- package/out/uprn/lookup.d.ts.map +1 -1
- package/out/uprn/lookup.js +21 -57
- package/out/uprn/lookup.js.map +1 -1
- package/out/uprn/schema.d.ts +18 -40
- package/out/uprn/schema.d.ts.map +1 -1
- package/out/uprn/schema.js +10 -32
- package/out/uprn/schema.js.map +1 -1
- package/out/{uprn/index.d.ts → uprn.d.ts} +1 -1
- package/out/uprn.d.ts.map +1 -0
- package/out/{uprn/index.js → uprn.js} +1 -1
- package/out/uprn.js.map +1 -0
- package/out/weights-overlay-linker.d.ts +138 -144
- package/out/weights-overlay-linker.d.ts.map +1 -1
- package/out/weights-overlay-linker.js +105 -159
- package/out/weights-overlay-linker.js.map +1 -1
- package/package.json +91 -596
- package/lib/address/point/index.ts +0 -328
- package/lib/convention/index.ts +0 -154
- package/lib/fts/index.ts +0 -361
- package/out/address/index.d.ts.map +0 -1
- package/out/address/index.js.map +0 -1
- package/out/address/point/index.d.ts +0 -53
- package/out/address/point/index.d.ts.map +0 -1
- package/out/address/point/index.js +0 -222
- package/out/address/point/index.js.map +0 -1
- package/out/ancestry/index.d.ts +0 -45
- package/out/ancestry/index.d.ts.map +0 -1
- package/out/ancestry/index.js +0 -55
- package/out/ancestry/index.js.map +0 -1
- package/out/convention/index.d.ts +0 -106
- package/out/convention/index.d.ts.map +0 -1
- package/out/convention/index.js +0 -93
- package/out/convention/index.js.map +0 -1
- package/out/fst/index.d.ts.map +0 -1
- package/out/fst/index.js.map +0 -1
- package/out/fts/index.d.ts +0 -184
- package/out/fts/index.d.ts.map +0 -1
- package/out/fts/index.js +0 -277
- package/out/fts/index.js.map +0 -1
- package/out/geonames/index.d.ts.map +0 -1
- package/out/geonames/index.js.map +0 -1
- package/out/nsul/index.d.ts.map +0 -1
- package/out/nsul/index.js.map +0 -1
- package/out/poi/index.d.ts.map +0 -1
- package/out/poi/index.js.map +0 -1
- package/out/postal/index.d.ts.map +0 -1
- package/out/postal/index.js.map +0 -1
- package/out/street/centroid/index.d.ts +0 -40
- package/out/street/centroid/index.d.ts.map +0 -1
- package/out/street/centroid/index.js.map +0 -1
- package/out/street/index.d.ts.map +0 -1
- package/out/street/index.js.map +0 -1
- package/out/uprn/index.d.ts.map +0 -1
- package/out/uprn/index.js.map +0 -1
- /package/lib/{geonames/index.ts → geonames.ts} +0 -0
- /package/lib/{nsul/index.ts → nsul.ts} +0 -0
- /package/lib/{poi/index.ts → poi.ts} +0 -0
- /package/lib/{postal/index.ts → postal.ts} +0 -0
- /package/lib/{uprn/index.ts → uprn.ts} +0 -0
package/out/reverse.d.ts
CHANGED
|
@@ -3,89 +3,110 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Reverse geocoding
|
|
7
|
-
* implementation, per the 2026-06-11 scoping notes:
|
|
6
|
+
* Reverse geocoding: map a `(lat, lon)` point to the containing admin hierarchy.
|
|
8
7
|
*
|
|
9
|
-
* 1.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* locality → …) through the winner's DESCENDANTS (the `ancestors` table, reversed), taking
|
|
22
|
-
* the PIP-confirmed child when a polygon exists and the nearest-centroid child otherwise —
|
|
23
|
-
* the latter flagged `containment: "approximate"`, the demo's honesty convention.
|
|
24
|
-
* 4. **Hierarchy assembly** — the deepest place's ancestor chain via the SAME walk forward resolution
|
|
25
|
-
* uses (`ancestry.ts`, #404), so consumers get a symmetric tree.
|
|
8
|
+
* 1. Fetch the admin DB's `place_bbox` R*Tree candidates whose bbox contains the point,
|
|
9
|
+
* smallest-area-first, so the first polygon confirmation is the deepest.
|
|
10
|
+
* 2. Confirm each candidate by ray-cast (geo.ts, the canonical TS port of
|
|
11
|
+
* `scripts/eval/pip-containment.py`) against the polygon sidecar DB (`wof-polygons.db`,
|
|
12
|
+
* `polygons(id, geom)` with GeoJSON text, built by `scripts/build-wof-polygons.mjs`). A
|
|
13
|
+
* candidate whose polygon exists but rejects the point is a bbox false positive and is
|
|
14
|
+
* dropped. A candidate with no polygon row stays eligible for the approximate fallback.
|
|
15
|
+
* 3. Descend tier-by-tier through the winner's descendants (the `ancestors` table, reversed),
|
|
16
|
+
* taking the PIP-confirmed child when a polygon exists and the nearest-centroid child
|
|
17
|
+
* otherwise. A centroid-fallback step is flagged `containment: "approximate"`.
|
|
18
|
+
* 4. Assemble the deepest place's ancestor chain through the same walk forward resolution uses,
|
|
19
|
+
* so consumers get a symmetric tree.
|
|
26
20
|
*
|
|
27
|
-
* Reverse quality is country-dependent
|
|
28
|
-
*
|
|
21
|
+
* Reverse quality is country-dependent, because polygon coverage is. `containment` records this per
|
|
22
|
+
* result.
|
|
29
23
|
*/
|
|
30
24
|
import { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
25
|
+
import type { PathBuilderLike } from "path-ts";
|
|
31
26
|
import type { WOFDatabase } from "#schema";
|
|
32
27
|
import type { PlaceCandidate, WOFPlacetype } from "#types";
|
|
33
28
|
/**
|
|
34
29
|
* How the deepest returned place was confirmed:
|
|
35
30
|
*
|
|
36
|
-
* - `"polygon"
|
|
37
|
-
* - `"approximate"
|
|
38
|
-
*
|
|
39
|
-
*
|
|
31
|
+
* - `"polygon"`: the point ray-cast inside the place's real (DP-simplified) admin boundary.
|
|
32
|
+
* - `"approximate"`: the place has no polygon on record.
|
|
33
|
+
* It returns the nearest-centroid candidate among places whose bbox or parent contains the point.
|
|
34
|
+
* The demo's approximate circles use the same convention.
|
|
35
|
+
* Both results expose country-dependent data coverage.
|
|
40
36
|
*/
|
|
41
37
|
export type ContainmentKind = "polygon" | "approximate";
|
|
42
38
|
export interface ReverseGeocodeResult {
|
|
43
39
|
/**
|
|
44
|
-
* The containment chain,
|
|
45
|
-
*
|
|
46
|
-
*
|
|
40
|
+
* The containment chain, deepest-first.
|
|
41
|
+
*
|
|
42
|
+
* `[0]` is the winning place, then its ancestors up to country.
|
|
43
|
+
* This is the same tree shape forward resolution attaches via `includeAncestors`.
|
|
44
|
+
*
|
|
45
|
+
* Empty when no candidate's bbox contains the point (open ocean, or outside the gazetteer's coverage).
|
|
47
46
|
*/
|
|
48
47
|
hierarchy: PlaceCandidate[];
|
|
49
48
|
/**
|
|
50
|
-
* Containment kind of the
|
|
49
|
+
* Containment kind of the deepest place in `hierarchy` (see {@link ContainmentKind}).
|
|
51
50
|
*/
|
|
52
51
|
containment: ContainmentKind;
|
|
53
52
|
}
|
|
54
53
|
export interface WOFReverseGeocoderOpts {
|
|
55
54
|
/**
|
|
56
|
-
* Path to the admin gazetteer DB (e.g. `admin-global-priority.db`)
|
|
57
|
-
*
|
|
55
|
+
* Path to the admin gazetteer DB (e.g. `admin-global-priority.db`).
|
|
56
|
+
*
|
|
57
|
+
* It must include `spr`, `ancestors`, and the package-built `place_bbox`
|
|
58
|
+
* R*Tree (`mailwoman gazetteer build fts`).
|
|
59
|
+
*
|
|
60
|
+
* Mutually exclusive with `adminDatabase`.
|
|
58
61
|
*/
|
|
59
|
-
adminDBPath?:
|
|
62
|
+
adminDBPath?: PathBuilderLike;
|
|
60
63
|
/**
|
|
61
|
-
* Pre-opened admin DB
|
|
64
|
+
* Pre-opened admin DB, primarily for tests against an inline fixture.
|
|
62
65
|
*/
|
|
63
66
|
adminDatabase?: DatabaseClient<WOFDatabase>;
|
|
64
67
|
/**
|
|
65
|
-
* Path to the polygon sidecar DB (`wof-polygons.db`, table `polygons(id, geom)`).
|
|
66
|
-
*
|
|
68
|
+
* Path to the polygon sidecar DB (`wof-polygons.db`, table `polygons(id, geom)`).
|
|
69
|
+
*
|
|
70
|
+
* Optional.
|
|
71
|
+
* Without it every result is `containment: "approximate"` (centroid-only mode).
|
|
72
|
+
*
|
|
73
|
+
* Mutually exclusive with `polygonDatabase`.
|
|
67
74
|
*/
|
|
68
|
-
polygonDBPath?:
|
|
75
|
+
polygonDBPath?: PathBuilderLike;
|
|
69
76
|
/**
|
|
70
|
-
* Pre-opened polygon DB
|
|
77
|
+
* Pre-opened polygon DB, primarily for tests.
|
|
71
78
|
*/
|
|
72
79
|
polygonDatabase?: DatabaseClient<WOFDatabase>;
|
|
73
80
|
}
|
|
74
81
|
export interface ReverseGeocodeOpts {
|
|
75
82
|
/**
|
|
76
|
-
* Restrict the hierarchy to these placetypes (both the bbox candidates and the descent tiers).
|
|
77
|
-
*
|
|
83
|
+
* Restrict the hierarchy to these placetypes (both the bbox candidates and the descent tiers).
|
|
84
|
+
*
|
|
85
|
+
* E.g.
|
|
86
|
+
*
|
|
87
|
+
* `["region", "county", "locality"]` to skip the neighborhood grain.
|
|
88
|
+
*
|
|
89
|
+
* @defaultValue every admin placetype in the gazetteer.
|
|
78
90
|
*/
|
|
79
91
|
placetypes?: WOFPlacetype[];
|
|
80
92
|
/**
|
|
81
|
-
* Cap on the bbox candidate fetch.
|
|
82
|
-
*
|
|
93
|
+
* Cap on the bbox candidate fetch.
|
|
94
|
+
*
|
|
95
|
+
* Current measurements show that this covers a dense metro.
|
|
96
|
+
*
|
|
97
|
+
* The most bbox-overlapping point we have measured is a few dozen neighborhoods plus the admin chain.
|
|
98
|
+
*
|
|
99
|
+
* @defaultValue `128`
|
|
83
100
|
*/
|
|
84
101
|
maxCandidates?: number;
|
|
85
102
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
103
|
+
* The lookup skips approximate (nearest-centroid) steps farther than this from the query point.
|
|
104
|
+
*
|
|
105
|
+
* This keeps a sparse gazetteer from "refining" to a far-away sibling.
|
|
106
|
+
*
|
|
107
|
+
* Polygon-confirmed steps ignore it (containment is exact regardless of centroid distance).
|
|
108
|
+
*
|
|
109
|
+
* @defaultValue `25 km`
|
|
89
110
|
*/
|
|
90
111
|
maxApproximateKm?: number;
|
|
91
112
|
}
|
|
@@ -93,15 +114,22 @@ export declare class WOFReverseGeocoder implements Disposable {
|
|
|
93
114
|
#private;
|
|
94
115
|
constructor(opts: WOFReverseGeocoderOpts);
|
|
95
116
|
/**
|
|
96
|
-
* Resolve a WGS-84 point to its containing admin hierarchy.
|
|
97
|
-
*
|
|
117
|
+
* Resolve a WGS-84 point to its containing admin hierarchy.
|
|
118
|
+
*
|
|
119
|
+
* Async for symmetry with `PlaceLookup.findPlace`
|
|
120
|
+
* (the work is sync `node:sqlite` underneath, the same convention).
|
|
121
|
+
* Thin wrapper over {@link reverseGeocodeSync}.
|
|
98
122
|
*/
|
|
99
123
|
reverseGeocode(lat: number, lon: number, opts?: ReverseGeocodeOpts): Promise<ReverseGeocodeResult>;
|
|
100
124
|
/**
|
|
101
|
-
* Synchronous core of {@link reverseGeocode}
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
125
|
+
* Synchronous core of {@link reverseGeocode}.
|
|
126
|
+
*
|
|
127
|
+
* Every step underneath is already sync `node:sqlite`, so this is the real implementation.
|
|
128
|
+
* The async method above exists only for call-site symmetry with `PlaceLookup.findPlace`.
|
|
129
|
+
*
|
|
130
|
+
* Exposed directly for callers that can't await mid-call
|
|
131
|
+
* (e.g. `mailwoman/poi-executor.ts`'s `createPOIExecutor`, whose `POIQueryResult`
|
|
132
|
+
* return type is synchronous by interface. See `poi-intent.ts`'s `deps.execute`).
|
|
105
133
|
*/
|
|
106
134
|
reverseGeocodeSync(lat: number, lon: number, opts?: ReverseGeocodeOpts): ReverseGeocodeResult;
|
|
107
135
|
[Symbol.dispose](): void;
|
package/out/reverse.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reverse.d.ts","sourceRoot":"","sources":["../lib/reverse.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reverse.d.ts","sourceRoot":"","sources":["../lib/reverse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,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.js
CHANGED
|
@@ -3,37 +3,31 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Reverse geocoding
|
|
7
|
-
* implementation, per the 2026-06-11 scoping notes:
|
|
6
|
+
* Reverse geocoding: map a `(lat, lon)` point to the containing admin hierarchy.
|
|
8
7
|
*
|
|
9
|
-
* 1.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* locality → …) through the winner's DESCENDANTS (the `ancestors` table, reversed), taking
|
|
22
|
-
* the PIP-confirmed child when a polygon exists and the nearest-centroid child otherwise —
|
|
23
|
-
* the latter flagged `containment: "approximate"`, the demo's honesty convention.
|
|
24
|
-
* 4. **Hierarchy assembly** — the deepest place's ancestor chain via the SAME walk forward resolution
|
|
25
|
-
* uses (`ancestry.ts`, #404), so consumers get a symmetric tree.
|
|
8
|
+
* 1. Fetch the admin DB's `place_bbox` R*Tree candidates whose bbox contains the point,
|
|
9
|
+
* smallest-area-first, so the first polygon confirmation is the deepest.
|
|
10
|
+
* 2. Confirm each candidate by ray-cast (geo.ts, the canonical TS port of
|
|
11
|
+
* `scripts/eval/pip-containment.py`) against the polygon sidecar DB (`wof-polygons.db`,
|
|
12
|
+
* `polygons(id, geom)` with GeoJSON text, built by `scripts/build-wof-polygons.mjs`). A
|
|
13
|
+
* candidate whose polygon exists but rejects the point is a bbox false positive and is
|
|
14
|
+
* dropped. A candidate with no polygon row stays eligible for the approximate fallback.
|
|
15
|
+
* 3. Descend tier-by-tier through the winner's descendants (the `ancestors` table, reversed),
|
|
16
|
+
* taking the PIP-confirmed child when a polygon exists and the nearest-centroid child
|
|
17
|
+
* otherwise. A centroid-fallback step is flagged `containment: "approximate"`.
|
|
18
|
+
* 4. Assemble the deepest place's ancestor chain through the same walk forward resolution uses,
|
|
19
|
+
* so consumers get a symmetric tree.
|
|
26
20
|
*
|
|
27
|
-
* Reverse quality is country-dependent
|
|
28
|
-
*
|
|
21
|
+
* Reverse quality is country-dependent, because polygon coverage is. `containment` records this per
|
|
22
|
+
* result.
|
|
29
23
|
*/
|
|
30
24
|
import { tryParsingJSON } from "@mailwoman/core/json";
|
|
31
25
|
import { allRows } from "@mailwoman/core/utils";
|
|
32
26
|
import { bboxAround, geometryContains, haversineKm } from "@mailwoman/spatial";
|
|
33
27
|
import { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
34
28
|
import { tableExists } from "@mailwoman/sqlite/introspection";
|
|
35
|
-
import { ancestorLineage, placetypeDepth } from "#ancestry
|
|
36
|
-
import { PLACE_BBOX_TABLE } from "#fts
|
|
29
|
+
import { ancestorLineage, placetypeDepth } from "#ancestry";
|
|
30
|
+
import { PLACE_BBOX_TABLE } from "#fts";
|
|
37
31
|
/**
|
|
38
32
|
* Largest absolute latitude in WGS-84 degrees.
|
|
39
33
|
*/
|
|
@@ -45,8 +39,10 @@ const MAX_ABS_LONGITUDE = 180;
|
|
|
45
39
|
const DEFAULT_MAX_CANDIDATES = 128;
|
|
46
40
|
const DEFAULT_MAX_APPROXIMATE_KM = 25;
|
|
47
41
|
/**
|
|
48
|
-
* The tier ladder for the approximate descent, coarsest-first.
|
|
49
|
-
*
|
|
42
|
+
* The tier ladder for the approximate descent, coarsest-first.
|
|
43
|
+
*
|
|
44
|
+
* Each tier is attempted among the current winner's descendants.
|
|
45
|
+
* A tier with no rows is skipped (e.g. counties without localadmins jump straight to locality).
|
|
50
46
|
*/
|
|
51
47
|
const DESCENT_TIERS = [
|
|
52
48
|
"county",
|
|
@@ -56,21 +52,34 @@ const DESCENT_TIERS = [
|
|
|
56
52
|
"neighbourhood",
|
|
57
53
|
"microhood",
|
|
58
54
|
];
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
const ABSENT_CANDIDATE_FIELDS = {
|
|
56
|
+
parent_id: null,
|
|
57
|
+
distanceKm: null,
|
|
58
|
+
exactMatch: null,
|
|
59
|
+
prominence: null,
|
|
60
|
+
population: null,
|
|
61
|
+
referential: null,
|
|
62
|
+
encyclopedic: null,
|
|
63
|
+
importance: null,
|
|
64
|
+
bbox: null,
|
|
65
|
+
mismatch: null,
|
|
66
|
+
containedByQualifier: null,
|
|
67
|
+
regionScopeMiss: null,
|
|
68
|
+
variantAliasExempted: null,
|
|
69
|
+
};
|
|
70
|
+
function toPlaceCandidate(row, distanceKm = null) {
|
|
71
|
+
return {
|
|
72
|
+
...ABSENT_CANDIDATE_FIELDS,
|
|
61
73
|
id: row.id,
|
|
62
74
|
name: row.name,
|
|
63
75
|
placetype: row.placetype,
|
|
64
76
|
country: row.country ?? "",
|
|
65
77
|
lat: row.lat,
|
|
66
78
|
lon: row.lon,
|
|
67
|
-
parent_id: row.parent_id ??
|
|
79
|
+
parent_id: row.parent_id ?? null,
|
|
68
80
|
score: 0,
|
|
81
|
+
distanceKm,
|
|
69
82
|
};
|
|
70
|
-
if (distanceKm !== undefined) {
|
|
71
|
-
c.distanceKm = distanceKm;
|
|
72
|
-
}
|
|
73
|
-
return c;
|
|
74
83
|
}
|
|
75
84
|
export class WOFReverseGeocoder {
|
|
76
85
|
#admin;
|
|
@@ -78,10 +87,12 @@ export class WOFReverseGeocoder {
|
|
|
78
87
|
#polygons;
|
|
79
88
|
#ownsPolygons;
|
|
80
89
|
/**
|
|
81
|
-
* Parsed-geometry cache.
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
90
|
+
* Parsed-geometry cache.
|
|
91
|
+
*
|
|
92
|
+
* Reverse queries cluster geographically, so caching the JSON.parse avoids repeated work.
|
|
93
|
+
* The cache is bounded and clears wholesale at the cap.
|
|
94
|
+
*
|
|
95
|
+
* The polygons are DP-simplified and small, so the cap only bounds a long-lived server process.
|
|
85
96
|
*/
|
|
86
97
|
#geometryCache = new Map();
|
|
87
98
|
static #GEOMETRY_CACHE_CAP = 4096;
|
|
@@ -101,8 +112,9 @@ export class WOFReverseGeocoder {
|
|
|
101
112
|
opts.polygonDatabase ??
|
|
102
113
|
(opts.polygonDBPath ? new DatabaseClient(opts.polygonDBPath, { readOnly: true }) : null);
|
|
103
114
|
this.#ownsPolygons = !opts.polygonDatabase && Boolean(opts.polygonDBPath);
|
|
104
|
-
// Fail loudly up front
|
|
105
|
-
//
|
|
115
|
+
// Fail loudly up front.
|
|
116
|
+
// The R*Tree is a build artifact and is not part of the upstream WOF distribution,
|
|
117
|
+
// so a missing index would otherwise surface as an opaque SQL error per query.
|
|
106
118
|
if (!tableExists(this.#admin, PLACE_BBOX_TABLE)) {
|
|
107
119
|
throw new Error(`WOFReverseGeocoder: the admin DB has no \`${PLACE_BBOX_TABLE}\` R*Tree. Build it with ` +
|
|
108
120
|
"`mailwoman gazetteer build fts <path-to-wof.db>` (see resolver-wof-sqlite/README.md).");
|
|
@@ -113,17 +125,24 @@ export class WOFReverseGeocoder {
|
|
|
113
125
|
}
|
|
114
126
|
}
|
|
115
127
|
/**
|
|
116
|
-
* Resolve a WGS-84 point to its containing admin hierarchy.
|
|
117
|
-
*
|
|
128
|
+
* Resolve a WGS-84 point to its containing admin hierarchy.
|
|
129
|
+
*
|
|
130
|
+
* Async for symmetry with `PlaceLookup.findPlace`
|
|
131
|
+
* (the work is sync `node:sqlite` underneath, the same convention).
|
|
132
|
+
* Thin wrapper over {@link reverseGeocodeSync}.
|
|
118
133
|
*/
|
|
119
134
|
async reverseGeocode(lat, lon, opts = {}) {
|
|
120
135
|
return this.reverseGeocodeSync(lat, lon, opts);
|
|
121
136
|
}
|
|
122
137
|
/**
|
|
123
|
-
* Synchronous core of {@link reverseGeocode}
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
138
|
+
* Synchronous core of {@link reverseGeocode}.
|
|
139
|
+
*
|
|
140
|
+
* Every step underneath is already sync `node:sqlite`, so this is the real implementation.
|
|
141
|
+
* The async method above exists only for call-site symmetry with `PlaceLookup.findPlace`.
|
|
142
|
+
*
|
|
143
|
+
* Exposed directly for callers that can't await mid-call
|
|
144
|
+
* (e.g. `mailwoman/poi-executor.ts`'s `createPOIExecutor`, whose `POIQueryResult`
|
|
145
|
+
* return type is synchronous by interface. See `poi-intent.ts`'s `deps.execute`).
|
|
127
146
|
*/
|
|
128
147
|
reverseGeocodeSync(lat, lon, opts = {}) {
|
|
129
148
|
if (!Number.isFinite(lat) ||
|
|
@@ -134,8 +153,9 @@ export class WOFReverseGeocoder {
|
|
|
134
153
|
}
|
|
135
154
|
const maxApproximateKm = opts.maxApproximateKm ?? DEFAULT_MAX_APPROXIMATE_KM;
|
|
136
155
|
const candidates = this.#bboxCandidates(lat, lon, opts);
|
|
137
|
-
// PIP walk, smallest-bbox-first
|
|
138
|
-
// polygon
|
|
156
|
+
// PIP walk, smallest-bbox-first.
|
|
157
|
+
// The first polygon that contains the point is the deepest polygon-confirmable place.
|
|
158
|
+
// Drop candidates whose bounding boxes match but whose polygons reject the point.
|
|
139
159
|
let winner = null;
|
|
140
160
|
let winnerConfirmed = false;
|
|
141
161
|
const pointOnly = [];
|
|
@@ -151,7 +171,7 @@ export class WOFReverseGeocoder {
|
|
|
151
171
|
}
|
|
152
172
|
}
|
|
153
173
|
if (!winner) {
|
|
154
|
-
// No polygon confirmed anywhere
|
|
174
|
+
// No polygon confirmed anywhere, so take the nearest centroid among the polygon-less bbox candidates.
|
|
155
175
|
let bestKm = Infinity;
|
|
156
176
|
for (const c of pointOnly) {
|
|
157
177
|
const km = haversineKm(lat, lon, c.lat, c.lon);
|
|
@@ -166,7 +186,7 @@ export class WOFReverseGeocoder {
|
|
|
166
186
|
// Approximate descent into finer tiers than the winner.
|
|
167
187
|
let current = winner;
|
|
168
188
|
let currentConfirmed = winnerConfirmed;
|
|
169
|
-
let currentDistanceKm = currentConfirmed ?
|
|
189
|
+
let currentDistanceKm = currentConfirmed ? null : haversineKm(lat, lon, current.lat, current.lon);
|
|
170
190
|
for (const tier of DESCENT_TIERS) {
|
|
171
191
|
if (placetypeDepth(tier) <= placetypeDepth(current.placetype))
|
|
172
192
|
continue;
|
|
@@ -175,18 +195,18 @@ export class WOFReverseGeocoder {
|
|
|
175
195
|
const kids = this.#descendants(current.id, tier, lat, lon, maxApproximateKm);
|
|
176
196
|
let next = null;
|
|
177
197
|
let nextConfirmed = false;
|
|
178
|
-
let nextKm;
|
|
198
|
+
let nextKm = null;
|
|
179
199
|
let bestKm = Infinity;
|
|
180
200
|
for (const k of kids) {
|
|
181
201
|
const contains = geometryContains(this.#geometry(k.id), lon, lat);
|
|
182
202
|
if (contains === true) {
|
|
183
203
|
next = k;
|
|
184
204
|
nextConfirmed = true;
|
|
185
|
-
nextKm =
|
|
205
|
+
nextKm = null;
|
|
186
206
|
break;
|
|
187
207
|
}
|
|
188
208
|
if (contains === false)
|
|
189
|
-
continue; // known not-here
|
|
209
|
+
continue; // known not-here, polygon rejected
|
|
190
210
|
const km = haversineKm(lat, lon, k.lat, k.lon);
|
|
191
211
|
if (km <= maxApproximateKm && km < bestKm) {
|
|
192
212
|
bestKm = km;
|
|
@@ -200,22 +220,35 @@ export class WOFReverseGeocoder {
|
|
|
200
220
|
currentConfirmed = nextConfirmed;
|
|
201
221
|
currentDistanceKm = nextKm;
|
|
202
222
|
}
|
|
203
|
-
// An empty tier is
|
|
223
|
+
// An empty tier is not terminal.
|
|
224
|
+
// Counties without localadmins jump straight to locality.
|
|
204
225
|
}
|
|
205
|
-
// Hierarchy assembly via the shared ancestor walk.
|
|
206
|
-
// (the deepest place's recorded lineage misses the PIP root),
|
|
207
|
-
// region/country are always present when a polygon confirmed them.
|
|
226
|
+
// Hierarchy assembly via the shared ancestor walk.
|
|
227
|
+
// If the descent crossed an ancestry gap (the deepest place's recorded lineage misses the PIP root),
|
|
228
|
+
// merge the root's own chain so region/country are always present when a polygon confirmed them.
|
|
208
229
|
const byID = new Map([[current.id, toPlaceCandidate(current, currentDistanceKm)]]);
|
|
209
230
|
for (const a of ancestorLineage(this.#admin, current.id)) {
|
|
210
231
|
if (!byID.has(a.id)) {
|
|
211
|
-
byID.set(a.id, {
|
|
232
|
+
byID.set(a.id, {
|
|
233
|
+
...ABSENT_CANDIDATE_FIELDS,
|
|
234
|
+
...a,
|
|
235
|
+
placetype: a.placetype,
|
|
236
|
+
country: a.country ?? "",
|
|
237
|
+
score: 0,
|
|
238
|
+
});
|
|
212
239
|
}
|
|
213
240
|
}
|
|
214
241
|
if (!byID.has(winner.id)) {
|
|
215
242
|
byID.set(winner.id, toPlaceCandidate(winner));
|
|
216
243
|
for (const a of ancestorLineage(this.#admin, winner.id)) {
|
|
217
244
|
if (!byID.has(a.id)) {
|
|
218
|
-
byID.set(a.id, {
|
|
245
|
+
byID.set(a.id, {
|
|
246
|
+
...ABSENT_CANDIDATE_FIELDS,
|
|
247
|
+
...a,
|
|
248
|
+
placetype: a.placetype,
|
|
249
|
+
country: a.country ?? "",
|
|
250
|
+
score: 0,
|
|
251
|
+
});
|
|
219
252
|
}
|
|
220
253
|
}
|
|
221
254
|
}
|
|
@@ -257,9 +290,12 @@ export class WOFReverseGeocoder {
|
|
|
257
290
|
LIMIT ?`), ...params);
|
|
258
291
|
}
|
|
259
292
|
/**
|
|
260
|
-
* Descendants of `parentID` at one placetype tier, pre-filtered to a centroid window
|
|
261
|
-
* generous 4× the approximate cap
|
|
262
|
-
*
|
|
293
|
+
* Descendants of `parentID` at one placetype tier, pre-filtered to a centroid window
|
|
294
|
+
* around the query point (a generous 4× the approximate cap, since polygon-holding
|
|
295
|
+
* children may legitimately have far centroids, e.g. a sprawling consolidated city).
|
|
296
|
+
*
|
|
297
|
+
* The caller applies the precise cap per candidate.
|
|
298
|
+
* It limits centroid-fallback steps only.
|
|
263
299
|
*/
|
|
264
300
|
#descendants(parentID, placetype, lat, lon, maxApproximateKm) {
|
|
265
301
|
const window = bboxAround(lat, lon, maxApproximateKm * 4);
|
|
@@ -282,7 +318,8 @@ export class WOFReverseGeocoder {
|
|
|
282
318
|
this.#geometryCache.clear();
|
|
283
319
|
}
|
|
284
320
|
const row = this.#polygons.prepare(`SELECT geom FROM polygons WHERE id = ?`).get(id);
|
|
285
|
-
// Malformed row parses to null
|
|
321
|
+
// Malformed row parses to null.
|
|
322
|
+
// Treat it as no-polygon so the query does not fail.
|
|
286
323
|
const geometry = row ? tryParsingJSON(row.geom) : null;
|
|
287
324
|
this.#geometryCache.set(id, geometry);
|
|
288
325
|
return geometry;
|
package/out/reverse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reverse.js","sourceRoot":"","sources":["../lib/reverse.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reverse.js","sourceRoot":"","sources":["../lib/reverse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAuB,MAAM,oBAAoB,CAAA;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAG7D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAA;AAGvC;;GAEG;AACH,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAE3B;;GAEG;AACH,MAAM,iBAAiB,GAAG,GAAG,CAAA;AA2F7B,MAAM,sBAAsB,GAAG,GAAG,CAAA;AAClC,MAAM,0BAA0B,GAAG,EAAE,CAAA;AAErC;;;;;GAKG;AACH,MAAM,aAAa,GAA4B;IAC9C,QAAQ;IACR,YAAY;IACZ,UAAU;IACV,SAAS;IACT,eAAe;IACf,WAAW;CAC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