@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.
Files changed (477) hide show
  1. package/README.md +9 -8
  2. package/lib/address/point/interpolation.ts +45 -39
  3. package/lib/address/point/schema.ts +17 -40
  4. package/lib/address/point.ts +316 -0
  5. package/lib/{address/index.ts → address.ts} +1 -1
  6. package/lib/ancestry/backfill.ts +20 -86
  7. package/lib/{ancestry/index.ts → ancestry.ts} +19 -15
  8. package/lib/build/candidate.ts +122 -174
  9. package/lib/build/population-corrections.ts +64 -0
  10. package/lib/build/slim.ts +44 -114
  11. package/lib/candidate/alias-bags.ts +16 -17
  12. package/lib/candidate/ancestors/schema.ts +77 -61
  13. package/lib/candidate/ancestors/sidecar.ts +15 -22
  14. package/lib/candidate/country-display-names.ts +6 -20
  15. package/lib/candidate/extract-fold.ts +10 -55
  16. package/lib/candidate/fts.ts +5 -23
  17. package/lib/candidate/importance.ts +65 -68
  18. package/lib/candidate/lookup.ts +124 -415
  19. package/lib/candidate/name-roles.ts +15 -33
  20. package/lib/candidate/own-name.ts +35 -32
  21. package/lib/candidate/place-attrs.ts +20 -13
  22. package/lib/candidate/schema.ts +29 -65
  23. package/lib/candidate/scoring.ts +54 -93
  24. package/lib/capital-schema.ts +21 -17
  25. package/lib/capitals.ts +29 -27
  26. package/lib/coincident-roles.ts +85 -55
  27. package/lib/convention/schema.ts +15 -16
  28. package/lib/convention.ts +144 -0
  29. package/lib/coverage-manifest-schema.ts +40 -45
  30. package/lib/currency-backfill.ts +34 -79
  31. package/lib/env.ts +1 -1
  32. package/lib/exact-match.ts +32 -21
  33. package/lib/extracts.ts +97 -74
  34. package/lib/fst/autocomplete.ts +54 -37
  35. package/lib/fst/builder.ts +37 -41
  36. package/lib/fst/deserialize-web.ts +16 -17
  37. package/lib/fst/format.ts +41 -23
  38. package/lib/fst/freshness.ts +43 -120
  39. package/lib/fst/matcher.ts +7 -5
  40. package/lib/fst/serialize.ts +54 -74
  41. package/lib/fst/types.ts +78 -75
  42. package/lib/{fst/index.ts → fst.ts} +1 -0
  43. package/lib/fts/query.ts +5 -36
  44. package/lib/fts.ts +280 -0
  45. package/lib/geonames/aliases.ts +73 -144
  46. package/lib/geonames/postal.ts +162 -71
  47. package/lib/index.ts +9 -8
  48. package/lib/interpolation.ts +48 -100
  49. package/lib/lookup.ts +155 -270
  50. package/lib/name-score.ts +9 -7
  51. package/lib/nsul/lookup.ts +37 -54
  52. package/lib/nsul/schema.ts +16 -43
  53. package/lib/paths.ts +159 -0
  54. package/lib/place-importance-schema.ts +62 -169
  55. package/lib/poi/lookup.ts +104 -121
  56. package/lib/poi/schema.ts +42 -26
  57. package/lib/polygon-schema.ts +10 -6
  58. package/lib/postal/city/alias/lookup.ts +22 -40
  59. package/lib/postal/city/alias/schema.ts +14 -10
  60. package/lib/postal/city/candidate-schema.ts +26 -20
  61. package/lib/postcode-point-lookup.ts +8 -27
  62. package/lib/primary-preference.ts +46 -126
  63. package/lib/proximity-rerank.ts +44 -33
  64. package/lib/ranking-weights.ts +105 -78
  65. package/lib/region-keys.ts +70 -42
  66. package/lib/reverse.ts +149 -86
  67. package/lib/schema.ts +73 -50
  68. package/lib/search-fetch.ts +90 -68
  69. package/lib/sqlite/convention-source.ts +15 -23
  70. package/lib/sqlite/utils.ts +19 -22
  71. package/lib/street/centroid/schema.ts +37 -42
  72. package/lib/street/{centroid/index.ts → centroid.ts} +16 -25
  73. package/lib/street/morphology/fst/builder.ts +60 -42
  74. package/lib/street/morphology/fst/loader.ts +40 -32
  75. package/lib/street/name-lookup.ts +45 -41
  76. package/lib/street/normalize.ts +88 -219
  77. package/lib/street/segment-schema.ts +116 -43
  78. package/lib/{street/index.ts → street.ts} +1 -1
  79. package/lib/types.ts +109 -150
  80. package/lib/unified-schema.ts +29 -29
  81. package/lib/uprn/existence.ts +30 -19
  82. package/lib/uprn/lookup.ts +29 -68
  83. package/lib/uprn/schema.ts +18 -40
  84. package/lib/weights-overlay-linker.ts +236 -252
  85. package/out/address/point/interpolation.d.ts +20 -23
  86. package/out/address/point/interpolation.d.ts.map +1 -1
  87. package/out/address/point/interpolation.js +42 -39
  88. package/out/address/point/interpolation.js.map +1 -1
  89. package/out/address/point/schema.d.ts +12 -35
  90. package/out/address/point/schema.d.ts.map +1 -1
  91. package/out/address/point/schema.js +3 -19
  92. package/out/address/point/schema.js.map +1 -1
  93. package/out/address/point.d.ts +57 -0
  94. package/out/address/point.d.ts.map +1 -0
  95. package/out/address/point.js +206 -0
  96. package/out/address/point.js.map +1 -0
  97. package/out/{address/index.js → address.d.ts} +2 -2
  98. package/out/address.d.ts.map +1 -0
  99. package/out/{address/index.d.ts → address.js} +2 -2
  100. package/out/address.js.map +1 -0
  101. package/out/ancestry/backfill.d.ts +11 -64
  102. package/out/ancestry/backfill.d.ts.map +1 -1
  103. package/out/ancestry/backfill.js +14 -74
  104. package/out/ancestry/backfill.js.map +1 -1
  105. package/out/ancestry.d.ts +49 -0
  106. package/out/ancestry.d.ts.map +1 -0
  107. package/out/ancestry.js +59 -0
  108. package/out/ancestry.js.map +1 -0
  109. package/out/build/candidate.d.ts +82 -112
  110. package/out/build/candidate.d.ts.map +1 -1
  111. package/out/build/candidate.js +17 -100
  112. package/out/build/candidate.js.map +1 -1
  113. package/out/build/population-corrections.d.ts +52 -0
  114. package/out/build/population-corrections.d.ts.map +1 -0
  115. package/out/build/population-corrections.js +40 -0
  116. package/out/build/population-corrections.js.map +1 -0
  117. package/out/build/slim.d.ts +8 -44
  118. package/out/build/slim.d.ts.map +1 -1
  119. package/out/build/slim.js +33 -94
  120. package/out/build/slim.js.map +1 -1
  121. package/out/candidate/alias-bags.d.ts +6 -6
  122. package/out/candidate/alias-bags.d.ts.map +1 -1
  123. package/out/candidate/alias-bags.js +16 -17
  124. package/out/candidate/alias-bags.js.map +1 -1
  125. package/out/candidate/ancestors/schema.d.ts +73 -57
  126. package/out/candidate/ancestors/schema.d.ts.map +1 -1
  127. package/out/candidate/ancestors/schema.js +56 -48
  128. package/out/candidate/ancestors/schema.js.map +1 -1
  129. package/out/candidate/ancestors/sidecar.d.ts +3 -8
  130. package/out/candidate/ancestors/sidecar.d.ts.map +1 -1
  131. package/out/candidate/ancestors/sidecar.js +15 -22
  132. package/out/candidate/ancestors/sidecar.js.map +1 -1
  133. package/out/candidate/country-display-names.d.ts +5 -15
  134. package/out/candidate/country-display-names.d.ts.map +1 -1
  135. package/out/candidate/country-display-names.js +6 -20
  136. package/out/candidate/country-display-names.js.map +1 -1
  137. package/out/candidate/extract-fold.d.ts +7 -15
  138. package/out/candidate/extract-fold.d.ts.map +1 -1
  139. package/out/candidate/extract-fold.js +5 -47
  140. package/out/candidate/extract-fold.js.map +1 -1
  141. package/out/candidate/fts.d.ts +5 -23
  142. package/out/candidate/fts.d.ts.map +1 -1
  143. package/out/candidate/fts.js +5 -23
  144. package/out/candidate/fts.js.map +1 -1
  145. package/out/candidate/importance.d.ts +60 -65
  146. package/out/candidate/importance.d.ts.map +1 -1
  147. package/out/candidate/importance.js +56 -63
  148. package/out/candidate/importance.js.map +1 -1
  149. package/out/candidate/lookup.d.ts +18 -55
  150. package/out/candidate/lookup.d.ts.map +1 -1
  151. package/out/candidate/lookup.js +82 -385
  152. package/out/candidate/lookup.js.map +1 -1
  153. package/out/candidate/name-roles.d.ts +9 -21
  154. package/out/candidate/name-roles.d.ts.map +1 -1
  155. package/out/candidate/name-roles.js +15 -33
  156. package/out/candidate/name-roles.js.map +1 -1
  157. package/out/candidate/own-name.d.ts +23 -25
  158. package/out/candidate/own-name.d.ts.map +1 -1
  159. package/out/candidate/own-name.js +35 -32
  160. package/out/candidate/own-name.js.map +1 -1
  161. package/out/candidate/place-attrs.d.ts +20 -13
  162. package/out/candidate/place-attrs.d.ts.map +1 -1
  163. package/out/candidate/place-attrs.js +4 -5
  164. package/out/candidate/place-attrs.js.map +1 -1
  165. package/out/candidate/schema.d.ts +27 -62
  166. package/out/candidate/schema.d.ts.map +1 -1
  167. package/out/candidate/schema.js +10 -22
  168. package/out/candidate/schema.js.map +1 -1
  169. package/out/candidate/scoring.d.ts +7 -8
  170. package/out/candidate/scoring.d.ts.map +1 -1
  171. package/out/candidate/scoring.js +52 -89
  172. package/out/candidate/scoring.js.map +1 -1
  173. package/out/capital-schema.d.ts +21 -17
  174. package/out/capital-schema.d.ts.map +1 -1
  175. package/out/capital-schema.js +17 -15
  176. package/out/capital-schema.js.map +1 -1
  177. package/out/capitals.d.ts +27 -25
  178. package/out/capitals.d.ts.map +1 -1
  179. package/out/capitals.js +23 -21
  180. package/out/capitals.js.map +1 -1
  181. package/out/coincident-roles.d.ts +60 -43
  182. package/out/coincident-roles.d.ts.map +1 -1
  183. package/out/coincident-roles.js +72 -50
  184. package/out/coincident-roles.js.map +1 -1
  185. package/out/convention/schema.d.ts +14 -14
  186. package/out/convention/schema.d.ts.map +1 -1
  187. package/out/convention/schema.js +6 -4
  188. package/out/convention/schema.js.map +1 -1
  189. package/out/convention.d.ts +97 -0
  190. package/out/convention.d.ts.map +1 -0
  191. package/out/convention.js +81 -0
  192. package/out/convention.js.map +1 -0
  193. package/out/coverage-manifest-schema.d.ts +34 -39
  194. package/out/coverage-manifest-schema.d.ts.map +1 -1
  195. package/out/coverage-manifest-schema.js +25 -34
  196. package/out/coverage-manifest-schema.js.map +1 -1
  197. package/out/currency-backfill.d.ts +16 -38
  198. package/out/currency-backfill.d.ts.map +1 -1
  199. package/out/currency-backfill.js +19 -46
  200. package/out/currency-backfill.js.map +1 -1
  201. package/out/env.d.ts +1 -1
  202. package/out/env.js +1 -1
  203. package/out/exact-match.d.ts +19 -10
  204. package/out/exact-match.d.ts.map +1 -1
  205. package/out/exact-match.js +32 -21
  206. package/out/exact-match.js.map +1 -1
  207. package/out/extracts.d.ts +66 -55
  208. package/out/extracts.d.ts.map +1 -1
  209. package/out/extracts.js +63 -55
  210. package/out/extracts.js.map +1 -1
  211. package/out/fst/autocomplete.d.ts +29 -21
  212. package/out/fst/autocomplete.d.ts.map +1 -1
  213. package/out/fst/autocomplete.js +39 -28
  214. package/out/fst/autocomplete.js.map +1 -1
  215. package/out/fst/builder.d.ts.map +1 -1
  216. package/out/fst/builder.js +37 -41
  217. package/out/fst/builder.js.map +1 -1
  218. package/out/fst/deserialize-web.d.ts +4 -4
  219. package/out/fst/deserialize-web.d.ts.map +1 -1
  220. package/out/fst/deserialize-web.js +15 -16
  221. package/out/fst/deserialize-web.js.map +1 -1
  222. package/out/fst/format.d.ts +41 -23
  223. package/out/fst/format.d.ts.map +1 -1
  224. package/out/fst/format.js +41 -23
  225. package/out/fst/format.js.map +1 -1
  226. package/out/fst/freshness.d.ts +19 -81
  227. package/out/fst/freshness.d.ts.map +1 -1
  228. package/out/fst/freshness.js +31 -94
  229. package/out/fst/freshness.js.map +1 -1
  230. package/out/fst/matcher.d.ts +5 -4
  231. package/out/fst/matcher.d.ts.map +1 -1
  232. package/out/fst/matcher.js +2 -2
  233. package/out/fst/matcher.js.map +1 -1
  234. package/out/fst/serialize.d.ts +28 -28
  235. package/out/fst/serialize.d.ts.map +1 -1
  236. package/out/fst/serialize.js +53 -71
  237. package/out/fst/serialize.js.map +1 -1
  238. package/out/fst/types.d.ts +78 -74
  239. package/out/fst/types.d.ts.map +1 -1
  240. package/out/fst/types.js +1 -4
  241. package/out/fst/types.js.map +1 -1
  242. package/out/{fst/index.js → fst.d.ts} +2 -1
  243. package/out/fst.d.ts.map +1 -0
  244. package/out/{fst/index.d.ts → fst.js} +2 -1
  245. package/out/fst.js.map +1 -0
  246. package/out/fts/query.d.ts +2 -27
  247. package/out/fts/query.d.ts.map +1 -1
  248. package/out/fts/query.js +5 -36
  249. package/out/fts/query.js.map +1 -1
  250. package/out/fts.d.ts +126 -0
  251. package/out/fts.d.ts.map +1 -0
  252. package/out/fts.js +188 -0
  253. package/out/fts.js.map +1 -0
  254. package/out/geonames/aliases.d.ts +26 -62
  255. package/out/geonames/aliases.d.ts.map +1 -1
  256. package/out/geonames/aliases.js +45 -117
  257. package/out/geonames/aliases.js.map +1 -1
  258. package/out/geonames/postal.d.ts +84 -44
  259. package/out/geonames/postal.d.ts.map +1 -1
  260. package/out/geonames/postal.js +115 -73
  261. package/out/geonames/postal.js.map +1 -1
  262. package/out/{geonames/index.js → geonames.d.ts} +1 -1
  263. package/out/geonames.d.ts.map +1 -0
  264. package/out/{geonames/index.d.ts → geonames.js} +1 -1
  265. package/out/geonames.js.map +1 -0
  266. package/out/index.d.ts +9 -8
  267. package/out/index.d.ts.map +1 -1
  268. package/out/index.js +6 -5
  269. package/out/index.js.map +1 -1
  270. package/out/interpolation.d.ts +18 -55
  271. package/out/interpolation.d.ts.map +1 -1
  272. package/out/interpolation.js +27 -69
  273. package/out/interpolation.js.map +1 -1
  274. package/out/lookup.d.ts +23 -51
  275. package/out/lookup.d.ts.map +1 -1
  276. package/out/lookup.js +136 -234
  277. package/out/lookup.js.map +1 -1
  278. package/out/name-score.d.ts +2 -2
  279. package/out/name-score.d.ts.map +1 -1
  280. package/out/name-score.js +9 -7
  281. package/out/name-score.js.map +1 -1
  282. package/out/nsul/lookup.d.ts +33 -34
  283. package/out/nsul/lookup.d.ts.map +1 -1
  284. package/out/nsul/lookup.js +26 -40
  285. package/out/nsul/lookup.js.map +1 -1
  286. package/out/nsul/schema.d.ts +16 -43
  287. package/out/nsul/schema.d.ts.map +1 -1
  288. package/out/nsul/schema.js +9 -35
  289. package/out/nsul/schema.js.map +1 -1
  290. package/out/{nsul/index.d.ts → nsul.d.ts} +1 -1
  291. package/out/nsul.d.ts.map +1 -0
  292. package/out/{nsul/index.js → nsul.js} +1 -1
  293. package/out/nsul.js.map +1 -0
  294. package/out/paths.d.ts +124 -0
  295. package/out/paths.d.ts.map +1 -0
  296. package/out/paths.js +104 -0
  297. package/out/paths.js.map +1 -0
  298. package/out/place-importance-schema.d.ts +51 -143
  299. package/out/place-importance-schema.d.ts.map +1 -1
  300. package/out/place-importance-schema.js +28 -143
  301. package/out/place-importance-schema.js.map +1 -1
  302. package/out/poi/lookup.d.ts +40 -47
  303. package/out/poi/lookup.d.ts.map +1 -1
  304. package/out/poi/lookup.js +69 -96
  305. package/out/poi/lookup.js.map +1 -1
  306. package/out/poi/schema.d.ts +41 -25
  307. package/out/poi/schema.d.ts.map +1 -1
  308. package/out/poi/schema.js +25 -17
  309. package/out/poi/schema.js.map +1 -1
  310. package/out/{poi/index.js → poi.d.ts} +1 -1
  311. package/out/poi.d.ts.map +1 -0
  312. package/out/{poi/index.d.ts → poi.js} +1 -1
  313. package/out/poi.js.map +1 -0
  314. package/out/polygon-schema.d.ts +10 -6
  315. package/out/polygon-schema.d.ts.map +1 -1
  316. package/out/polygon-schema.js +2 -2
  317. package/out/polygon-schema.js.map +1 -1
  318. package/out/postal/city/alias/lookup.d.ts +20 -23
  319. package/out/postal/city/alias/lookup.d.ts.map +1 -1
  320. package/out/postal/city/alias/lookup.js +17 -30
  321. package/out/postal/city/alias/lookup.js.map +1 -1
  322. package/out/postal/city/alias/schema.d.ts +14 -10
  323. package/out/postal/city/alias/schema.d.ts.map +1 -1
  324. package/out/postal/city/alias/schema.js +10 -8
  325. package/out/postal/city/alias/schema.js.map +1 -1
  326. package/out/postal/city/candidate-schema.d.ts +25 -19
  327. package/out/postal/city/candidate-schema.d.ts.map +1 -1
  328. package/out/postal/city/candidate-schema.js +21 -17
  329. package/out/postal/city/candidate-schema.js.map +1 -1
  330. package/out/{postal/index.d.ts → postal.d.ts} +1 -1
  331. package/out/postal.d.ts.map +1 -0
  332. package/out/{postal/index.js → postal.js} +1 -1
  333. package/out/postal.js.map +1 -0
  334. package/out/postcode-point-lookup.d.ts +6 -24
  335. package/out/postcode-point-lookup.d.ts.map +1 -1
  336. package/out/postcode-point-lookup.js +5 -17
  337. package/out/postcode-point-lookup.js.map +1 -1
  338. package/out/primary-preference.d.ts +38 -92
  339. package/out/primary-preference.d.ts.map +1 -1
  340. package/out/primary-preference.js +15 -99
  341. package/out/primary-preference.js.map +1 -1
  342. package/out/proximity-rerank.d.ts +41 -30
  343. package/out/proximity-rerank.d.ts.map +1 -1
  344. package/out/proximity-rerank.js +38 -29
  345. package/out/proximity-rerank.js.map +1 -1
  346. package/out/ranking-weights.d.ts +98 -64
  347. package/out/ranking-weights.d.ts.map +1 -1
  348. package/out/ranking-weights.js +26 -25
  349. package/out/ranking-weights.js.map +1 -1
  350. package/out/region-keys.d.ts +50 -31
  351. package/out/region-keys.d.ts.map +1 -1
  352. package/out/region-keys.js +68 -40
  353. package/out/region-keys.js.map +1 -1
  354. package/out/reverse.d.ts +78 -50
  355. package/out/reverse.d.ts.map +1 -1
  356. package/out/reverse.js +98 -61
  357. package/out/reverse.js.map +1 -1
  358. package/out/schema.d.ts +72 -49
  359. package/out/schema.d.ts.map +1 -1
  360. package/out/schema.js +4 -5
  361. package/out/schema.js.map +1 -1
  362. package/out/search-fetch.d.ts +16 -12
  363. package/out/search-fetch.d.ts.map +1 -1
  364. package/out/search-fetch.js +83 -63
  365. package/out/search-fetch.js.map +1 -1
  366. package/out/sqlite/convention-source.d.ts +12 -16
  367. package/out/sqlite/convention-source.d.ts.map +1 -1
  368. package/out/sqlite/convention-source.js +13 -22
  369. package/out/sqlite/convention-source.js.map +1 -1
  370. package/out/sqlite/utils.d.ts +19 -19
  371. package/out/sqlite/utils.d.ts.map +1 -1
  372. package/out/sqlite/utils.js +14 -15
  373. package/out/sqlite/utils.js.map +1 -1
  374. package/out/street/centroid/schema.d.ts +37 -42
  375. package/out/street/centroid/schema.d.ts.map +1 -1
  376. package/out/street/centroid/schema.js +9 -21
  377. package/out/street/centroid/schema.js.map +1 -1
  378. package/out/street/centroid.d.ts +30 -0
  379. package/out/street/centroid.d.ts.map +1 -0
  380. package/out/street/{centroid/index.js → centroid.js} +13 -24
  381. package/out/street/centroid.js.map +1 -0
  382. package/out/street/morphology/fst/builder.d.ts +20 -10
  383. package/out/street/morphology/fst/builder.d.ts.map +1 -1
  384. package/out/street/morphology/fst/builder.js +44 -34
  385. package/out/street/morphology/fst/builder.js.map +1 -1
  386. package/out/street/morphology/fst/loader.d.ts +33 -26
  387. package/out/street/morphology/fst/loader.d.ts.map +1 -1
  388. package/out/street/morphology/fst/loader.js +23 -22
  389. package/out/street/morphology/fst/loader.js.map +1 -1
  390. package/out/street/name-lookup.d.ts +24 -18
  391. package/out/street/name-lookup.d.ts.map +1 -1
  392. package/out/street/name-lookup.js +34 -35
  393. package/out/street/name-lookup.js.map +1 -1
  394. package/out/street/normalize.d.ts +35 -136
  395. package/out/street/normalize.d.ts.map +1 -1
  396. package/out/street/normalize.js +77 -194
  397. package/out/street/normalize.js.map +1 -1
  398. package/out/street/segment-schema.d.ts +79 -39
  399. package/out/street/segment-schema.d.ts.map +1 -1
  400. package/out/street/segment-schema.js +71 -21
  401. package/out/street/segment-schema.js.map +1 -1
  402. package/out/{street/index.js → street.d.ts} +2 -2
  403. package/out/street.d.ts.map +1 -0
  404. package/out/{street/index.d.ts → street.js} +2 -2
  405. package/out/street.js.map +1 -0
  406. package/out/types.d.ts +84 -149
  407. package/out/types.d.ts.map +1 -1
  408. package/out/types.js +0 -6
  409. package/out/types.js.map +1 -1
  410. package/out/unified-schema.d.ts +8 -12
  411. package/out/unified-schema.d.ts.map +1 -1
  412. package/out/unified-schema.js +29 -29
  413. package/out/unified-schema.js.map +1 -1
  414. package/out/uprn/existence.d.ts +28 -17
  415. package/out/uprn/existence.d.ts.map +1 -1
  416. package/out/uprn/existence.js +26 -16
  417. package/out/uprn/existence.js.map +1 -1
  418. package/out/uprn/lookup.d.ts +14 -44
  419. package/out/uprn/lookup.d.ts.map +1 -1
  420. package/out/uprn/lookup.js +21 -57
  421. package/out/uprn/lookup.js.map +1 -1
  422. package/out/uprn/schema.d.ts +18 -40
  423. package/out/uprn/schema.d.ts.map +1 -1
  424. package/out/uprn/schema.js +10 -32
  425. package/out/uprn/schema.js.map +1 -1
  426. package/out/{uprn/index.d.ts → uprn.d.ts} +1 -1
  427. package/out/uprn.d.ts.map +1 -0
  428. package/out/{uprn/index.js → uprn.js} +1 -1
  429. package/out/uprn.js.map +1 -0
  430. package/out/weights-overlay-linker.d.ts +138 -144
  431. package/out/weights-overlay-linker.d.ts.map +1 -1
  432. package/out/weights-overlay-linker.js +105 -159
  433. package/out/weights-overlay-linker.js.map +1 -1
  434. package/package.json +91 -596
  435. package/lib/address/point/index.ts +0 -328
  436. package/lib/convention/index.ts +0 -154
  437. package/lib/fts/index.ts +0 -361
  438. package/out/address/index.d.ts.map +0 -1
  439. package/out/address/index.js.map +0 -1
  440. package/out/address/point/index.d.ts +0 -53
  441. package/out/address/point/index.d.ts.map +0 -1
  442. package/out/address/point/index.js +0 -222
  443. package/out/address/point/index.js.map +0 -1
  444. package/out/ancestry/index.d.ts +0 -45
  445. package/out/ancestry/index.d.ts.map +0 -1
  446. package/out/ancestry/index.js +0 -55
  447. package/out/ancestry/index.js.map +0 -1
  448. package/out/convention/index.d.ts +0 -106
  449. package/out/convention/index.d.ts.map +0 -1
  450. package/out/convention/index.js +0 -93
  451. package/out/convention/index.js.map +0 -1
  452. package/out/fst/index.d.ts.map +0 -1
  453. package/out/fst/index.js.map +0 -1
  454. package/out/fts/index.d.ts +0 -184
  455. package/out/fts/index.d.ts.map +0 -1
  456. package/out/fts/index.js +0 -277
  457. package/out/fts/index.js.map +0 -1
  458. package/out/geonames/index.d.ts.map +0 -1
  459. package/out/geonames/index.js.map +0 -1
  460. package/out/nsul/index.d.ts.map +0 -1
  461. package/out/nsul/index.js.map +0 -1
  462. package/out/poi/index.d.ts.map +0 -1
  463. package/out/poi/index.js.map +0 -1
  464. package/out/postal/index.d.ts.map +0 -1
  465. package/out/postal/index.js.map +0 -1
  466. package/out/street/centroid/index.d.ts +0 -40
  467. package/out/street/centroid/index.d.ts.map +0 -1
  468. package/out/street/centroid/index.js.map +0 -1
  469. package/out/street/index.d.ts.map +0 -1
  470. package/out/street/index.js.map +0 -1
  471. package/out/uprn/index.d.ts.map +0 -1
  472. package/out/uprn/index.js.map +0 -1
  473. /package/lib/{geonames/index.ts → geonames.ts} +0 -0
  474. /package/lib/{nsul/index.ts → nsul.ts} +0 -0
  475. /package/lib/{poi/index.ts → poi.ts} +0 -0
  476. /package/lib/{postal/index.ts → postal.ts} +0 -0
  477. /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 (#484): `(lat, lon)` → the containing admin hierarchy. Assembly over existing
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. **Candidate fetch** — the admin DB's `place_bbox` R*Tree (built by `fts.ts`) for places whose
10
- * bbox contains the point, smallest-area-first (so the FIRST polygon confirmation is the
11
- * deepest).
12
- * 2. **PIP confirmation** — ray-cast (geo.ts, the canonical TS port of
13
- * `scripts/eval/pip-containment.py`) against the polygon sidecar DB (`wof-polygons.db`,
14
- * `polygons(id, geom)` with GeoJSON text — built by `scripts/build-wof-polygons.mjs` for the
15
- * demo map). A candidate whose polygon EXISTS but rejects the point is a bbox false positive
16
- * and is dropped entirely; a candidate with no polygon row stays eligible for the
17
- * approximate fallback.
18
- * 3. **Approximate descent** — WOF carries point geometry for most localities (#292: ~99% of JP
19
- * municipalities; ~half of US localities have degenerate bboxes too), so the polygon walk
20
- * usually bottoms out at county level. We then descend tier-by-tier (county → localadmin →
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 (polygon coverage: see the #292 JP finding); `containment`
28
- * says so per result rather than pretending.
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"` — the point ray-cast INSIDE the place's real (DP-simplified) admin boundary.
37
- * - `"approximate"` — the place has no polygon on record; it won by nearest-centroid among the candidates whose bbox (or
38
- * parent) contains the point. The same honesty convention as the demo's approximate circles — country-dependent data
39
- * reality, surfaced instead of hidden.
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, DEEPEST-FIRST (`[0]` is the winning place, then its ancestors up to country) — the same tree
45
- * shape forward resolution attaches via `includeAncestors`. Empty when no candidate's bbox contains the point (open
46
- * ocean, or outside the gazetteer's coverage).
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 DEEPEST place in `hierarchy` (see {@link ContainmentKind}).
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`) — must carry `spr`, `ancestors`, and the
57
- * package-built `place_bbox` R*Tree (`mailwoman gazetteer build fts`). Mutually exclusive with `adminDatabase`.
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?: string;
62
+ adminDBPath?: PathBuilderLike;
60
63
  /**
61
- * Pre-opened admin DB — primarily for tests against an inline fixture.
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)`). OPTIONAL — without it every result
66
- * is `containment: "approximate"` (centroid-only mode). Mutually exclusive with `polygonDatabase`.
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?: string;
75
+ polygonDBPath?: PathBuilderLike;
69
76
  /**
70
- * Pre-opened polygon DB — primarily for tests.
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). Default: every admin
77
- * placetype the gazetteer carries. E.g. `["region", "county", "locality"]` to skip the neighbourhood grain.
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. Default 128 — comfortably covers a dense metro (the most bbox-overlapping point
82
- * we've measured is a few dozen neighbourhoods + the admin chain).
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
- * Approximate (nearest-centroid) steps further than this from the query point are not taken — keeps a sparse
87
- * gazetteer from "refining" to a far-away sibling. Polygon-confirmed steps ignore it (containment is exact regardless
88
- * of centroid distance). Default 25 km.
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. Async for symmetry with `PlaceLookup.findPlace` (the work
97
- * is sync `node:sqlite` underneath — same convention). Thin wrapper over {@link reverseGeocodeSync}.
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} — every step underneath is already sync `node:sqlite`, so this is the
102
- * REAL implementation; the async method above exists only for call-site symmetry with `PlaceLookup.findPlace`.
103
- * Exposed directly for callers that can't await mid-call (e.g. `mailwoman/poi-executor.ts`'s `createPOIExecutor`,
104
- * whose `POIIntentOutcome` return type is synchronous by contract — see `poi-intent.ts`'s `deps.execute`).
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;
@@ -1 +1 @@
1
- {"version":3,"file":"reverse.d.ts","sourceRoot":"","sources":["../lib/reverse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAKH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAKzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AA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C,OAAO,CAAC,IAAI,IAAI,CAQvB;CACD"}
package/out/reverse.js CHANGED
@@ -3,37 +3,31 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Reverse geocoding (#484): `(lat, lon)` → the containing admin hierarchy. Assembly over existing
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. **Candidate fetch** — the admin DB's `place_bbox` R*Tree (built by `fts.ts`) for places whose
10
- * bbox contains the point, smallest-area-first (so the FIRST polygon confirmation is the
11
- * deepest).
12
- * 2. **PIP confirmation** — ray-cast (geo.ts, the canonical TS port of
13
- * `scripts/eval/pip-containment.py`) against the polygon sidecar DB (`wof-polygons.db`,
14
- * `polygons(id, geom)` with GeoJSON text — built by `scripts/build-wof-polygons.mjs` for the
15
- * demo map). A candidate whose polygon EXISTS but rejects the point is a bbox false positive
16
- * and is dropped entirely; a candidate with no polygon row stays eligible for the
17
- * approximate fallback.
18
- * 3. **Approximate descent** — WOF carries point geometry for most localities (#292: ~99% of JP
19
- * municipalities; ~half of US localities have degenerate bboxes too), so the polygon walk
20
- * usually bottoms out at county level. We then descend tier-by-tier (county → localadmin →
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 (polygon coverage: see the #292 JP finding); `containment`
28
- * says so per result rather than pretending.
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/index";
36
- import { PLACE_BBOX_TABLE } from "#fts/index";
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. Each tier is attempted among the CURRENT winner's
49
- * descendants; a tier with no rows is skipped (e.g. counties without localadmins jump straight to locality).
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
- function toPlaceCandidate(row, distanceKm) {
60
- const c = {
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 ?? undefined,
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. Reverse queries cluster geographically (an eval run hits the same ~15 county polygons 1400
82
- * times), so caching the JSON.parse pays for itself immediately. Bounded — cleared wholesale at the cap rather than
83
- * LRU-tracked; the polygons are DP-simplified and small, the cap exists only to keep a long-lived server process
84
- * honest.
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 — the R*Tree is a build artifact, not part of the upstream WOF
105
- // distribution, and a missing index would otherwise surface as an opaque SQL error per query.
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. Async for symmetry with `PlaceLookup.findPlace` (the work
117
- * is sync `node:sqlite` underneath — same convention). Thin wrapper over {@link reverseGeocodeSync}.
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} — every step underneath is already sync `node:sqlite`, so this is the
124
- * REAL implementation; the async method above exists only for call-site symmetry with `PlaceLookup.findPlace`.
125
- * Exposed directly for callers that can't await mid-call (e.g. `mailwoman/poi-executor.ts`'s `createPOIExecutor`,
126
- * whose `POIIntentOutcome` return type is synchronous by contract — see `poi-intent.ts`'s `deps.execute`).
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: the first polygon that contains the point is the deepest
138
- // polygon-confirmable place. Polygon-rejected candidates are bbox false positives — dropped.
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 — nearest centroid among the polygon-less bbox candidates.
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 ? undefined : haversineKm(lat, lon, current.lat, current.lon);
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 = undefined;
205
+ nextKm = null;
186
206
  break;
187
207
  }
188
208
  if (contains === false)
189
- continue; // known not-here — polygon rejected
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 NOT terminal — counties without localadmins jump straight to locality.
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. If the descent crossed an ancestry gap
206
- // (the deepest place's recorded lineage misses the PIP root), merge the root's own chain so
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, { ...a, placetype: a.placetype, country: a.country ?? "", score: 0 });
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, { ...a, placetype: a.placetype, country: a.country ?? "", score: 0 });
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 around the query point (a
261
- * generous 4× the approximate cap — polygon-holding children may legitimately have far centroids, e.g. a sprawling
262
- * consolidated city; the precise cap is applied per-candidate in the caller, and only to centroid-fallback steps).
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 — treat as no-polygon rather than failing the query.
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;
@@ -1 +1 @@
1
- {"version":3,"file":"reverse.js","sourceRoot":"","sources":["../lib/reverse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C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