@mailwoman/resolver-wof-sqlite 9.4.0 → 10.1.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 (548) hide show
  1. package/README.md +8 -8
  2. package/lib/address/{point-interpolation.ts → point/interpolation.ts} +40 -38
  3. package/lib/address/point/schema.ts +132 -0
  4. package/lib/address/point.ts +68 -81
  5. package/lib/{address/index.ts → address.ts} +2 -2
  6. package/lib/ancestry/backfill.ts +24 -88
  7. package/lib/{ancestry/index.ts → ancestry.ts} +19 -15
  8. package/lib/build/candidate.ts +608 -0
  9. package/lib/build/population-corrections.ts +64 -0
  10. package/lib/build/slim.ts +338 -0
  11. package/lib/candidate/alias-bags.ts +74 -14
  12. package/lib/candidate/ancestors/schema.ts +211 -0
  13. package/lib/candidate/{ancestors-sidecar.ts → ancestors/sidecar.ts} +17 -24
  14. package/lib/candidate/country-display-names.ts +6 -20
  15. package/lib/candidate/extract-fold.ts +12 -57
  16. package/lib/candidate/fts.ts +28 -0
  17. package/lib/candidate/importance.ts +221 -0
  18. package/lib/candidate/lookup.ts +669 -0
  19. package/lib/candidate/name-roles.ts +16 -34
  20. package/lib/candidate/own-name.ts +34 -31
  21. package/lib/candidate/place-attrs.ts +20 -13
  22. package/lib/candidate/schema.ts +211 -0
  23. package/lib/candidate/scoring.ts +222 -0
  24. package/lib/capital-schema.ts +21 -17
  25. package/lib/capitals.ts +26 -24
  26. package/lib/coincident-roles.ts +74 -55
  27. package/lib/convention/schema.ts +13 -7
  28. package/lib/convention.ts +144 -0
  29. package/lib/coverage-manifest-schema.ts +34 -39
  30. package/lib/currency-backfill.ts +24 -69
  31. package/lib/env.ts +1 -1
  32. package/lib/exact-match.ts +31 -20
  33. package/lib/extracts.ts +96 -73
  34. package/lib/fst/autocomplete.ts +52 -35
  35. package/lib/fst/builder.ts +30 -36
  36. package/lib/fst/deserialize-web.ts +8 -9
  37. package/lib/fst/format.ts +41 -23
  38. package/lib/fst/freshness.ts +17 -95
  39. package/lib/fst/matcher.ts +2 -2
  40. package/lib/fst/serialize.ts +45 -60
  41. package/lib/fst/types.ts +71 -59
  42. package/lib/fts/query.ts +5 -36
  43. package/lib/fts.ts +280 -0
  44. package/lib/geonames/aliases.ts +72 -149
  45. package/lib/geonames/postal.ts +162 -77
  46. package/lib/index.ts +20 -27
  47. package/lib/interpolation.ts +43 -96
  48. package/lib/lookup.ts +137 -257
  49. package/lib/name-score.ts +9 -7
  50. package/lib/nsul/lookup.ts +36 -53
  51. package/lib/nsul/schema.ts +16 -43
  52. package/lib/paths.ts +159 -0
  53. package/lib/place-importance-schema.ts +57 -164
  54. package/lib/poi/lookup.ts +100 -109
  55. package/lib/poi/schema.ts +42 -26
  56. package/lib/polygon-schema.ts +10 -6
  57. package/lib/postal/city/alias/lookup.ts +79 -0
  58. package/lib/postal/{city-alias-schema.ts → city/alias/schema.ts} +14 -10
  59. package/lib/postal/{city-candidate-schema.ts → city/candidate-schema.ts} +26 -20
  60. package/lib/postal.ts +9 -0
  61. package/lib/postcode-point-lookup.ts +9 -19
  62. package/lib/primary-preference.ts +45 -125
  63. package/lib/proximity-rerank.ts +43 -32
  64. package/lib/ranking-weights.ts +98 -76
  65. package/lib/region-keys.ts +68 -40
  66. package/lib/reverse.ts +108 -72
  67. package/lib/schema.ts +74 -42
  68. package/lib/search-fetch.ts +90 -68
  69. package/lib/sqlite/convention-source.ts +57 -0
  70. package/lib/sqlite/utils.ts +79 -0
  71. package/lib/street/centroid/schema.ts +149 -0
  72. package/lib/street/centroid.ts +16 -25
  73. package/lib/street/{morphology-fst-builder.ts → morphology/fst/builder.ts} +56 -41
  74. package/lib/street/{morphology-fst-loader.ts → morphology/fst/loader.ts} +36 -29
  75. package/lib/street/name-lookup.ts +43 -35
  76. package/lib/street/normalize.ts +85 -216
  77. package/lib/street/segment-schema.ts +116 -43
  78. package/lib/{street/index.ts → street.ts} +3 -3
  79. package/lib/types.ts +94 -140
  80. package/lib/unified-schema.ts +29 -29
  81. package/lib/uprn/existence.ts +30 -19
  82. package/lib/uprn/lookup.ts +28 -67
  83. package/lib/uprn/schema.ts +18 -40
  84. package/lib/weights-overlay-linker.ts +204 -232
  85. package/out/address/point/interpolation.d.ts +45 -0
  86. package/out/address/point/interpolation.d.ts.map +1 -0
  87. package/out/address/{point-interpolation.js → point/interpolation.js} +38 -38
  88. package/out/address/point/interpolation.js.map +1 -0
  89. package/out/address/point/schema.d.ts +74 -0
  90. package/out/address/point/schema.d.ts.map +1 -0
  91. package/out/address/{point-schema.js → point/schema.js} +4 -20
  92. package/out/address/point/schema.js.map +1 -0
  93. package/out/address/point.d.ts +24 -21
  94. package/out/address/point.d.ts.map +1 -1
  95. package/out/address/point.js +60 -77
  96. package/out/address/point.js.map +1 -1
  97. package/out/{address/index.js → address.d.ts} +3 -3
  98. package/out/address.d.ts.map +1 -0
  99. package/out/{address/index.d.ts → address.js} +3 -3
  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 +18 -76
  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 +170 -0
  110. package/out/build/candidate.d.ts.map +1 -0
  111. package/out/{build-candidate.js → build/candidate.js} +33 -102
  112. package/out/build/candidate.js.map +1 -0
  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 +44 -0
  118. package/out/build/slim.d.ts.map +1 -0
  119. package/out/{build-slim.js → build/slim.js} +33 -94
  120. package/out/build/slim.js.map +1 -0
  121. package/out/candidate/alias-bags.d.ts +13 -5
  122. package/out/candidate/alias-bags.d.ts.map +1 -1
  123. package/out/candidate/alias-bags.js +55 -12
  124. package/out/candidate/alias-bags.js.map +1 -1
  125. package/out/candidate/ancestors/schema.d.ts +166 -0
  126. package/out/candidate/ancestors/schema.d.ts.map +1 -0
  127. package/out/candidate/ancestors/schema.js +131 -0
  128. package/out/candidate/ancestors/schema.js.map +1 -0
  129. package/out/candidate/ancestors/sidecar.d.ts +27 -0
  130. package/out/candidate/ancestors/sidecar.d.ts.map +1 -0
  131. package/out/candidate/{ancestors-sidecar.js → ancestors/sidecar.js} +17 -24
  132. package/out/candidate/ancestors/sidecar.js.map +1 -0
  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 +8 -16
  138. package/out/candidate/extract-fold.d.ts.map +1 -1
  139. package/out/candidate/extract-fold.js +6 -48
  140. package/out/candidate/extract-fold.js.map +1 -1
  141. package/out/candidate/fts.d.ts +19 -0
  142. package/out/candidate/fts.d.ts.map +1 -0
  143. package/out/candidate/fts.js +22 -0
  144. package/out/candidate/fts.js.map +1 -0
  145. package/out/candidate/importance.d.ts +127 -0
  146. package/out/candidate/importance.d.ts.map +1 -0
  147. package/out/candidate/importance.js +162 -0
  148. package/out/candidate/importance.js.map +1 -0
  149. package/out/candidate/lookup.d.ts +36 -0
  150. package/out/candidate/lookup.d.ts.map +1 -0
  151. package/out/candidate/lookup.js +456 -0
  152. package/out/candidate/lookup.js.map +1 -0
  153. package/out/candidate/name-roles.d.ts +10 -22
  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 +34 -31
  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 +120 -0
  166. package/out/candidate/schema.d.ts.map +1 -0
  167. package/out/{candidate-schema.js → candidate/schema.js} +11 -23
  168. package/out/candidate/schema.js.map +1 -0
  169. package/out/{candidate-scoring.d.ts → candidate/scoring.d.ts} +8 -9
  170. package/out/candidate/scoring.d.ts.map +1 -0
  171. package/out/candidate/scoring.js +157 -0
  172. package/out/candidate/scoring.js.map +1 -0
  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 +26 -24
  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 +61 -50
  184. package/out/coincident-roles.js.map +1 -1
  185. package/out/convention/schema.d.ts +12 -6
  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 +33 -38
  194. package/out/coverage-manifest-schema.d.ts.map +1 -1
  195. package/out/coverage-manifest-schema.js +20 -29
  196. package/out/coverage-manifest-schema.js.map +1 -1
  197. package/out/currency-backfill.d.ts +13 -35
  198. package/out/currency-backfill.d.ts.map +1 -1
  199. package/out/currency-backfill.js +12 -39
  200. package/out/currency-backfill.js.map +1 -1
  201. package/out/env.d.ts +2 -2
  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 +31 -20
  206. package/out/exact-match.js.map +1 -1
  207. package/out/extracts.d.ts +65 -54
  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 +28 -20
  212. package/out/fst/autocomplete.d.ts.map +1 -1
  213. package/out/fst/autocomplete.js +38 -27
  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 +30 -36
  217. package/out/fst/builder.js.map +1 -1
  218. package/out/fst/deserialize-web.d.ts +3 -3
  219. package/out/fst/deserialize-web.d.ts.map +1 -1
  220. package/out/fst/deserialize-web.js +8 -9
  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 +11 -73
  227. package/out/fst/freshness.d.ts.map +1 -1
  228. package/out/fst/freshness.js +12 -76
  229. package/out/fst/freshness.js.map +1 -1
  230. package/out/fst/matcher.d.ts +1 -1
  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 +30 -26
  235. package/out/fst/serialize.d.ts.map +1 -1
  236. package/out/fst/serialize.js +44 -58
  237. package/out/fst/serialize.js.map +1 -1
  238. package/out/fst/types.d.ts +71 -59
  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} +1 -1
  243. package/out/fst.d.ts.map +1 -0
  244. package/out/{fst/index.d.ts → fst.js} +1 -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 -67
  255. package/out/geonames/aliases.d.ts.map +1 -1
  256. package/out/geonames/aliases.js +44 -121
  257. package/out/geonames/aliases.js.map +1 -1
  258. package/out/geonames/postal.d.ts +84 -50
  259. package/out/geonames/postal.d.ts.map +1 -1
  260. package/out/geonames/postal.js +115 -78
  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 +20 -21
  267. package/out/index.d.ts.map +1 -1
  268. package/out/index.js +14 -15
  269. package/out/index.js.map +1 -1
  270. package/out/interpolation.d.ts +15 -52
  271. package/out/interpolation.d.ts.map +1 -1
  272. package/out/interpolation.js +25 -68
  273. package/out/interpolation.js.map +1 -1
  274. package/out/lookup.d.ts +24 -53
  275. package/out/lookup.d.ts.map +1 -1
  276. package/out/lookup.js +117 -223
  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 +49 -141
  299. package/out/place-importance-schema.d.ts.map +1 -1
  300. package/out/place-importance-schema.js +25 -140
  301. package/out/place-importance-schema.js.map +1 -1
  302. package/out/poi/lookup.d.ts +38 -42
  303. package/out/poi/lookup.d.ts.map +1 -1
  304. package/out/poi/lookup.js +67 -90
  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 → city/alias/lookup.d.ts} +22 -25
  319. package/out/postal/city/alias/lookup.d.ts.map +1 -0
  320. package/out/postal/city/alias/lookup.js +49 -0
  321. package/out/postal/city/alias/lookup.js.map +1 -0
  322. package/out/postal/{city-alias-schema.d.ts → city/alias/schema.d.ts} +15 -11
  323. package/out/postal/city/alias/schema.d.ts.map +1 -0
  324. package/out/postal/{city-alias-schema.js → city/alias/schema.js} +11 -9
  325. package/out/postal/city/alias/schema.js.map +1 -0
  326. package/out/postal/city/candidate-schema.d.ts +72 -0
  327. package/out/postal/city/candidate-schema.d.ts.map +1 -0
  328. package/out/postal/city/candidate-schema.js +60 -0
  329. package/out/postal/city/candidate-schema.js.map +1 -0
  330. package/out/postal.d.ts +9 -0
  331. package/out/postal.d.ts.map +1 -0
  332. package/out/postal.js +9 -0
  333. package/out/postal.js.map +1 -0
  334. package/out/postcode-point-lookup.d.ts +9 -19
  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 +39 -93
  339. package/out/primary-preference.d.ts.map +1 -1
  340. package/out/primary-preference.js +13 -97
  341. package/out/primary-preference.js.map +1 -1
  342. package/out/proximity-rerank.d.ts +40 -29
  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 +91 -62
  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 +48 -29
  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 +75 -50
  355. package/out/reverse.d.ts.map +1 -1
  356. package/out/reverse.js +61 -49
  357. package/out/reverse.js.map +1 -1
  358. package/out/schema.d.ts +74 -42
  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 +25 -0
  367. package/out/sqlite/convention-source.d.ts.map +1 -0
  368. package/out/sqlite/convention-source.js +48 -0
  369. package/out/sqlite/convention-source.js.map +1 -0
  370. package/out/sqlite/utils.d.ts +45 -0
  371. package/out/sqlite/utils.d.ts.map +1 -0
  372. package/out/sqlite/utils.js +56 -0
  373. package/out/sqlite/utils.js.map +1 -0
  374. package/out/street/centroid/schema.d.ts +100 -0
  375. package/out/street/centroid/schema.d.ts.map +1 -0
  376. package/out/street/centroid/schema.js +66 -0
  377. package/out/street/centroid/schema.js.map +1 -0
  378. package/out/street/centroid.d.ts +9 -19
  379. package/out/street/centroid.d.ts.map +1 -1
  380. package/out/street/centroid.js +11 -22
  381. package/out/street/centroid.js.map +1 -1
  382. package/out/street/{morphology-fst-builder.d.ts → morphology/fst/builder.d.ts} +21 -11
  383. package/out/street/morphology/fst/builder.d.ts.map +1 -0
  384. package/out/street/{morphology-fst-builder.js → morphology/fst/builder.js} +40 -34
  385. package/out/street/morphology/fst/builder.js.map +1 -0
  386. package/out/street/morphology/fst/loader.d.ts +74 -0
  387. package/out/street/morphology/fst/loader.d.ts.map +1 -0
  388. package/out/street/{morphology-fst-loader.js → morphology/fst/loader.js} +21 -21
  389. package/out/street/morphology/fst/loader.js.map +1 -0
  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 +32 -31
  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 +74 -191
  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.d.ts → street.d.ts} +4 -4
  403. package/out/street.d.ts.map +1 -0
  404. package/out/{street/index.js → street.js} +4 -4
  405. package/out/street.js.map +1 -0
  406. package/out/types.d.ts +69 -138
  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 +20 -56
  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 +132 -141
  431. package/out/weights-overlay-linker.d.ts.map +1 -1
  432. package/out/weights-overlay-linker.js +86 -154
  433. package/out/weights-overlay-linker.js.map +1 -1
  434. package/package.json +94 -599
  435. package/lib/address/point-schema.ts +0 -155
  436. package/lib/build-candidate.ts +0 -632
  437. package/lib/build-slim.ts +0 -408
  438. package/lib/candidate-ancestors-schema.ts +0 -195
  439. package/lib/candidate-fts.ts +0 -46
  440. package/lib/candidate-importance.ts +0 -224
  441. package/lib/candidate-lookup.ts +0 -977
  442. package/lib/candidate-schema.ts +0 -247
  443. package/lib/candidate-scoring.ts +0 -261
  444. package/lib/convention/index.ts +0 -154
  445. package/lib/fts/index.ts +0 -361
  446. package/lib/postal/city-alias-lookup.ts +0 -97
  447. package/lib/postal/index.ts +0 -9
  448. package/lib/sqlite-convention-source.ts +0 -65
  449. package/lib/sqlite-utils.ts +0 -82
  450. package/lib/street/centroid-schema.ts +0 -154
  451. package/out/address/index.d.ts.map +0 -1
  452. package/out/address/index.js.map +0 -1
  453. package/out/address/point-interpolation.d.ts +0 -49
  454. package/out/address/point-interpolation.d.ts.map +0 -1
  455. package/out/address/point-interpolation.js.map +0 -1
  456. package/out/address/point-schema.d.ts +0 -97
  457. package/out/address/point-schema.d.ts.map +0 -1
  458. package/out/address/point-schema.js.map +0 -1
  459. package/out/ancestry/index.d.ts +0 -45
  460. package/out/ancestry/index.d.ts.map +0 -1
  461. package/out/ancestry/index.js +0 -55
  462. package/out/ancestry/index.js.map +0 -1
  463. package/out/build-candidate.d.ts +0 -184
  464. package/out/build-candidate.d.ts.map +0 -1
  465. package/out/build-candidate.js.map +0 -1
  466. package/out/build-slim.d.ts +0 -80
  467. package/out/build-slim.d.ts.map +0 -1
  468. package/out/build-slim.js.map +0 -1
  469. package/out/candidate/ancestors-sidecar.d.ts +0 -32
  470. package/out/candidate/ancestors-sidecar.d.ts.map +0 -1
  471. package/out/candidate/ancestors-sidecar.js.map +0 -1
  472. package/out/candidate-ancestors-schema.d.ts +0 -150
  473. package/out/candidate-ancestors-schema.d.ts.map +0 -1
  474. package/out/candidate-ancestors-schema.js +0 -123
  475. package/out/candidate-ancestors-schema.js.map +0 -1
  476. package/out/candidate-fts.d.ts +0 -37
  477. package/out/candidate-fts.d.ts.map +0 -1
  478. package/out/candidate-fts.js +0 -40
  479. package/out/candidate-fts.js.map +0 -1
  480. package/out/candidate-importance.d.ts +0 -132
  481. package/out/candidate-importance.d.ts.map +0 -1
  482. package/out/candidate-importance.js +0 -169
  483. package/out/candidate-importance.js.map +0 -1
  484. package/out/candidate-lookup.d.ts +0 -76
  485. package/out/candidate-lookup.d.ts.map +0 -1
  486. package/out/candidate-lookup.js +0 -768
  487. package/out/candidate-lookup.js.map +0 -1
  488. package/out/candidate-schema.d.ts +0 -155
  489. package/out/candidate-schema.d.ts.map +0 -1
  490. package/out/candidate-schema.js.map +0 -1
  491. package/out/candidate-scoring.d.ts.map +0 -1
  492. package/out/candidate-scoring.js +0 -196
  493. package/out/candidate-scoring.js.map +0 -1
  494. package/out/convention/index.d.ts +0 -106
  495. package/out/convention/index.d.ts.map +0 -1
  496. package/out/convention/index.js +0 -93
  497. package/out/convention/index.js.map +0 -1
  498. package/out/fst/index.d.ts.map +0 -1
  499. package/out/fst/index.js.map +0 -1
  500. package/out/fts/index.d.ts +0 -184
  501. package/out/fts/index.d.ts.map +0 -1
  502. package/out/fts/index.js +0 -277
  503. package/out/fts/index.js.map +0 -1
  504. package/out/geonames/index.d.ts.map +0 -1
  505. package/out/geonames/index.js.map +0 -1
  506. package/out/nsul/index.d.ts.map +0 -1
  507. package/out/nsul/index.js.map +0 -1
  508. package/out/poi/index.d.ts.map +0 -1
  509. package/out/poi/index.js.map +0 -1
  510. package/out/postal/city-alias-lookup.d.ts.map +0 -1
  511. package/out/postal/city-alias-lookup.js +0 -62
  512. package/out/postal/city-alias-lookup.js.map +0 -1
  513. package/out/postal/city-alias-schema.d.ts.map +0 -1
  514. package/out/postal/city-alias-schema.js.map +0 -1
  515. package/out/postal/city-candidate-schema.d.ts +0 -66
  516. package/out/postal/city-candidate-schema.d.ts.map +0 -1
  517. package/out/postal/city-candidate-schema.js +0 -56
  518. package/out/postal/city-candidate-schema.js.map +0 -1
  519. package/out/postal/index.d.ts +0 -9
  520. package/out/postal/index.d.ts.map +0 -1
  521. package/out/postal/index.js +0 -9
  522. package/out/postal/index.js.map +0 -1
  523. package/out/sqlite-convention-source.d.ts +0 -29
  524. package/out/sqlite-convention-source.d.ts.map +0 -1
  525. package/out/sqlite-convention-source.js +0 -57
  526. package/out/sqlite-convention-source.js.map +0 -1
  527. package/out/sqlite-utils.d.ts +0 -45
  528. package/out/sqlite-utils.d.ts.map +0 -1
  529. package/out/sqlite-utils.js +0 -57
  530. package/out/sqlite-utils.js.map +0 -1
  531. package/out/street/centroid-schema.d.ts +0 -105
  532. package/out/street/centroid-schema.d.ts.map +0 -1
  533. package/out/street/centroid-schema.js +0 -78
  534. package/out/street/centroid-schema.js.map +0 -1
  535. package/out/street/index.d.ts.map +0 -1
  536. package/out/street/index.js.map +0 -1
  537. package/out/street/morphology-fst-builder.d.ts.map +0 -1
  538. package/out/street/morphology-fst-builder.js.map +0 -1
  539. package/out/street/morphology-fst-loader.d.ts +0 -67
  540. package/out/street/morphology-fst-loader.d.ts.map +0 -1
  541. package/out/street/morphology-fst-loader.js.map +0 -1
  542. package/out/uprn/index.d.ts.map +0 -1
  543. package/out/uprn/index.js.map +0 -1
  544. /package/lib/{fst/index.ts → fst.ts} +0 -0
  545. /package/lib/{geonames/index.ts → geonames.ts} +0 -0
  546. /package/lib/{nsul/index.ts → nsul.ts} +0 -0
  547. /package/lib/{poi/index.ts → poi.ts} +0 -0
  548. /package/lib/{uprn/index.ts → uprn.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"existence.d.ts","sourceRoot":"","sources":["../../lib/uprn/existence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAwC,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACvG,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAGzF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAG9C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAAyB,CAAA;AAEzD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,MAAM,CAAmB,CAAA;AAE1E,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,UAAU,CAAA;IAClB;;OAEG;IACH,UAAU,EAAE,mBAAmB,CAAA;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAqBtF"}
1
+ {"version":3,"file":"existence.d.ts","sourceRoot":"","sources":["../../lib/uprn/existence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAwC,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AACrG,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAGzF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAG9C;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,QAAyB,CAAA;AAEzD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,MAAM,CAAmB,CAAA;AAE1E,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,UAAU,CAAA;IAClB;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAqBtF"}
@@ -3,12 +3,12 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  * @file The consult `./lookup.ts`'s docstring instructs: "callers building negative evidence must consult
6
- * `readLayerCoverage`, not this reader alone." A bare `null` from `nearestUPRN` is two different facts — no UPRN here,
7
- * or nobody surveyed here — and this is the only place that separates them. It answers an {@link Exclusion} or `null`,
6
+ * `readLayerCoverage`, not this reader by itself." A bare `null` from `nearestUPRN` is two different facts — no uprn here,
7
+ * or an unsurveyed area — and this is the only place that separates them. It answers an {@link Exclusion} or `null`,
8
8
  * so a caller cannot read an unsurveyed cell as an empty one by accident.
9
9
  *
10
- * `radiusM` is a CALLER'S parameter with no default. There is no radius that is correct for both "which property is
11
- * this coordinate" and "is this street built at all", and picking one here would bury that choice where nobody
10
+ * `radiusM` is a caller'S parameter with no default. There is no radius that is correct for both "which property is
11
+ * this coordinate" and "is this street built at all", and picking one here would bury that choice where reviewers
12
12
  * reviewing an exclusion can see it.
13
13
  */
14
14
  import { readLayerCoverage, readLayerManifest } from "@mailwoman/core/layers";
@@ -16,36 +16,46 @@ import { foldIdentity, requireExclusionBasis } from "@mailwoman/evidence";
16
16
  import { shortCellToParentInt } from "@mailwoman/spatial";
17
17
  import { UPRN_COVERAGE_H3_RESOLUTION, UPRN_H3_RESOLUTION, uprnH3Cell } from "#uprn/schema";
18
18
  /**
19
- * The identity fold, on purpose: this probe keys on a COORDINATE, not a name, so there is no string folding for the
20
- * builder and the probe to disagree about. Passing the same identity as both `probeFold` and `layerFold` records that
21
- * the fold axis is not in play here, rather than silently omitting the check. It is not a stub.
19
+ * The identity fold, on purpose: this probe keys on a coordinate rather than a name,
20
+ * so there is no string folding for the builder and the probe to disagree about.
21
+ *
22
+ * The same identity in both `probeFold` and `layerFold` records that the fold axis
23
+ * is not in play here, rather than silently omitting the check.
24
+ * It is not a stub.
22
25
  */
23
26
  export const UPRN_EXISTENCE_FOLD = foldIdentity((s) => s);
24
27
  /**
25
- * The countries OS Open UPRN covers. Northern Ireland is outside the product, so a `null` there is unknown and must
26
- * never become evidence of absence; the country check is what keeps it out.
28
+ * The countries OS Open uprn covers.
29
+ *
30
+ * Northern Ireland is outside the product, so a `null` there is unknown
31
+ * and must never become evidence of absence.
32
+ * The country check is what keeps it out.
27
33
  */
28
34
  export const UPRN_COVERED_COUNTRIES = new Set(["GB"]);
29
35
  /**
30
- * The coverage cell a coordinate falls in, derived from its stored res-9 cell exactly as the builder derives it — never
31
- * from the centroid, which lands in a different parent for a fraction of cells.
36
+ * The coverage cell a coordinate falls in, derived from its stored res-9 cell exactly
37
+ * as the builder derives it rather than from the centroid.
38
+ *
39
+ * The centroid lands in a different parent for a fraction of cells.
32
40
  */
33
41
  export function uprnCoverageCell(latitude, longitude) {
34
42
  return shortCellToParentInt(uprnH3Cell(latitude, longitude), UPRN_H3_RESOLUTION, UPRN_COVERAGE_H3_RESOLUTION);
35
43
  }
36
44
  /**
37
- * An {@link Exclusion} when no UPRN lies within `radiusM` AND the layer's coverage licenses saying so; `null` on a hit
38
- * (presence is not this probe's business) and on every refusal (unsurveyed cell, `source_present` basis, a country the
39
- * product does not cover). Never throws on a refusal: the caller falls open to the ranking it already had.
45
+ * An {@link Exclusion} when no uprn lies within `radiusM` and the layer's coverage licenses
46
+ * saying so; `null` on a hit (presence is not this probe's business) and on every refusal
47
+ * (unsurveyed cell, `source_present` basis, a country the product does not cover).
48
+ *
49
+ * Never throws on a refusal: the caller falls open to the ranking it already had.
40
50
  */
41
51
  export async function uprnAbsenceAt(input) {
42
52
  const coverageCell = uprnCoverageCell(input.latitude, input.longitude);
43
- const coverage = await readLayerCoverage(input.contractDB, coverageCell);
53
+ const coverage = await readLayerCoverage(input.schemadb, coverageCell);
44
54
  if (!coverage)
45
55
  return null;
46
56
  if (input.lookup.nearestUPRN(input.latitude, input.longitude, input.radiusM))
47
57
  return null;
48
- const manifest = await readLayerManifest(input.contractDB);
58
+ const manifest = await readLayerManifest(input.schemadb);
49
59
  return requireExclusionBasis({
50
60
  layer: manifest.name,
51
61
  source: manifest.source,
@@ -1 +1 @@
1
- {"version":3,"file":"existence.js","sourceRoot":"","sources":["../../lib/uprn/existence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAA4B,MAAM,wBAAwB,CAAA;AACvG,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAkB,MAAM,qBAAqB,CAAA;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAGzD,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE1F;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;AAEzD;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;QAC5B,KAAK,EAAE,QAAQ,CAAC,IAAI;QACpB,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,OAAO,EAAE,QAAQ,CAAC,aAAa;QAC/B,MAAM,EAAE,YAAY;QACpB,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,mBAAmB;QAC9B,SAAS,EAAE,mBAAmB;QAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,SAAS,EAAE,sBAAsB;KACjC,CAAC,CAAA;AACH,CAAC"}
@@ -3,79 +3,49 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Node reader for `uprn.db` — the OS Open UPRN layer (`uprn-schema.ts`). Two probes:
7
- *
8
- * - **`coordinateOf(uprn)`**: rowid B-tree hit on the `uprn` integer PK.
9
- * - **`nearestUPRN(lat, lon, radiusM)`**: bounded nearest-point search over the res-9 `h3_cell`
10
- * index — ring-by-ring `gridDisk` expansion with chunked `IN` probes and haversine ranking.
11
- * Rings stop as soon as geometry proves no unprobed cell could beat the best hit — a distance
12
- * bound, not POILookup's row-count accumulation, so the early exit can never strand a nearer
13
- * point in an unprobed ring.
14
- *
15
- * ## `null` is a claim, scoped by coverage
16
- *
17
- * OS designates Open UPRN complete for GB (every UPRN in AddressBase Premium with geometry), and
18
- * the builder writes `layer_coverage` with basis `designated` for every cell the product touches.
19
- * So a `null` from either probe inside a covered cell is evidence of absence — "no such published
20
- * GB UPRN" / "no UPRN within the radius". Outside coverage (Northern Ireland, the Isle of Man, the
21
- * Channel Islands, open water) it is UNKNOWN, per the meaning-of-zero rule — callers building
22
- * negative evidence must consult `readLayerCoverage`, not this reader alone.
23
- *
24
- * `latLngToCell`/`gridDisk` come from `h3-js`; the 48-bit short-cell packing is
25
- * `@mailwoman/spatial`'s `shortCellToInt` via `uprnFullCell` — never reimplemented here.
6
+ * Node reader for `uprn.db`, where a `null` is evidence of absence only inside published coverage, so callers building negative evidence must consult `readLayerCoverage`.
26
7
  */
8
+ import { type GeoCoordinate } from "@mailwoman/spatial";
27
9
  import { DatabaseClient } from "@mailwoman/sqlite/client";
10
+ import type { PathBuilderLike } from "path-ts";
28
11
  import type { UPRNDatabase } from "#uprn/schema";
29
12
  /**
30
- * Hard ceiling on `radiusM`. Keeps the probe bounded (10 km → ~72 rings ≈ 15.8k cells ≈ 18 `IN` chunks); a caller who
31
- * wants a wider search than "which property is this coordinate" has outgrown this reader and should say so loudly.
13
+ * Hard ceiling on `radiusM` that keeps the probe bounded, since a caller wanting a wider
14
+ * search than "which property is this coordinate" has outgrown this reader.
32
15
  */
33
16
  export declare const UPRN_MAX_NEAREST_RADIUS_M = 10000;
34
- export interface UPRNCoordinate {
35
- latitude: number;
36
- longitude: number;
37
- }
38
17
  export interface UPRNNearestHit {
39
18
  uprn: number;
40
19
  latitude: number;
41
20
  longitude: number;
42
21
  /**
43
- * Haversine distance from the query point, metres.
22
+ * Haversine distance from the query point, meters.
44
23
  */
45
24
  distanceM: number;
46
25
  }
47
26
  export interface UPRNLookupOpts {
48
27
  /**
49
- * Path to a `uprn.db` built by `mailwoman`'s gazetteer pipeline. Opened read-only.
28
+ * Path to a `uprn.db` built by `mailwoman`'s gazetteer pipeline, opened read-only.
50
29
  */
51
- databasePath?: string;
30
+ databasePath?: PathBuilderLike;
52
31
  /**
53
- * Pre-opened handle (tests / shared connections). Mutually exclusive with `databasePath`.
32
+ * Pre-opened handle (tests / shared connections), mutually exclusive with `databasePath`.
54
33
  */
55
34
  database?: DatabaseClient<UPRNDatabase>;
56
35
  }
57
36
  /**
58
- * Node reader over `uprn.db`. `implements Disposable` so callers can `using lookup = new UPRNLookup(...)` — the same
59
- * precedent as {@link POILookup}.
37
+ * Node reader over `uprn.db`, disposable so callers can take it with `using`.
60
38
  */
61
39
  export declare class UPRNLookup implements Disposable {
62
40
  #private;
63
41
  constructor(opts: UPRNLookupOpts);
64
42
  /**
65
- * The WGS84 point OS publishes for `uprn`, or `null` when the layer holds no such UPRN (see the module docstring for
66
- * what that `null` claims).
43
+ * The WGS84 point OS publishes for `uprn`, or `null` when the layer holds no such uprn.
67
44
  */
68
- coordinateOf(uprn: number): UPRNCoordinate | null;
45
+ coordinateOf(uprn: number): GeoCoordinate | null;
69
46
  /**
70
- * The single nearest UPRN within `radiusM` metres of the query point, or `null` when no UPRN lies inside the radius.
71
- *
72
- * Bounded two ways: `radiusM` is capped at {@link UPRN_MAX_NEAREST_RADIUS_M}, and rings expand outward only until no
73
- * unprobed cell could beat the best hit found so far (or the radius, when nothing has been found). The stop rule is
74
- * geometric — a cell at grid distance `g` holds no point nearer than `g` × spacing floor − cell radius, using the
75
- * same conservative constants the reach math uses — so unlike POILookup's row-count accumulation there is no
76
- * early-exit ambiguity: a break can never strand a nearer point in an unprobed ring. This is what keeps a
77
- * capped-radius call over dense ground at milliseconds instead of a full-disk fetch (measured 6.4 s → 13 ms for a 10
78
- * km radius over central London, 41.6M-row layer; an empty-sea miss at the cap runs the full expansion, 74 ms).
47
+ * The single nearest uprn within `radiusM` meters of the query point, or `null`
48
+ * when no uprn lies inside the radius.
79
49
  *
80
50
  * @throws {RangeError} When `radiusM` is not a positive finite number, or exceeds the cap.
81
51
  */
@@ -1 +1 @@
1
- {"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../lib/uprn/lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAGzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAiBhD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAS,CAAA;AAO/C,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;I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AAa,UAAW,YAAW,UAAU;;IAU5C,YAAY,IAAI,EAAE,cAAc,EAa/B;IAED;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAI/C;IAED;;;;;OAKG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAmDvF;IAED,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAEvB;CACD"}
@@ -3,26 +3,7 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Node reader for `uprn.db` — the OS Open UPRN layer (`uprn-schema.ts`). Two probes:
7
- *
8
- * - **`coordinateOf(uprn)`**: rowid B-tree hit on the `uprn` integer PK.
9
- * - **`nearestUPRN(lat, lon, radiusM)`**: bounded nearest-point search over the res-9 `h3_cell`
10
- * index — ring-by-ring `gridDisk` expansion with chunked `IN` probes and haversine ranking.
11
- * Rings stop as soon as geometry proves no unprobed cell could beat the best hit — a distance
12
- * bound, not POILookup's row-count accumulation, so the early exit can never strand a nearer
13
- * point in an unprobed ring.
14
- *
15
- * ## `null` is a claim, scoped by coverage
16
- *
17
- * OS designates Open UPRN complete for GB (every UPRN in AddressBase Premium with geometry), and
18
- * the builder writes `layer_coverage` with basis `designated` for every cell the product touches.
19
- * So a `null` from either probe inside a covered cell is evidence of absence — "no such published
20
- * GB UPRN" / "no UPRN within the radius". Outside coverage (Northern Ireland, the Isle of Man, the
21
- * Channel Islands, open water) it is UNKNOWN, per the meaning-of-zero rule — callers building
22
- * negative evidence must consult `readLayerCoverage`, not this reader alone.
23
- *
24
- * `latLngToCell`/`gridDisk` come from `h3-js`; the 48-bit short-cell packing is
25
- * `@mailwoman/spatial`'s `shortCellToInt` via `uprnFullCell` — never reimplemented here.
6
+ * Node reader for `uprn.db`, where a `null` is evidence of absence only inside published coverage, so callers building negative evidence must consult `readLayerCoverage`.
26
7
  */
27
8
  import { allRows } from "@mailwoman/core/utils";
28
9
  import { haversineKm, shortCellToInt } from "@mailwoman/spatial";
@@ -30,21 +11,18 @@ import { DatabaseClient } from "@mailwoman/sqlite/client";
30
11
  import { gridDisk } from "h3-js";
31
12
  import { uprnFullCell } from "#uprn/schema";
32
13
  /**
33
- * Conservative FLOOR on how much CENTRE distance one unit of res-9 GRID distance buys, metres. Adjacent centres sit √3
34
- * × edge apart (avg edge 174.4 m → ≈302 m); the worst bearing across a ring costs a further ×0.866, and H3's projection
35
- * distortion shrinks edges by well under the slack this leaves (the true worst is ≈217 m per grid step). Dividing a
36
- * radius by this over-counts rings and can never miss a cell; multiplying a grid distance by it under-states reach and
37
- * can never end the ring walk early.
14
+ * Conservative floor, in meters, on the center distance one unit of res-9 grid distance buys,
15
+ * so multiplying a grid distance under-states reach and can never end the ring walk early.
38
16
  */
39
17
  const RES9_CENTER_SPACING_FLOOR_M = 150;
40
18
  /**
41
- * Conservative CEILING on a res-9 cell's centre-to-vertex distance, metres (avg edge 174.4 m; distortion stays well
42
- * under this). A point within `radiusM` of the query sits in a cell whose CENTRE is within `radiusM` + this.
19
+ * Conservative ceiling, in meters, on a res-9 cell's center-to-vertex distance, so a point
20
+ * within `radiusM` of the query sits in a cell whose center is within `radiusM` plus this.
43
21
  */
44
22
  const RES9_CELL_RADIUS_CEILING_M = 300;
45
23
  /**
46
- * Hard ceiling on `radiusM`. Keeps the probe bounded (10 km → ~72 rings ≈ 15.8k cells ≈ 18 `IN` chunks); a caller who
47
- * wants a wider search than "which property is this coordinate" has outgrown this reader and should say so loudly.
24
+ * Hard ceiling on `radiusM` that keeps the probe bounded, since a caller wanting a wider
25
+ * search than "which property is this coordinate" has outgrown this reader.
48
26
  */
49
27
  export const UPRN_MAX_NEAREST_RADIUS_M = 10_000;
50
28
  /**
@@ -52,50 +30,40 @@ export const UPRN_MAX_NEAREST_RADIUS_M = 10_000;
52
30
  */
53
31
  const CELL_PROBE_CHUNK = 900;
54
32
  /**
55
- * Node reader over `uprn.db`. `implements Disposable` so callers can `using lookup = new UPRNLookup(...)` — the same
56
- * precedent as {@link POILookup}.
33
+ * Node reader over `uprn.db`, disposable so callers can take it with `using`.
57
34
  */
58
35
  export class UPRNLookup {
59
36
  #db;
60
37
  /**
61
- * Resources this instance opened. A connection handed in by a caller is NOT in here, so disposal cannot reach it —
62
- * ownership is membership rather than a flag a later branch has to check.
63
- */
64
- #resources = new DisposableStack();
65
- /**
66
- * `uprn` → its point (rowid-alias PK hit).
38
+ * Ownership is membership: a connection handed in by a caller is not in here,
39
+ * so disposal cannot reach it.
67
40
  */
41
+ #resources;
68
42
  #coordinateProbe;
69
43
  constructor(opts) {
44
+ using resources = new DisposableStack();
70
45
  if (opts.database) {
71
46
  this.#db = opts.database;
72
47
  }
73
48
  else if (opts.databasePath) {
74
- this.#db = this.#resources.use(new DatabaseClient(opts.databasePath, { readOnly: true }));
49
+ this.#db = resources.use(new DatabaseClient(opts.databasePath, { readOnly: true }));
75
50
  }
76
51
  else {
77
52
  throw new Error("UPRNLookup needs `databasePath` or `database`");
78
53
  }
79
54
  this.#coordinateProbe = this.#db.prepare("SELECT lat, lon FROM uprn WHERE uprn = ?");
55
+ this.#resources = resources.move();
80
56
  }
81
57
  /**
82
- * The WGS84 point OS publishes for `uprn`, or `null` when the layer holds no such UPRN (see the module docstring for
83
- * what that `null` claims).
58
+ * The WGS84 point OS publishes for `uprn`, or `null` when the layer holds no such uprn.
84
59
  */
85
60
  coordinateOf(uprn) {
86
61
  const row = this.#coordinateProbe.get(uprn);
87
62
  return row ? { latitude: row.lat, longitude: row.lon } : null;
88
63
  }
89
64
  /**
90
- * The single nearest UPRN within `radiusM` metres of the query point, or `null` when no UPRN lies inside the radius.
91
- *
92
- * Bounded two ways: `radiusM` is capped at {@link UPRN_MAX_NEAREST_RADIUS_M}, and rings expand outward only until no
93
- * unprobed cell could beat the best hit found so far (or the radius, when nothing has been found). The stop rule is
94
- * geometric — a cell at grid distance `g` holds no point nearer than `g` × spacing floor − cell radius, using the
95
- * same conservative constants the reach math uses — so unlike POILookup's row-count accumulation there is no
96
- * early-exit ambiguity: a break can never strand a nearer point in an unprobed ring. This is what keeps a
97
- * capped-radius call over dense ground at milliseconds instead of a full-disk fetch (measured 6.4 s → 13 ms for a 10
98
- * km radius over central London, 41.6M-row layer; an empty-sea miss at the cap runs the full expansion, 74 ms).
65
+ * The single nearest uprn within `radiusM` meters of the query point, or `null`
66
+ * when no uprn lies inside the radius.
99
67
  *
100
68
  * @throws {RangeError} When `radiusM` is not a positive finite number, or exceeds the cap.
101
69
  */
@@ -109,16 +77,13 @@ export class UPRNLookup {
109
77
  const origin = uprnFullCell(latitude, longitude);
110
78
  const seenCells = new Set();
111
79
  let best = null;
112
- // `ring` is H3 grid distance; the loop terminates because the break bound is at most radiusM, which the
113
- // RangeError above caps.
80
+ // The loop terminates because the break bound is at most `radiusM`.
81
+ // The RangeError above caps that value.
114
82
  for (let ring = 0;; ring++) {
115
- // A cell at grid distance `ring` holds no point nearer than this. Once it exceeds what could still
116
- // win — the best hit so far, or the radius itself — further rings cannot improve the answer.
83
+ // Once this bound exceeds the best hit so far, or the radius, further rings cannot improve the answer.
117
84
  const closestPossibleM = ring * RES9_CENTER_SPACING_FLOOR_M - RES9_CELL_RADIUS_CEILING_M;
118
85
  if (closestPossibleM > Math.min(radiusM, best?.distanceM ?? radiusM))
119
86
  break;
120
- // gridDisk(origin, ring) returns the WHOLE disk out to `ring`; diffing against what's already been
121
- // probed derives just this ring's new cells (the POILookup pattern).
122
87
  const diskCells = gridDisk(origin, ring);
123
88
  const newCells = [];
124
89
  for (const cell of diskCells) {
@@ -130,7 +95,6 @@ export class UPRNLookup {
130
95
  for (let i = 0; i < newCells.length; i += CELL_PROBE_CHUNK) {
131
96
  const chunk = newCells.slice(i, i + CELL_PROBE_CHUNK);
132
97
  const placeholders = chunk.map(() => "?").join(", ");
133
- // Prepared fresh per chunk arity — a cold, per-call path, same posture as POILookup's batched hydration.
134
98
  const rows = allRows(this.#db.prepare(`SELECT uprn, lat, lon FROM uprn WHERE h3_cell IN (${placeholders})`), ...chunk);
135
99
  for (const row of rows) {
136
100
  const distanceM = haversineKm(latitude, longitude, row.lat, row.lon) * 1000;
@@ -1 +1 @@
1
- {"version":3,"file":"lookup.js","sourceRoot":"","sources":["../../lib/uprn/lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAe,MAAM,oBAAoB,CAAA;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGhC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAG,GAAG,CAAA;AAEvC;;;GAGG;AACH,MAAM,0BAA0B,GAAG,GAAG,CAAA;AAEtC;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAA;AAE/C;;GAEG;AACH,MAAM,gBAAgB,GAAG,GAAG,CAAA;AAkC5B;;;GAGG;AACH,MAAM,OAAO,UAAU;IACtB,GAAG,CAA8B;IACjC;;;OAGG;IACM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAA;IAE3C;;OAEG;IACM,gBAAgB,CAAuC;IAEhE,YAAY,IAAoB;QAC/B,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAA;QACzB,CAAC;aAAM,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YAC9B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,cAAc,CAAe,IAAI,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,I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AAS,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;oBAE3E,IAAI,SAAS,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;wBAC3E,IAAI,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,CAAA;oBAC5E,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;QAED,OAAO,IAAI,CAAA;IACZ,CAAC;IAED,CAAC,MAAM,CAAC,OAAO,CAAC;QACf,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAA;IAClC,CAAC;CACD"}
@@ -3,46 +3,22 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Typed schema for `uprn.db` — the OS Open UPRN spatial layer: every GB Unique Property Reference
7
- * Number with its WGS84 point, so mailwoman results can carry UPRN as an interoperability key
8
- * beside our own `@mailwoman/address-id`. One rowid table keyed `uprn INTEGER PRIMARY KEY` (the
9
- * rowid alias — the optimal shape for an integer-PK point table; `WITHOUT ROWID` buys nothing
10
- * here), plus a secondary res-9 `h3_cell` index for the bounded nearest-point probe.
11
- *
12
- * ## Coordinates are OS's own WGS84 columns
13
- *
14
- * The source CSV publishes BOTH coordinate systems per row — OSGB36 eastings/northings AND WGS84
15
- * `LATITUDE`/`LONGITUDE`. This layer stores OS's own lat/lon verbatim and never reconverts from
16
- * eastings: `@mailwoman/spatial`'s `osgb36ToWGS84` is a 7-parameter Helmert with a measured p95 of
17
- * 4.18 m, and re-deriving what the publisher already computed (with OSTN15, exactly) would replace
18
- * their answer with a strictly worse one.
19
- *
20
- * ## Why `h3_cell` exists at all
21
- *
22
- * The layer contract requires every domain row to be addressable by at least one spine key —
23
- * `writeLayerManifest` throws on a manifest that declares none — and UPRN is its own id space, not
24
- * H3/WOF/address-id/street. The res-9 short cell (`shortCellToInt`, the same packing as poi.db and
25
- * the OSM situs extracts) is the spine that fits a point table, and its index doubles as the
26
- * `nearestUPRN` ring probe.
27
- *
28
- * The DB also embeds the layer-contract tables from `@mailwoman/core/layers`; the builder
29
- * (`packages/mailwoman/lib/gazetteer-pipeline/uprn-layer.ts`) writes the manifest and per-res-6-cell
30
- * coverage.
6
+ * Typed schema for `uprn.db`, storing OS's own WGS84 latitude/longitude verbatim rather than reconverting from the source's eastings.
31
7
  */
32
- import type { LayerContractDatabase } from "@mailwoman/core/layers";
8
+ import type { layerschemadatabase } from "@mailwoman/core/layers";
33
9
  import { type H3Cell } from "@mailwoman/spatial";
34
10
  import type { Kysely } from "kysely";
35
11
  /**
36
- * Resolution the `uprn` table's `h3_cell` column is keyed at — the shared layer-spine resolution (poi.db, the OSM situs
37
- * extracts).
12
+ * Resolution the `uprn` table's `h3_cell` column is keyed at, shared with the other layer spines.
38
13
  */
39
14
  export declare const UPRN_H3_RESOLUTION = 9;
40
15
  /**
41
- * Resolution of the layer's `layer_coverage` cells — coarse, per the contract (matches poi.db).
16
+ * Resolution of the layer's `layer_coverage` cells, coarse per the layer interface
17
+ * and shared with the other spines.
42
18
  */
43
19
  export declare const UPRN_COVERAGE_H3_RESOLUTION = 6;
44
20
  /**
45
- * One UPRN point. `uprn` is the rowid alias, so the primary probe (`coordinateOf`) is a rowid B-tree hit.
21
+ * One uprn point whose `uprn` is a rowid alias, making the primary probe a rowid B-tree hit.
46
22
  */
47
23
  export interface UPRNTable {
48
24
  /**
@@ -50,7 +26,7 @@ export interface UPRNTable {
50
26
  */
51
27
  uprn: number;
52
28
  /**
53
- * WGS84 latitude, as OS published it (never reconverted from eastings — see the module docstring).
29
+ * WGS84 latitude, as OS published it, never reconverted from eastings.
54
30
  */
55
31
  lat: number;
56
32
  /**
@@ -58,36 +34,38 @@ export interface UPRNTable {
58
34
  */
59
35
  lon: number;
60
36
  /**
61
- * 48-bit short H3 cell at {@link UPRN_H3_RESOLUTION} (`uprnH3Cell`) — the layer-contract spine key and the
62
- * `nearestUPRN` probe index.
37
+ * 48-bit short H3 cell at {@link UPRN_H3_RESOLUTION} — the layer-interface spine key
38
+ * and the `nearestUPRN` probe index.
63
39
  */
64
40
  h3_cell: number;
65
41
  }
66
42
  /**
67
- * Build-provenance key/value pairs the fixed `layer_manifest` columns have no room for: quality-drop counts, the header
68
- * as found, the upstream licence text verbatim (the Code-Point provenance discipline).
43
+ * Build-provenance key/value pairs the fixed `layer_manifest` columns have no room for,
44
+ * including the upstream license text verbatim.
69
45
  */
70
46
  export interface UPRNMetaTable {
71
47
  key: string;
72
48
  value: string;
73
49
  }
74
- export interface UPRNDatabase extends LayerContractDatabase {
50
+ export interface UPRNDatabase extends layerschemadatabase {
75
51
  uprn: UPRNTable;
76
52
  uprn_meta: UPRNMetaTable;
77
53
  }
78
54
  /**
79
- * The full res-9 cell for a UPRN point — the ONE derivation both the builder and every consumer share, so a fixture
80
- * built by a test and a row built by the real ingest can never disagree on which cell a coordinate keys to.
55
+ * The full res-9 cell for a UPRN point.
56
+ *
57
+ * This is the one derivation the builder and its consumers share so their cells cannot disagree.
81
58
  */
82
59
  export declare function uprnFullCell(latitude: number, longitude: number): H3Cell;
83
60
  /**
84
- * The `h3_cell` column value for a UPRN point: {@link uprnFullCell} packed to the shared 48-bit short-cell integer.
61
+ * The `h3_cell` column value for a uprn point, packing {@link uprnFullCell} to
62
+ * the shared 48-bit short-cell integer.
85
63
  */
86
64
  export declare function uprnH3Cell(latitude: number, longitude: number): number;
87
65
  export declare function createUPRNTable(db: Kysely<UPRNDatabase>): Promise<void>;
88
66
  export declare function createUPRNMetaTable(db: Kysely<UPRNDatabase>): Promise<void>;
89
67
  /**
90
- * Secondary index for the `nearestUPRN` ring probe. Builders call this AFTER the bulk load (index-after-load).
68
+ * Secondary index for the `nearestUPRN` ring probe, created after the bulk load.
91
69
  */
92
70
  export declare function createUPRNIndexes(db: Kysely<UPRNDatabase>): Promise<void>;
93
71
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../lib/uprn/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AACnE,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAEhE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEpC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAA;AAEnC;;GAEG;AACH,eAAO,MAAM,2BAA2B,IAAI,CAAA;AAE5C;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,YAAa,SAAQ,qBAAqB;IAC1D,IAAI,EAAE,SAAS,CAAA;IACf,SAAS,EAAE,aAAa,CAAA;CACxB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAExE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAsB,eAAe,CAAC,EAAE,EAAE,MAAM,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ7E;AAED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AAE,MAAM,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ7E;AAED,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,MAAM,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAMjF;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/E"}
@@ -3,52 +3,30 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Typed schema for `uprn.db` — the OS Open UPRN spatial layer: every GB Unique Property Reference
7
- * Number with its WGS84 point, so mailwoman results can carry UPRN as an interoperability key
8
- * beside our own `@mailwoman/address-id`. One rowid table keyed `uprn INTEGER PRIMARY KEY` (the
9
- * rowid alias — the optimal shape for an integer-PK point table; `WITHOUT ROWID` buys nothing
10
- * here), plus a secondary res-9 `h3_cell` index for the bounded nearest-point probe.
11
- *
12
- * ## Coordinates are OS's own WGS84 columns
13
- *
14
- * The source CSV publishes BOTH coordinate systems per row — OSGB36 eastings/northings AND WGS84
15
- * `LATITUDE`/`LONGITUDE`. This layer stores OS's own lat/lon verbatim and never reconverts from
16
- * eastings: `@mailwoman/spatial`'s `osgb36ToWGS84` is a 7-parameter Helmert with a measured p95 of
17
- * 4.18 m, and re-deriving what the publisher already computed (with OSTN15, exactly) would replace
18
- * their answer with a strictly worse one.
19
- *
20
- * ## Why `h3_cell` exists at all
21
- *
22
- * The layer contract requires every domain row to be addressable by at least one spine key —
23
- * `writeLayerManifest` throws on a manifest that declares none — and UPRN is its own id space, not
24
- * H3/WOF/address-id/street. The res-9 short cell (`shortCellToInt`, the same packing as poi.db and
25
- * the OSM situs extracts) is the spine that fits a point table, and its index doubles as the
26
- * `nearestUPRN` ring probe.
27
- *
28
- * The DB also embeds the layer-contract tables from `@mailwoman/core/layers`; the builder
29
- * (`packages/mailwoman/lib/gazetteer-pipeline/uprn-layer.ts`) writes the manifest and per-res-6-cell
30
- * coverage.
6
+ * Typed schema for `uprn.db`, storing OS's own WGS84 latitude/longitude verbatim rather than reconverting from the source's eastings.
31
7
  */
32
8
  import { shortCellToInt } from "@mailwoman/spatial";
33
9
  import { latLngToCell } from "h3-js";
34
10
  /**
35
- * Resolution the `uprn` table's `h3_cell` column is keyed at — the shared layer-spine resolution (poi.db, the OSM situs
36
- * extracts).
11
+ * Resolution the `uprn` table's `h3_cell` column is keyed at, shared with the other layer spines.
37
12
  */
38
13
  export const UPRN_H3_RESOLUTION = 9;
39
14
  /**
40
- * Resolution of the layer's `layer_coverage` cells — coarse, per the contract (matches poi.db).
15
+ * Resolution of the layer's `layer_coverage` cells, coarse per the layer interface
16
+ * and shared with the other spines.
41
17
  */
42
18
  export const UPRN_COVERAGE_H3_RESOLUTION = 6;
43
19
  /**
44
- * The full res-9 cell for a UPRN point — the ONE derivation both the builder and every consumer share, so a fixture
45
- * built by a test and a row built by the real ingest can never disagree on which cell a coordinate keys to.
20
+ * The full res-9 cell for a UPRN point.
21
+ *
22
+ * This is the one derivation the builder and its consumers share so their cells cannot disagree.
46
23
  */
47
24
  export function uprnFullCell(latitude, longitude) {
48
25
  return latLngToCell(latitude, longitude, UPRN_H3_RESOLUTION);
49
26
  }
50
27
  /**
51
- * The `h3_cell` column value for a UPRN point: {@link uprnFullCell} packed to the shared 48-bit short-cell integer.
28
+ * The `h3_cell` column value for a uprn point, packing {@link uprnFullCell} to
29
+ * the shared 48-bit short-cell integer.
52
30
  */
53
31
  export function uprnH3Cell(latitude, longitude) {
54
32
  return shortCellToInt(uprnFullCell(latitude, longitude));
@@ -70,7 +48,7 @@ export async function createUPRNMetaTable(db) {
70
48
  .execute();
71
49
  }
72
50
  /**
73
- * Secondary index for the `nearestUPRN` ring probe. Builders call this AFTER the bulk load (index-after-load).
51
+ * Secondary index for the `nearestUPRN` ring probe, created after the bulk load.
74
52
  */
75
53
  export async function createUPRNIndexes(db) {
76
54
  await db.schema.createIndex("uprn_h3_cell").on("uprn").column("h3_cell").execute();
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../lib/uprn/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,EAAE,cAAc,EAAe,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAGpC;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAA;AAuC5C;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB,EAAE,SAAiB;IAC/D,OAAO,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,kBAAkB,CAAW,CAAA;AACvE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,QAAgB,EAAE,SAAiB;IAC7D,OAAO,cAAc,CAAC,YAAY,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAA;AACzD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EAAwB;IAC7D,MAAM,EAAE,CAAC,MAAM;SACb,WAAW,CAAC,MAAM,CAAC;SACnB,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;SACnD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SAC5C,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SAC5C,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACnD,OAAO,E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# sourceMappingURL=uprn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uprn.d.ts","sourceRoot":"","sources":["../lib/uprn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA"}
@@ -6,4 +6,4 @@
6
6
  export * from "#uprn/existence";
7
7
  export * from "#uprn/lookup";
8
8
  export * from "#uprn/schema";
9
- //# sourceMappingURL=index.js.map
9
+ //# sourceMappingURL=uprn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uprn.js","sourceRoot":"","sources":["../lib/uprn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA"}