@mailwoman/corpus 11.1.0 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -14
- package/data/address-source-register.json +618 -13
- package/data/builds/v0.8.19-overlay/OVERLAY_PLAN.json +4778 -0
- package/data/builds/v0.8.19-rebuild/inputs.json +128 -0
- package/data/builds/v0.8.20-overlay/OVERLAY_PLAN.json +3595 -0
- package/data/builds/v0.8.20-rebuild/inputs.json +131 -0
- package/data/builds/v0.8.21-overlay/OVERLAY_PLAN.json +72 -0
- package/data/corpus-source-inputs.json +104 -2
- package/data/holdout/evaluation-groups.v0.8.18.json +90511 -0
- package/data/holdout/evaluation-groups.v0.8.19.json +100537 -0
- package/data/holdout/evaluation-groups.v0.8.20.json +129215 -0
- package/data/holdout/evaluation-groups.v0.8.21.json +173286 -0
- package/data/holdout/probe-text-collisions.v0.8.20.json +1478 -0
- package/data/license-decisions.json +393 -3
- package/data/licenses/PROVENANCE.md +15 -9
- package/data/licenses/au-acnc-cc-by-3.0-au.md +37 -0
- package/data/licenses/es-sanidad-aviso-legal.md +26 -0
- package/data/licenses/it-miur-iodl-2.0.md +41 -0
- package/data/licenses/nz-charities-cc-by-3.0-nz.md +36 -0
- package/data/region-slot-second-level.json +966 -0
- package/data/source-additions.json +126 -6
- package/data/source-resolutions.json +97 -0
- package/data/training-configs/v8.7.0-base-c6-90k-usgs-structures-s42.yaml +801 -0
- package/data/training-configs/v8.7.0-base-c6-90k-usgs-structures-s43.yaml +726 -0
- package/data/training-configs/v8.8.0-base-c6-90k-v0820-county-s42.yaml +944 -0
- package/data/training-configs/v8.9.0-base-c6-90k-v0821-s42.yaml +848 -0
- package/data/training-manifests/v0.8.19-retention-overlay.json +4553 -0
- package/data/training-manifests/v0.8.20-retention-overlay.json +4579 -0
- package/data/training-manifests/v0.8.21-retention-overlay.effective.json +2521 -0
- package/data/training-manifests/v0.8.21-retention-overlay.json +4579 -0
- package/lib/adapters/cordis/adapter.ts +10 -2
- package/lib/adapters/gleif/adapter.ts +23 -5
- package/lib/adapters/osm/adapter.ts +2 -2
- package/lib/adapters/street/repetition.ts +87 -0
- package/lib/adapters/street/unit.ts +14 -0
- package/lib/adapters/wof/admin/json/adapter.ts +34 -21
- package/lib/adapters/wof/admin/json/dual-role.ts +274 -0
- package/lib/adapters/wof/admin/json/explore.ts +4 -4
- package/lib/adapters/wof/admin/json/region-codes.ts +74 -3
- package/lib/adapters/wof/json-rows.ts +36 -21
- package/lib/adapters/wof/postalcode-json/adapter.ts +10 -28
- package/lib/adapters/wof/sample.ts +15 -3
- package/lib/adapters/wof/stored-records.ts +162 -0
- package/lib/adapters.ts +18 -6
- package/lib/au/adapters/acnc-register/adapter.ts +40 -0
- package/lib/au/evaluation/acnc-register.ts +144 -0
- package/lib/build/align/range.ts +9 -0
- package/lib/build/align/totals.ts +23 -0
- package/lib/build/align.ts +74 -4
- package/lib/build/budget.ts +11 -45
- package/lib/build/checkpoint.ts +11 -0
- package/lib/build/component-check.ts +99 -3
- package/lib/build/manifest.ts +4 -0
- package/lib/build/parallel.ts +8 -34
- package/lib/build/region-names.ts +609 -0
- package/lib/build/source-record.ts +7 -0
- package/lib/build/types.ts +20 -0
- package/lib/build/worker.ts +3 -1
- package/lib/build.ts +3 -6
- package/lib/de/recipes/locale.ts +3 -2
- package/lib/env.ts +0 -6
- package/lib/es/adapters/sanidad-centros-ap/adapter.ts +40 -0
- package/lib/es/evaluation/sanidad-centros-ap.ts +164 -0
- package/lib/evaluation/corpus-adapter.ts +153 -0
- package/lib/evaluation/source.ts +209 -0
- package/lib/evaluation/sources.ts +25 -0
- package/lib/fr/adapters/laposte-poincont/adapter.ts +381 -0
- package/lib/fr/recipes/unit-line-guideline.ts +9 -4
- package/lib/fr/structures/laposte.ts +139 -0
- package/lib/fr/tools/fetch/laposte-poincont.ts +234 -0
- package/lib/it/adapters/miur-scuole/adapter.ts +39 -0
- package/lib/it/evaluation/miur-scuole.ts +125 -0
- package/lib/jp/adapters/wof-admin/adapter.ts +4 -4
- package/lib/nc/adapters/opt-nc/adapter.ts +237 -0
- package/lib/nc/structures/opt-nc.ts +101 -0
- package/lib/nc/tools/fetch/opt-nc.ts +249 -0
- package/lib/nz/adapters/charities-register/adapter.ts +40 -0
- package/lib/nz/evaluation/charities-register.ts +149 -0
- package/lib/recipes/bare/postcode.ts +14 -11
- package/lib/recipes/deepseek/batches.ts +8 -8
- package/lib/recipes/po/box/cedex/recipe.ts +12 -1
- package/lib/recipes/po/box/cedex/us.ts +43 -2
- package/lib/recipes/scaffold.ts +1 -1
- package/lib/recipes/sources.ts +16 -0
- package/lib/recipes.ts +2 -0
- package/lib/registers.ts +28 -2
- package/lib/{post-offices → structures}/source.ts +49 -16
- package/lib/structures/sources.ts +26 -0
- package/lib/synthesizers/house-venue.ts +11 -6
- package/lib/synthesizers/tail.ts +27 -3
- package/lib/tools/audit.ts +1 -1
- package/lib/tools/fetch/storage.ts +18 -4
- package/lib/tools/fetch.ts +10 -2
- package/lib/tools/overlay/kryptonite.ts +6 -2
- package/lib/tools/overlay/split/attribute.ts +14 -2
- package/lib/tools/overlay/split/overlay.ts +36 -7
- package/lib/tools/postcode/triples.ts +3 -3
- package/lib/tools/region-slot-census.run.ts +184 -0
- package/lib/training/config/load.ts +19 -0
- package/lib/training/config/schema.ts +6 -0
- package/lib/tw/registers.ts +15 -4
- package/lib/tw/structures/chunghwa-post.ts +191 -0
- package/lib/tw/tools/fetch/chunghwa-post.ts +174 -0
- package/lib/us/adapters/state/ny-notaries/adapter.ts +7 -2
- package/lib/us/adapters/state/tx-notaries/adapter.ts +126 -21
- package/lib/us/adapters/usgov/nad/adapter.ts +111 -31
- package/lib/us/adapters/usgov/nppes/adapter.ts +8 -11
- package/lib/us/adapters/usgov/{usgs-post-offices → usgs-structures}/adapter.ts +65 -35
- package/lib/us/recipes/county.ts +474 -0
- package/lib/us/street-unit.ts +15 -5
- package/lib/us/structures/usgs/layers.ts +171 -0
- package/lib/us/structures/usgs/national-map.ts +95 -0
- package/lib/us/tools/fetch/usgs/gnis.ts +288 -0
- package/lib/us/tools/fetch/usgs/structures.ts +362 -0
- package/lib/utils/align.ts +2 -2
- package/lib/utils/evaluation-groups.ts +172 -0
- package/lib/utils/split.ts +40 -4
- package/lib/utils/tokenize.ts +7 -7
- package/lib/utils/validation-groups.ts +292 -0
- package/lib/utils/wof-json.ts +96 -134
- package/out/adapters/cordis/adapter.d.ts +3 -1
- package/out/adapters/cordis/adapter.d.ts.map +1 -1
- package/out/adapters/cordis/adapter.js +8 -2
- package/out/adapters/cordis/adapter.js.map +1 -1
- package/out/adapters/gleif/adapter.d.ts.map +1 -1
- package/out/adapters/gleif/adapter.js +19 -5
- package/out/adapters/gleif/adapter.js.map +1 -1
- package/out/adapters/osm/adapter.js +2 -2
- package/out/adapters/osm/adapter.js.map +1 -1
- package/out/adapters/street/repetition.d.ts +19 -0
- package/out/adapters/street/repetition.d.ts.map +1 -0
- package/out/adapters/street/repetition.js +71 -0
- package/out/adapters/street/repetition.js.map +1 -0
- package/out/adapters/street/unit.d.ts +10 -0
- package/out/adapters/street/unit.d.ts.map +1 -1
- package/out/adapters/street/unit.js +6 -0
- package/out/adapters/street/unit.js.map +1 -1
- package/out/adapters/wof/admin/json/adapter.d.ts +8 -0
- package/out/adapters/wof/admin/json/adapter.d.ts.map +1 -1
- package/out/adapters/wof/admin/json/adapter.js +26 -22
- package/out/adapters/wof/admin/json/adapter.js.map +1 -1
- package/out/adapters/wof/admin/json/dual-role.d.ts +83 -0
- package/out/adapters/wof/admin/json/dual-role.d.ts.map +1 -0
- package/out/adapters/wof/admin/json/dual-role.js +183 -0
- package/out/adapters/wof/admin/json/dual-role.js.map +1 -0
- package/out/adapters/wof/admin/json/explore.d.ts.map +1 -1
- package/out/adapters/wof/admin/json/explore.js +4 -4
- package/out/adapters/wof/admin/json/explore.js.map +1 -1
- package/out/adapters/wof/admin/json/region-codes.d.ts +16 -0
- package/out/adapters/wof/admin/json/region-codes.d.ts.map +1 -1
- package/out/adapters/wof/admin/json/region-codes.js +62 -3
- package/out/adapters/wof/admin/json/region-codes.js.map +1 -1
- package/out/adapters/wof/json-rows.d.ts +28 -6
- package/out/adapters/wof/json-rows.d.ts.map +1 -1
- package/out/adapters/wof/json-rows.js +9 -15
- package/out/adapters/wof/json-rows.js.map +1 -1
- package/out/adapters/wof/postalcode-json/adapter.d.ts +1 -1
- package/out/adapters/wof/postalcode-json/adapter.d.ts.map +1 -1
- package/out/adapters/wof/postalcode-json/adapter.js +9 -26
- package/out/adapters/wof/postalcode-json/adapter.js.map +1 -1
- package/out/adapters/wof/sample.d.ts +8 -1
- package/out/adapters/wof/sample.d.ts.map +1 -1
- package/out/adapters/wof/sample.js +12 -4
- package/out/adapters/wof/sample.js.map +1 -1
- package/out/adapters/wof/stored-records.d.ts +62 -0
- package/out/adapters/wof/stored-records.d.ts.map +1 -0
- package/out/adapters/wof/stored-records.js +91 -0
- package/out/adapters/wof/stored-records.js.map +1 -0
- package/out/adapters.d.ts +1 -1
- package/out/adapters.d.ts.map +1 -1
- package/out/adapters.js +15 -3
- package/out/adapters.js.map +1 -1
- package/out/au/adapters/acnc-register/adapter.d.ts +9 -0
- package/out/au/adapters/acnc-register/adapter.d.ts.map +1 -0
- package/out/au/adapters/acnc-register/adapter.js +37 -0
- package/out/au/adapters/acnc-register/adapter.js.map +1 -0
- package/out/au/evaluation/acnc-register.d.ts +56 -0
- package/out/au/evaluation/acnc-register.d.ts.map +1 -0
- package/out/au/evaluation/acnc-register.js +84 -0
- package/out/au/evaluation/acnc-register.js.map +1 -0
- package/out/build/align/range.d.ts.map +1 -1
- package/out/build/align/range.js +9 -0
- package/out/build/align/range.js.map +1 -1
- package/out/build/align/totals.d.ts +5 -0
- package/out/build/align/totals.d.ts.map +1 -1
- package/out/build/align/totals.js +15 -0
- package/out/build/align/totals.js.map +1 -1
- package/out/build/align.d.ts +26 -0
- package/out/build/align.d.ts.map +1 -1
- package/out/build/align.js +35 -2
- package/out/build/align.js.map +1 -1
- package/out/build/budget.d.ts +9 -26
- package/out/build/budget.d.ts.map +1 -1
- package/out/build/budget.js +10 -31
- package/out/build/budget.js.map +1 -1
- package/out/build/checkpoint.d.ts +11 -0
- package/out/build/checkpoint.d.ts.map +1 -1
- package/out/build/checkpoint.js.map +1 -1
- package/out/build/component-check.d.ts +55 -1
- package/out/build/component-check.d.ts.map +1 -1
- package/out/build/component-check.js +65 -3
- package/out/build/component-check.js.map +1 -1
- package/out/build/manifest.d.ts.map +1 -1
- package/out/build/manifest.js +4 -0
- package/out/build/manifest.js.map +1 -1
- package/out/build/parallel.d.ts.map +1 -1
- package/out/build/parallel.js +8 -24
- package/out/build/parallel.js.map +1 -1
- package/out/build/region-names.d.ts +120 -0
- package/out/build/region-names.d.ts.map +1 -0
- package/out/build/region-names.js +430 -0
- package/out/build/region-names.js.map +1 -0
- package/out/build/source-record.d.ts.map +1 -1
- package/out/build/source-record.js +4 -0
- package/out/build/source-record.js.map +1 -1
- package/out/build/types.d.ts +20 -0
- package/out/build/types.d.ts.map +1 -1
- package/out/build/worker.js +3 -1
- package/out/build/worker.js.map +1 -1
- package/out/build.d.ts +0 -1
- package/out/build.d.ts.map +1 -1
- package/out/build.js +3 -5
- package/out/build.js.map +1 -1
- package/out/de/recipes/locale.d.ts.map +1 -1
- package/out/de/recipes/locale.js +3 -2
- package/out/de/recipes/locale.js.map +1 -1
- package/out/env.d.ts +0 -2
- package/out/env.d.ts.map +1 -1
- package/out/env.js +0 -5
- package/out/env.js.map +1 -1
- package/out/es/adapters/sanidad-centros-ap/adapter.d.ts +9 -0
- package/out/es/adapters/sanidad-centros-ap/adapter.d.ts.map +1 -0
- package/out/es/adapters/sanidad-centros-ap/adapter.js +36 -0
- package/out/es/adapters/sanidad-centros-ap/adapter.js.map +1 -0
- package/out/es/evaluation/sanidad-centros-ap.d.ts +34 -0
- package/out/es/evaluation/sanidad-centros-ap.d.ts.map +1 -0
- package/out/es/evaluation/sanidad-centros-ap.js +128 -0
- package/out/es/evaluation/sanidad-centros-ap.js.map +1 -0
- package/out/evaluation/corpus-adapter.d.ts +60 -0
- package/out/evaluation/corpus-adapter.d.ts.map +1 -0
- package/out/evaluation/corpus-adapter.js +100 -0
- package/out/evaluation/corpus-adapter.js.map +1 -0
- package/out/evaluation/source.d.ts +134 -0
- package/out/evaluation/source.d.ts.map +1 -0
- package/out/evaluation/source.js +80 -0
- package/out/evaluation/source.js.map +1 -0
- package/out/evaluation/sources.d.ts +6 -0
- package/out/evaluation/sources.d.ts.map +1 -0
- package/out/evaluation/sources.js +22 -0
- package/out/evaluation/sources.js.map +1 -0
- package/out/fr/adapters/laposte-poincont/adapter.d.ts +110 -0
- package/out/fr/adapters/laposte-poincont/adapter.d.ts.map +1 -0
- package/out/fr/adapters/laposte-poincont/adapter.js +315 -0
- package/out/fr/adapters/laposte-poincont/adapter.js.map +1 -0
- package/out/fr/recipes/unit-line-guideline.d.ts.map +1 -1
- package/out/fr/recipes/unit-line-guideline.js +8 -4
- package/out/fr/recipes/unit-line-guideline.js.map +1 -1
- package/out/fr/structures/laposte.d.ts +27 -0
- package/out/fr/structures/laposte.d.ts.map +1 -0
- package/out/fr/structures/laposte.js +96 -0
- package/out/fr/structures/laposte.js.map +1 -0
- package/out/fr/tools/fetch/laposte-poincont.d.ts +95 -0
- package/out/fr/tools/fetch/laposte-poincont.d.ts.map +1 -0
- package/out/fr/tools/fetch/laposte-poincont.js +135 -0
- package/out/fr/tools/fetch/laposte-poincont.js.map +1 -0
- package/out/it/adapters/miur-scuole/adapter.d.ts +9 -0
- package/out/it/adapters/miur-scuole/adapter.d.ts.map +1 -0
- package/out/it/adapters/miur-scuole/adapter.js +35 -0
- package/out/it/adapters/miur-scuole/adapter.js.map +1 -0
- package/out/it/evaluation/miur-scuole.d.ts +53 -0
- package/out/it/evaluation/miur-scuole.d.ts.map +1 -0
- package/out/it/evaluation/miur-scuole.js +68 -0
- package/out/it/evaluation/miur-scuole.js.map +1 -0
- package/out/jp/adapters/wof-admin/adapter.js +4 -4
- package/out/nc/adapters/opt-nc/adapter.d.ts +84 -0
- package/out/nc/adapters/opt-nc/adapter.d.ts.map +1 -0
- package/out/nc/adapters/opt-nc/adapter.js +173 -0
- package/out/nc/adapters/opt-nc/adapter.js.map +1 -0
- package/out/nc/structures/opt-nc.d.ts +12 -0
- package/out/nc/structures/opt-nc.d.ts.map +1 -0
- package/out/nc/structures/opt-nc.js +64 -0
- package/out/nc/structures/opt-nc.js.map +1 -0
- package/out/nc/tools/fetch/opt-nc.d.ts +81 -0
- package/out/nc/tools/fetch/opt-nc.d.ts.map +1 -0
- package/out/nc/tools/fetch/opt-nc.js +162 -0
- package/out/nc/tools/fetch/opt-nc.js.map +1 -0
- package/out/nz/adapters/charities-register/adapter.d.ts +9 -0
- package/out/nz/adapters/charities-register/adapter.d.ts.map +1 -0
- package/out/nz/adapters/charities-register/adapter.js +36 -0
- package/out/nz/adapters/charities-register/adapter.js.map +1 -0
- package/out/nz/evaluation/charities-register.d.ts +60 -0
- package/out/nz/evaluation/charities-register.d.ts.map +1 -0
- package/out/nz/evaluation/charities-register.js +84 -0
- package/out/nz/evaluation/charities-register.js.map +1 -0
- package/out/recipes/bare/postcode.d.ts +2 -1
- package/out/recipes/bare/postcode.d.ts.map +1 -1
- package/out/recipes/bare/postcode.js +14 -11
- package/out/recipes/bare/postcode.js.map +1 -1
- package/out/recipes/deepseek/batches.d.ts +11 -1
- package/out/recipes/deepseek/batches.d.ts.map +1 -1
- package/out/recipes/deepseek/batches.js +8 -7
- package/out/recipes/deepseek/batches.js.map +1 -1
- package/out/recipes/po/box/cedex/recipe.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/recipe.js +12 -1
- package/out/recipes/po/box/cedex/recipe.js.map +1 -1
- package/out/recipes/po/box/cedex/us.d.ts +12 -0
- package/out/recipes/po/box/cedex/us.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/us.js +36 -2
- package/out/recipes/po/box/cedex/us.js.map +1 -1
- package/out/recipes/scaffold.d.ts +1 -1
- package/out/recipes/sources.d.ts.map +1 -1
- package/out/recipes/sources.js +16 -0
- package/out/recipes/sources.js.map +1 -1
- package/out/recipes.d.ts.map +1 -1
- package/out/recipes.js +2 -0
- package/out/recipes.js.map +1 -1
- package/out/registers.d.ts +28 -2
- package/out/registers.d.ts.map +1 -1
- package/out/registers.js +28 -2
- package/out/registers.js.map +1 -1
- package/out/{post-offices → structures}/source.d.ts +34 -16
- package/out/structures/source.d.ts.map +1 -0
- package/out/structures/source.js +39 -0
- package/out/structures/source.js.map +1 -0
- package/out/structures/sources.d.ts +6 -0
- package/out/structures/sources.d.ts.map +1 -0
- package/out/structures/sources.js +23 -0
- package/out/structures/sources.js.map +1 -0
- package/out/synthesizers/house-venue.d.ts.map +1 -1
- package/out/synthesizers/house-venue.js +2 -1
- package/out/synthesizers/house-venue.js.map +1 -1
- package/out/synthesizers/tail.d.ts +15 -1
- package/out/synthesizers/tail.d.ts.map +1 -1
- package/out/synthesizers/tail.js +8 -3
- package/out/synthesizers/tail.js.map +1 -1
- package/out/tools/audit.js +1 -1
- package/out/tools/audit.js.map +1 -1
- package/out/tools/fetch/storage.d.ts +10 -2
- package/out/tools/fetch/storage.d.ts.map +1 -1
- package/out/tools/fetch/storage.js +18 -4
- package/out/tools/fetch/storage.js.map +1 -1
- package/out/tools/fetch.d.ts +10 -2
- package/out/tools/fetch.d.ts.map +1 -1
- package/out/tools/fetch.js +10 -2
- package/out/tools/fetch.js.map +1 -1
- package/out/tools/overlay/kryptonite.d.ts.map +1 -1
- package/out/tools/overlay/kryptonite.js +5 -2
- package/out/tools/overlay/kryptonite.js.map +1 -1
- package/out/tools/overlay/split/attribute.d.ts +7 -1
- package/out/tools/overlay/split/attribute.d.ts.map +1 -1
- package/out/tools/overlay/split/attribute.js +4 -1
- package/out/tools/overlay/split/attribute.js.map +1 -1
- package/out/tools/overlay/split/overlay.d.ts +10 -0
- package/out/tools/overlay/split/overlay.d.ts.map +1 -1
- package/out/tools/overlay/split/overlay.js +17 -4
- package/out/tools/overlay/split/overlay.js.map +1 -1
- package/out/tools/postcode/triples.js +3 -3
- package/out/tools/postcode/triples.js.map +1 -1
- package/out/tools/region-slot-census.run.d.ts +2 -0
- package/out/tools/region-slot-census.run.d.ts.map +1 -0
- package/out/tools/region-slot-census.run.js +134 -0
- package/out/tools/region-slot-census.run.js.map +1 -0
- package/out/training/config/load.d.ts.map +1 -1
- package/out/training/config/load.js +10 -0
- package/out/training/config/load.js.map +1 -1
- package/out/training/config/schema.d.ts +13 -0
- package/out/training/config/schema.d.ts.map +1 -1
- package/out/training/config/schema.js +6 -0
- package/out/training/config/schema.js.map +1 -1
- package/out/tw/registers.d.ts +9 -0
- package/out/tw/registers.d.ts.map +1 -1
- package/out/tw/registers.js +11 -4
- package/out/tw/registers.js.map +1 -1
- package/out/tw/structures/chunghwa-post.d.ts +39 -0
- package/out/tw/structures/chunghwa-post.d.ts.map +1 -0
- package/out/tw/structures/chunghwa-post.js +150 -0
- package/out/tw/structures/chunghwa-post.js.map +1 -0
- package/out/tw/tools/fetch/chunghwa-post.d.ts +55 -0
- package/out/tw/tools/fetch/chunghwa-post.d.ts.map +1 -0
- package/out/tw/tools/fetch/chunghwa-post.js +110 -0
- package/out/tw/tools/fetch/chunghwa-post.js.map +1 -0
- package/out/us/adapters/state/ny-notaries/adapter.d.ts.map +1 -1
- package/out/us/adapters/state/ny-notaries/adapter.js +7 -2
- package/out/us/adapters/state/ny-notaries/adapter.js.map +1 -1
- package/out/us/adapters/state/tx-notaries/adapter.d.ts +42 -0
- package/out/us/adapters/state/tx-notaries/adapter.d.ts.map +1 -1
- package/out/us/adapters/state/tx-notaries/adapter.js +92 -19
- package/out/us/adapters/state/tx-notaries/adapter.js.map +1 -1
- package/out/us/adapters/usgov/nad/adapter.d.ts +35 -2
- package/out/us/adapters/usgov/nad/adapter.d.ts.map +1 -1
- package/out/us/adapters/usgov/nad/adapter.js +90 -27
- package/out/us/adapters/usgov/nad/adapter.js.map +1 -1
- package/out/us/adapters/usgov/nppes/adapter.d.ts.map +1 -1
- package/out/us/adapters/usgov/nppes/adapter.js +8 -11
- package/out/us/adapters/usgov/nppes/adapter.js.map +1 -1
- package/out/us/adapters/usgov/usgs-structures/adapter.d.ts +87 -0
- package/out/us/adapters/usgov/usgs-structures/adapter.d.ts.map +1 -0
- package/out/us/adapters/usgov/{usgs-post-offices → usgs-structures}/adapter.js +36 -27
- package/out/us/adapters/usgov/usgs-structures/adapter.js.map +1 -0
- package/out/us/recipes/county.d.ts +124 -0
- package/out/us/recipes/county.d.ts.map +1 -0
- package/out/us/recipes/county.js +295 -0
- package/out/us/recipes/county.js.map +1 -0
- package/out/us/street-unit.d.ts +10 -3
- package/out/us/street-unit.d.ts.map +1 -1
- package/out/us/street-unit.js +14 -6
- package/out/us/street-unit.js.map +1 -1
- package/out/us/structures/usgs/layers.d.ts +57 -0
- package/out/us/structures/usgs/layers.d.ts.map +1 -0
- package/out/us/structures/usgs/layers.js +121 -0
- package/out/us/structures/usgs/layers.js.map +1 -0
- package/out/us/structures/usgs/national-map.d.ts +14 -0
- package/out/us/structures/usgs/national-map.d.ts.map +1 -0
- package/out/us/{post-offices/usgs-national-map.js → structures/usgs/national-map.js} +16 -14
- package/out/us/structures/usgs/national-map.js.map +1 -0
- package/out/us/tools/fetch/usgs/gnis.d.ts +118 -0
- package/out/us/tools/fetch/usgs/gnis.d.ts.map +1 -0
- package/out/us/tools/fetch/usgs/gnis.js +177 -0
- package/out/us/tools/fetch/usgs/gnis.js.map +1 -0
- package/out/us/tools/fetch/usgs/structures.d.ts +99 -0
- package/out/us/tools/fetch/usgs/structures.d.ts.map +1 -0
- package/out/us/tools/fetch/usgs/structures.js +233 -0
- package/out/us/tools/fetch/usgs/structures.js.map +1 -0
- package/out/utils/align.js.map +1 -1
- package/out/utils/evaluation-groups.d.ts +98 -0
- package/out/utils/evaluation-groups.d.ts.map +1 -0
- package/out/utils/evaluation-groups.js +92 -0
- package/out/utils/evaluation-groups.js.map +1 -0
- package/out/utils/split.d.ts +26 -1
- package/out/utils/split.d.ts.map +1 -1
- package/out/utils/split.js +28 -3
- package/out/utils/split.js.map +1 -1
- package/out/utils/tokenize.d.ts +3 -3
- package/out/utils/tokenize.d.ts.map +1 -1
- package/out/utils/tokenize.js.map +1 -1
- package/out/utils/validation-groups.d.ts +168 -0
- package/out/utils/validation-groups.d.ts.map +1 -0
- package/out/utils/validation-groups.js +135 -0
- package/out/utils/validation-groups.js.map +1 -0
- package/out/utils/wof-json.d.ts +31 -57
- package/out/utils/wof-json.d.ts.map +1 -1
- package/out/utils/wof-json.js +81 -98
- package/out/utils/wof-json.js.map +1 -1
- package/package.json +18 -18
- package/lib/adapters/wof/record-cache.ts +0 -118
- package/lib/build/heap.ts +0 -60
- package/lib/post-offices/sources.ts +0 -18
- package/lib/us/post-offices/usgs-national-map.ts +0 -89
- package/lib/us/tools/fetch/usgs-post-offices.ts +0 -362
- package/out/adapters/wof/record-cache.d.ts +0 -22
- package/out/adapters/wof/record-cache.d.ts.map +0 -1
- package/out/adapters/wof/record-cache.js +0 -89
- package/out/adapters/wof/record-cache.js.map +0 -1
- package/out/build/heap.d.ts +0 -26
- package/out/build/heap.d.ts.map +0 -1
- package/out/build/heap.js +0 -52
- package/out/build/heap.js.map +0 -1
- package/out/post-offices/source.d.ts.map +0 -1
- package/out/post-offices/source.js +0 -21
- package/out/post-offices/source.js.map +0 -1
- package/out/post-offices/sources.d.ts +0 -13
- package/out/post-offices/sources.d.ts.map +0 -1
- package/out/post-offices/sources.js +0 -8
- package/out/post-offices/sources.js.map +0 -1
- package/out/us/adapters/usgov/usgs-post-offices/adapter.d.ts +0 -66
- package/out/us/adapters/usgov/usgs-post-offices/adapter.d.ts.map +0 -1
- package/out/us/adapters/usgov/usgs-post-offices/adapter.js.map +0 -1
- package/out/us/post-offices/usgs-national-map.d.ts +0 -14
- package/out/us/post-offices/usgs-national-map.d.ts.map +0 -1
- package/out/us/post-offices/usgs-national-map.js.map +0 -1
- package/out/us/tools/fetch/usgs-post-offices.d.ts +0 -99
- package/out/us/tools/fetch/usgs-post-offices.d.ts.map +0 -1
- package/out/us/tools/fetch/usgs-post-offices.js +0 -246
- package/out/us/tools/fetch/usgs-post-offices.js.map +0 -1
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { type UnitSplitter } from "#adapters/street/unit";
|
|
2
|
-
import { type CanonicalRow, type CorpusAdapter } from "#types";
|
|
3
|
-
/**
|
|
4
|
-
* Registry id for this adapter, and the source directory its fetcher writes.
|
|
5
|
-
*/
|
|
6
|
-
export declare const USGOV_USGS_POST_OFFICES_ADAPTER_ID = "usgov-usgs-post-offices";
|
|
7
|
-
/**
|
|
8
|
-
* License stamped on each row: a US federal work, public domain under 17 U.S.C. § 105.
|
|
9
|
-
*/
|
|
10
|
-
export declare const USGOV_USGS_POST_OFFICES_DEFAULT_LICENSE = "Public Domain";
|
|
11
|
-
/**
|
|
12
|
-
* The file the fetcher writes and the adapter reads, one GeoJSON feature per line.
|
|
13
|
-
*/
|
|
14
|
-
export declare const USGS_POST_OFFICES_FILENAME = "post-offices.geojsonl";
|
|
15
|
-
/**
|
|
16
|
-
* The properties of one post office as the fetcher writes them.
|
|
17
|
-
*
|
|
18
|
-
* Keys are the service's field names in lower case.
|
|
19
|
-
* A field the service left empty is `null`.
|
|
20
|
-
*/
|
|
21
|
-
export interface USGSPostOfficeProperties {
|
|
22
|
-
permanent_identifier: string | null;
|
|
23
|
-
name: string | null;
|
|
24
|
-
address: string | null;
|
|
25
|
-
city: string | null;
|
|
26
|
-
state: string | null;
|
|
27
|
-
/**
|
|
28
|
-
* A five-digit ZIP Code or ZIP+4 with its leading zeros, or `null` when the published value isn't one.
|
|
29
|
-
*/
|
|
30
|
-
zipcode: string | null;
|
|
31
|
-
/**
|
|
32
|
-
* The value the service published, present only when it differs from `zipcode`.
|
|
33
|
-
*/
|
|
34
|
-
zipcode_published?: string;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* One post office as the fetcher writes it.
|
|
38
|
-
*/
|
|
39
|
-
export interface USGSPostOfficeFeature {
|
|
40
|
-
type: "Feature";
|
|
41
|
-
geometry: {
|
|
42
|
-
type: "Point";
|
|
43
|
-
coordinates: [longitude: number, latitude: number];
|
|
44
|
-
} | null;
|
|
45
|
-
properties: USGSPostOfficeProperties;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* A post office's address as labeled components, or `null` when it lacks a street
|
|
49
|
-
* address, city, recognized state or ZIP Code.
|
|
50
|
-
*
|
|
51
|
-
* `splitUSStreetLine` moves a trailing suite into `unit` when the remainder still reads as a street:
|
|
52
|
-
* by a street-type word, a number, or the street index scoped to the row's city and ZIP Code.
|
|
53
|
-
*/
|
|
54
|
-
export declare function usgsPostOfficeAddress(properties: USGSPostOfficeProperties, units: UnitSplitter): CanonicalRow["components"] | null;
|
|
55
|
-
/**
|
|
56
|
-
* Creates the post-office adapter.
|
|
57
|
-
*
|
|
58
|
-
* A post office with no name or no full address ({@linkcode usgsPostOfficeAddress})
|
|
59
|
-
* yields no row, because the row's purpose is the venue beside a full address.
|
|
60
|
-
*/
|
|
61
|
-
export declare function createUSGovUSGSPostOfficesAdapter(): CorpusAdapter;
|
|
62
|
-
/**
|
|
63
|
-
* The configured adapter instance registered with the corpus builder.
|
|
64
|
-
*/
|
|
65
|
-
export declare const usgovUSGSPostOfficesAdapter: CorpusAdapter;
|
|
66
|
-
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../lib/us/adapters/usgov/usgs-post-offices/adapter.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAG7E,OAAO,EAAoC,KAAK,YAAY,EAAE,KAAK,aAAa,EAAiB,MAAM,QAAQ,CAAA;AAI/G;;GAEG;AACH,eAAO,MAAM,kCAAkC,4BAA4B,CAAA;AAE3E;;GAEG;AACH,eAAO,MAAM,uCAAuC,kBAAkB,CAAA;AAEtE;;GAEG;AACH,eAAO,MAAM,0BAA0B,0BAA0B,CAAA;AAEjE;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACxC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,SAAS,CAAA;IACf,QAAQ,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,CAAA;IACtF,UAAU,EAAE,wBAAwB,CAAA;CACpC;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACpC,UAAU,EAAE,wBAAwB,EACpC,KAAK,EAAE,YAAY,GACjB,YAAY,CAAC,YAAY,CAAC,GAAG,IAAI,CASnC;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,IAAI,aAAa,CAkDjE;AAED;;GAEG;AACH,eAAO,MAAM,2BAA2B,eAAsC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../../lib/us/adapters/usgov/usgs-post-offices/adapter.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;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AAC,CAAA;gBAEhE,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO;oBAAE,SAAQ;gBAEtC,sFAAsF;gBACtF,MAAM,UAAU,GAA+B,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAA;gBAE1E,MAAM,QAAQ,GAAG,gBAAgB,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAA;gBAEzE,IAAI,CAAC,QAAQ;oBAAE,SAAQ;gBAEvB,MAAM;oBACL,GAAG,EAAE,QAAQ,CAAC,GAAG;oBACjB,UAAU,EAAE,QAAQ,CAAC,UAAU;oBAC/B,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE,OAAO;oBACf,MAAM,EAAE,kCAAkC;oBAC1C,SAAS,EAAE,GAAG,kCAAkC,IAAI,EAAE,EAAE;oBACxD,OAAO,EAAE,uCAAuC;iBAChD,CAAA;gBAED,OAAO,EAAE,CAAA;YACV,CAAC;QACF,CAAC;KACD,CAAA;AACF,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,iCAAiC,EAAE,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type UnitSplitter } from "#adapters/street/unit";
|
|
2
|
-
import { type PostOfficeRecord, type PostOfficeSource } from "#post-offices/source";
|
|
3
|
-
import { type USGSPostOfficeFeature } from "#us/adapters/usgov/usgs-post-offices/adapter";
|
|
4
|
-
/**
|
|
5
|
-
* One fetched feature as a post-office record, or `null` when it has no permanent identifier.
|
|
6
|
-
*
|
|
7
|
-
* The address is split as the `usgov-usgs-post-offices` adapter splits it.
|
|
8
|
-
*/
|
|
9
|
-
export declare function usgsPostOfficeRecord(feature: USGSPostOfficeFeature, units: UnitSplitter): PostOfficeRecord | null;
|
|
10
|
-
/**
|
|
11
|
-
* The USGS National Map's post offices.
|
|
12
|
-
*/
|
|
13
|
-
export declare const usgsNationalMapPostOffices: PostOfficeSource;
|
|
14
|
-
//# sourceMappingURL=usgs-national-map.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usgs-national-map.d.ts","sourceRoot":"","sources":["../../../lib/us/post-offices/usgs-national-map.ts"],"names":[],"mappings":"AAeA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAEN,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAErB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAGN,KAAK,qBAAqB,EAE1B,MAAM,8CAA8C,CAAA;AAGrD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,YAAY,GAAG,gBAAgB,GAAG,IAAI,CAajH;AAgBD;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,gBAoBxC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usgs-national-map.js","sourceRoot":"","sources":["../../../lib/us/post-offices/usgs-national-map.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAYlE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,EAAE,kBAAkB,EAAqB,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EACN,oBAAoB,GAIpB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EACN,kCAAkC,EAClC,0BAA0B,EAE1B,qBAAqB,GACrB,MAAM,8CAA8C,CAAA;AAGrD;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA8B,EAAE,KAAmB;IACvF,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAA;IAElD,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAA;IAEpB,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,GA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AAC,QAAQ,EAAE,aAAa,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,oDAAoD,aAAa,WAAW,CAAC,CAAA;QAC1G,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,0BAA0B,CAAC,CAAC,EAAE,CAAA;IACjH,CAAC;CACD,CAAA"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { APIClient } from "@mailwoman/core/api";
|
|
2
|
-
import { type PathBuilderLike } from "path-ts";
|
|
3
|
-
import type { BaseFetchOptions, FetchSummary, SourceManifest } from "#tools/fetch/download";
|
|
4
|
-
import { type USGSPostOfficeFeature, type USGSPostOfficeProperties } from "#us/adapters/usgov/usgs-post-offices/adapter";
|
|
5
|
-
/**
|
|
6
|
-
* The structures MapServer.
|
|
7
|
-
*
|
|
8
|
-
* Its description states the publisher's terms and refresh date.
|
|
9
|
-
*/
|
|
10
|
-
export declare const USGS_STRUCTURES_SERVICE_URL = "https://carto.nationalmap.gov/arcgis/rest/services/structures/MapServer";
|
|
11
|
-
/**
|
|
12
|
-
* The query endpoint of layer 38, `Post Offices`.
|
|
13
|
-
*/
|
|
14
|
-
export declare const USGS_POST_OFFICES_QUERY_URL = "https://carto.nationalmap.gov/arcgis/rest/services/structures/MapServer/38/query";
|
|
15
|
-
/**
|
|
16
|
-
* The National Hydrography and Structures feature code for a post office.
|
|
17
|
-
*/
|
|
18
|
-
export declare const USGS_POST_OFFICE_FCODE = 78006;
|
|
19
|
-
/**
|
|
20
|
-
* The service's `maxRecordCount`: the most features one query returns.
|
|
21
|
-
*/
|
|
22
|
-
export declare const USGS_POST_OFFICES_PAGE_SIZE = 2000;
|
|
23
|
-
/**
|
|
24
|
-
* The service fields the fetcher asks for, in the service's spelling.
|
|
25
|
-
*/
|
|
26
|
-
export declare const USGS_POST_OFFICE_FIELDS: readonly ["PERMANENT_IDENTIFIER", "NAME", "ADDRESS", "CITY", "STATE", "ZIPCODE"];
|
|
27
|
-
/**
|
|
28
|
-
* The file the service description is saved to, beside the features.
|
|
29
|
-
*/
|
|
30
|
-
export declare const USGS_STRUCTURES_SERVICE_FILENAME = "service.json";
|
|
31
|
-
/**
|
|
32
|
-
* What one run recorded.
|
|
33
|
-
*
|
|
34
|
-
* `publisher_version` is the service's `copyrightText`, which states its
|
|
35
|
-
* refresh (`USGS TNM – National Structures Dataset. Data Refreshed October, 2026.`).
|
|
36
|
-
*/
|
|
37
|
-
export interface USGSPostOfficesManifest extends SourceManifest {
|
|
38
|
-
service_url: string;
|
|
39
|
-
where: string;
|
|
40
|
-
feature_count: number;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* The query URL for one request: a count, or one page from `offset`.
|
|
44
|
-
*/
|
|
45
|
-
export declare function postOfficesQueryURL(request: {
|
|
46
|
-
countOnly: true;
|
|
47
|
-
} | {
|
|
48
|
-
offset: number;
|
|
49
|
-
}): string;
|
|
50
|
-
/**
|
|
51
|
-
* The ZIP Code fields for one post office.
|
|
52
|
-
*
|
|
53
|
-
* A known state passes the value through `normalizeZIPCode`, which restores leading zeros a numeric
|
|
54
|
-
* value lost (`725` in Puerto Rico is `00725`) and reads a value that isn't a ZIP Code as `null`.
|
|
55
|
-
* An unknown state keeps the trimmed value.
|
|
56
|
-
*
|
|
57
|
-
* The published value is kept beside the result whenever the two differ.
|
|
58
|
-
*/
|
|
59
|
-
export declare function postOfficeZIPCode(value: unknown, state: string | null): Pick<USGSPostOfficeProperties, "zipcode" | "zipcode_published">;
|
|
60
|
-
/**
|
|
61
|
-
* One service feature in the shape the adapter reads.
|
|
62
|
-
*
|
|
63
|
-
* @throws When the value isn't a GeoJSON feature.
|
|
64
|
-
*/
|
|
65
|
-
export declare function normalizePostOfficeFeature(value: unknown): USGSPostOfficeFeature;
|
|
66
|
-
/**
|
|
67
|
-
* Per-invocation options.
|
|
68
|
-
*/
|
|
69
|
-
export interface DownloadUSGSPostOfficesOptions {
|
|
70
|
-
outputDir: PathBuilderLike;
|
|
71
|
-
signal?: AbortSignal;
|
|
72
|
-
report?: (line: string) => void;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Pages every post office into `<outputDir>/post-offices.geojsonl` and writes the manifest.
|
|
76
|
-
*
|
|
77
|
-
* The features are written to a staging file.
|
|
78
|
-
* It moves into place only once the pull holds the feature count the service stated.
|
|
79
|
-
* A failed run leaves the previous file as it was.
|
|
80
|
-
*
|
|
81
|
-
* @throws When the service answers an error, a page that isn't a FeatureCollection,
|
|
82
|
-
* or a pull whose size differs from its count.
|
|
83
|
-
*/
|
|
84
|
-
export declare function downloadUSGSPostOffices(client: Pick<APIClient, "fetch">, options: DownloadUSGSPostOfficesOptions): Promise<FetchSummary>;
|
|
85
|
-
/**
|
|
86
|
-
* The path `#us/adapters/usgov/usgs-post-offices/adapter` reads, given the root a fetch wrote under.
|
|
87
|
-
*/
|
|
88
|
-
export declare function usgsPostOfficesInputPath(outRoot: BaseFetchOptions["outRoot"]): PathBuilderLike;
|
|
89
|
-
/**
|
|
90
|
-
* Per-invocation options for the registry entry.
|
|
91
|
-
*/
|
|
92
|
-
export interface FetchUSGSPostOfficesOptions extends BaseFetchOptions {
|
|
93
|
-
signal?: AbortSignal;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* The registry entry.
|
|
97
|
-
*/
|
|
98
|
-
export declare function fetchUSGSPostOffices(options: FetchUSGSPostOfficesOptions, report?: (line: string) => void): Promise<FetchSummary>;
|
|
99
|
-
//# sourceMappingURL=usgs-post-offices.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usgs-post-offices.d.ts","sourceRoot":"","sources":["../../../../lib/us/tools/fetch/usgs-post-offices.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAa/C,O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;IAC1B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAED;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC5C,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAChC,OAAO,EAAE,8BAA8B,GACrC,OAAO,CAAC,YAAY,CAAC,CA4EvB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,GAAG,eAAe,CAE9F;AAED;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACpE,MAAM,CAAC,EAAE,WAAW,CAAA;CACpB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,2BAA2B,EACpC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,YAAY,CAAC,CAUvB"}
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
-
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
-
/**
|
|
4
|
-
* Fetches the post offices (feature code 78006) from the USGS National Map structures
|
|
5
|
-
* layer, the source of the `usgov-usgs-post-offices` adapter.
|
|
6
|
-
* US public domain under 17 U.S.C. § 105.
|
|
7
|
-
*
|
|
8
|
-
* The layer is an ArcGIS MapServer layer that answers at most 2,000 features per request.
|
|
9
|
-
* The fetcher asks for the feature count first, pages the query by `resultOffset` in `OBJECTID`
|
|
10
|
-
* order, and refuses a pull whose feature count differs from the count the service stated.
|
|
11
|
-
*
|
|
12
|
-
* Each feature is written as one GeoJSON line with its ZIP Code as a string, leading
|
|
13
|
-
* zeros intact, normalized by `normalizeZIPCode` where the feature's state is known.
|
|
14
|
-
*
|
|
15
|
-
* The service description is saved beside the features as `service.json`, because it holds the
|
|
16
|
-
* publisher's statement about the data ("public domain structures data") and its refresh date.
|
|
17
|
-
*
|
|
18
|
-
* Invoke via `mailwoman corpus fetch usgs-post-offices`.
|
|
19
|
-
*/
|
|
20
|
-
import { isUSStateAbbreviation } from "@mailwoman/codex/us/state";
|
|
21
|
-
import { normalizeZIPCode } from "@mailwoman/codex/us/zipcode";
|
|
22
|
-
import { APIClient } from "@mailwoman/core/api";
|
|
23
|
-
import { ByteFormatter } from "@mailwoman/core/fs/formatters";
|
|
24
|
-
import { statPath } from "@mailwoman/core/fs/readers/stat";
|
|
25
|
-
import { appendLocalTextFile, makeDirectories, movePath, removePathIfPresent, stagingSiblingPath, writeLocalJSONFile, } from "@mailwoman/core/fs/writers";
|
|
26
|
-
import { sha256File } from "@mailwoman/core/hash";
|
|
27
|
-
import { stringifyJSON } from "@mailwoman/core/json";
|
|
28
|
-
import { PathBuilder } from "path-ts";
|
|
29
|
-
import { writeManifest } from "#tools/fetch/download";
|
|
30
|
-
import { USGOV_USGS_POST_OFFICES_ADAPTER_ID, USGS_POST_OFFICES_FILENAME, } from "#us/adapters/usgov/usgs-post-offices/adapter";
|
|
31
|
-
/**
|
|
32
|
-
* The structures MapServer.
|
|
33
|
-
*
|
|
34
|
-
* Its description states the publisher's terms and refresh date.
|
|
35
|
-
*/
|
|
36
|
-
export const USGS_STRUCTURES_SERVICE_URL = "https://carto.nationalmap.gov/arcgis/rest/services/structures/MapServer";
|
|
37
|
-
/**
|
|
38
|
-
* The query endpoint of layer 38, `Post Offices`.
|
|
39
|
-
*/
|
|
40
|
-
export const USGS_POST_OFFICES_QUERY_URL = `${USGS_STRUCTURES_SERVICE_URL}/38/query`;
|
|
41
|
-
/**
|
|
42
|
-
* The National Hydrography and Structures feature code for a post office.
|
|
43
|
-
*/
|
|
44
|
-
export const USGS_POST_OFFICE_FCODE = 78_006;
|
|
45
|
-
/**
|
|
46
|
-
* The service's `maxRecordCount`: the most features one query returns.
|
|
47
|
-
*/
|
|
48
|
-
export const USGS_POST_OFFICES_PAGE_SIZE = 2000;
|
|
49
|
-
/**
|
|
50
|
-
* The service fields the fetcher asks for, in the service's spelling.
|
|
51
|
-
*/
|
|
52
|
-
export const USGS_POST_OFFICE_FIELDS = ["PERMANENT_IDENTIFIER", "NAME", "ADDRESS", "CITY", "STATE", "ZIPCODE"];
|
|
53
|
-
/**
|
|
54
|
-
* The file the service description is saved to, beside the features.
|
|
55
|
-
*/
|
|
56
|
-
export const USGS_STRUCTURES_SERVICE_FILENAME = "service.json";
|
|
57
|
-
const SLUG = USGOV_USGS_POST_OFFICES_ADAPTER_ID;
|
|
58
|
-
const WHERE = `FCODE=${USGS_POST_OFFICE_FCODE}`;
|
|
59
|
-
/**
|
|
60
|
-
* Reads JSON from the service and throws on an ArcGIS error body.
|
|
61
|
-
*/
|
|
62
|
-
async function readServiceJSON(client, url, signal) {
|
|
63
|
-
const { data } = await client.fetch({ url, timeout: 120_000, signal });
|
|
64
|
-
const body = data;
|
|
65
|
-
if (body == null || typeof body !== "object") {
|
|
66
|
-
throw new Error(`${SLUG}: ${url} answered a body that is not JSON: ${String(body).slice(0, 200)}`);
|
|
67
|
-
}
|
|
68
|
-
if (data.error) {
|
|
69
|
-
throw new Error(`${SLUG}: ${url} answered an ArcGIS error ${data.error.code ?? ""}: ${data.error.message ?? ""}`);
|
|
70
|
-
}
|
|
71
|
-
return data;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* The query URL for one request: a count, or one page from `offset`.
|
|
75
|
-
*/
|
|
76
|
-
export function postOfficesQueryURL(request) {
|
|
77
|
-
const params = new URLSearchParams({ where: WHERE });
|
|
78
|
-
if ("countOnly" in request) {
|
|
79
|
-
params.set("returnCountOnly", "true");
|
|
80
|
-
params.set("f", "json");
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
params.set("outFields", USGS_POST_OFFICE_FIELDS.join(","));
|
|
84
|
-
params.set("orderByFields", "OBJECTID");
|
|
85
|
-
params.set("outSR", "4326");
|
|
86
|
-
params.set("resultOffset", String(request.offset));
|
|
87
|
-
params.set("resultRecordCount", String(USGS_POST_OFFICES_PAGE_SIZE));
|
|
88
|
-
params.set("f", "geojson");
|
|
89
|
-
}
|
|
90
|
-
return `${USGS_POST_OFFICES_QUERY_URL}?${params}`;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* A text field as written: trimmed, or `null` when the service left it empty.
|
|
94
|
-
*/
|
|
95
|
-
function textField(value) {
|
|
96
|
-
if (value == null)
|
|
97
|
-
return null;
|
|
98
|
-
const text = String(value).trim();
|
|
99
|
-
return text || null;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* A feature's properties keyed by the lower-cased field name.
|
|
103
|
-
*
|
|
104
|
-
* The service answers GeoJSON with its own field spelling, so a reader looks names up case-insensitively.
|
|
105
|
-
*/
|
|
106
|
-
function lowerCasedProperties(properties) {
|
|
107
|
-
if (properties == null || typeof properties !== "object")
|
|
108
|
-
return {};
|
|
109
|
-
return Object.fromEntries(Object.entries(properties).map(([key, value]) => [key.toLowerCase(), value]));
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* The ZIP Code fields for one post office.
|
|
113
|
-
*
|
|
114
|
-
* A known state passes the value through `normalizeZIPCode`, which restores leading zeros a numeric
|
|
115
|
-
* value lost (`725` in Puerto Rico is `00725`) and reads a value that isn't a ZIP Code as `null`.
|
|
116
|
-
* An unknown state keeps the trimmed value.
|
|
117
|
-
*
|
|
118
|
-
* The published value is kept beside the result whenever the two differ.
|
|
119
|
-
*/
|
|
120
|
-
export function postOfficeZIPCode(value, state) {
|
|
121
|
-
const published = textField(value);
|
|
122
|
-
if (!published)
|
|
123
|
-
return { zipcode: null };
|
|
124
|
-
const zipcode = state && isUSStateAbbreviation(state) ? normalizeZIPCode(published, state) : published;
|
|
125
|
-
return zipcode === published ? { zipcode } : { zipcode, zipcode_published: published };
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* One service feature in the shape the adapter reads.
|
|
129
|
-
*
|
|
130
|
-
* @throws When the value isn't a GeoJSON feature.
|
|
131
|
-
*/
|
|
132
|
-
export function normalizePostOfficeFeature(value) {
|
|
133
|
-
if (value == null || typeof value !== "object" || value.type !== "Feature") {
|
|
134
|
-
throw new Error(`${SLUG}: expected a GeoJSON Feature, got ${String(stringifyJSON(value)).slice(0, 200)}`);
|
|
135
|
-
}
|
|
136
|
-
const feature = value;
|
|
137
|
-
const properties = lowerCasedProperties(feature.properties);
|
|
138
|
-
const state = textField(properties["state"])?.toUpperCase() ?? null;
|
|
139
|
-
const geometry = (feature.geometry ?? {});
|
|
140
|
-
const coordinates = Array.isArray(geometry.coordinates) ? geometry.coordinates.map(Number) : [];
|
|
141
|
-
const point = geometry.type === "Point" &&
|
|
142
|
-
coordinates.length >= 2 &&
|
|
143
|
-
coordinates.every((coordinate) => Number.isFinite(coordinate))
|
|
144
|
-
? { type: "Point", coordinates: [coordinates[0], coordinates[1]] }
|
|
145
|
-
: null;
|
|
146
|
-
return {
|
|
147
|
-
type: "Feature",
|
|
148
|
-
geometry: point,
|
|
149
|
-
properties: {
|
|
150
|
-
permanent_identifier: textField(properties["permanent_identifier"]),
|
|
151
|
-
name: textField(properties["name"]),
|
|
152
|
-
address: textField(properties["address"]),
|
|
153
|
-
city: textField(properties["city"]),
|
|
154
|
-
state,
|
|
155
|
-
...postOfficeZIPCode(properties["zipcode"], state),
|
|
156
|
-
},
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Pages every post office into `<outputDir>/post-offices.geojsonl` and writes the manifest.
|
|
161
|
-
*
|
|
162
|
-
* The features are written to a staging file.
|
|
163
|
-
* It moves into place only once the pull holds the feature count the service stated.
|
|
164
|
-
* A failed run leaves the previous file as it was.
|
|
165
|
-
*
|
|
166
|
-
* @throws When the service answers an error, a page that isn't a FeatureCollection,
|
|
167
|
-
* or a pull whose size differs from its count.
|
|
168
|
-
*/
|
|
169
|
-
export async function downloadUSGSPostOffices(client, options) {
|
|
170
|
-
const { report, signal } = options;
|
|
171
|
-
const destDir = PathBuilder.from(options.outputDir);
|
|
172
|
-
const featuresPath = destDir(USGS_POST_OFFICES_FILENAME);
|
|
173
|
-
report?.(`=== ${SLUG} / ${USGS_POST_OFFICES_FILENAME}`);
|
|
174
|
-
const service = await readServiceJSON(client, `${USGS_STRUCTURES_SERVICE_URL}?f=json`, signal);
|
|
175
|
-
const { count } = await readServiceJSON(client, postOfficesQueryURL({ countOnly: true }), signal);
|
|
176
|
-
if (typeof count !== "number" || !Number.isInteger(count) || count < 0) {
|
|
177
|
-
throw new Error(`${SLUG}: the count query answered no feature count: ${stringifyJSON(count)}`);
|
|
178
|
-
}
|
|
179
|
-
report?.(` ${service.copyrightText ?? "no copyrightText"}; ${count.toLocaleString()} post offices`);
|
|
180
|
-
await makeDirectories(destDir);
|
|
181
|
-
const staging = stagingSiblingPath(featuresPath);
|
|
182
|
-
let written = 0;
|
|
183
|
-
try {
|
|
184
|
-
while (written < count) {
|
|
185
|
-
const url = postOfficesQueryURL({ offset: written });
|
|
186
|
-
const page = await readServiceJSON(client, url, signal);
|
|
187
|
-
if (page.type !== "FeatureCollection" || !Array.isArray(page.features)) {
|
|
188
|
-
throw new Error(`${SLUG}: ${url} answered something other than a FeatureCollection`);
|
|
189
|
-
}
|
|
190
|
-
if (!page.features.length)
|
|
191
|
-
break;
|
|
192
|
-
const lines = page.features.map((feature) => stringifyJSON(normalizePostOfficeFeature(feature)));
|
|
193
|
-
await appendLocalTextFile(`${lines.join("\n")}\n`, staging);
|
|
194
|
-
written += lines.length;
|
|
195
|
-
report?.(` ${written.toLocaleString()} / ${count.toLocaleString()}`);
|
|
196
|
-
}
|
|
197
|
-
if (written !== count) {
|
|
198
|
-
throw new Error(`${SLUG}: the service counted ${count} post offices and the pull returned ${written}`);
|
|
199
|
-
}
|
|
200
|
-
if (!written) {
|
|
201
|
-
// An empty pull writes no staging file, and an empty input is a valid one.
|
|
202
|
-
await appendLocalTextFile("", staging);
|
|
203
|
-
}
|
|
204
|
-
await movePath(staging, featuresPath);
|
|
205
|
-
}
|
|
206
|
-
finally {
|
|
207
|
-
await removePathIfPresent(staging);
|
|
208
|
-
}
|
|
209
|
-
await writeLocalJSONFile(service, destDir(USGS_STRUCTURES_SERVICE_FILENAME));
|
|
210
|
-
const sha256 = await sha256File(featuresPath);
|
|
211
|
-
const { size: bytes } = await statPath(featuresPath);
|
|
212
|
-
const manifest = {
|
|
213
|
-
source_url: USGS_POST_OFFICES_QUERY_URL,
|
|
214
|
-
service_url: USGS_STRUCTURES_SERVICE_URL,
|
|
215
|
-
where: WHERE,
|
|
216
|
-
filename: USGS_POST_OFFICES_FILENAME,
|
|
217
|
-
feature_count: written,
|
|
218
|
-
bytes,
|
|
219
|
-
sha256,
|
|
220
|
-
...(service.copyrightText ? { publisher_version: service.copyrightText } : {}),
|
|
221
|
-
downloaded_at: new Date().toISOString(),
|
|
222
|
-
};
|
|
223
|
-
await writeManifest(destDir("MANIFEST.json"), manifest);
|
|
224
|
-
report?.(` ✓ ${written.toLocaleString()} features, ${ByteFormatter.formatIEC(bytes)} sha256=${sha256}`);
|
|
225
|
-
return { fetched: 1, skipped: 0, failed: 0, failedCodes: [] };
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* The path `#us/adapters/usgov/usgs-post-offices/adapter` reads, given the root a fetch wrote under.
|
|
229
|
-
*/
|
|
230
|
-
export function usgsPostOfficesInputPath(outRoot) {
|
|
231
|
-
return outRoot(SLUG, USGS_POST_OFFICES_FILENAME);
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* The registry entry.
|
|
235
|
-
*/
|
|
236
|
-
export async function fetchUSGSPostOffices(options, report) {
|
|
237
|
-
await using client = new APIClient({ displayName: SLUG, retry: true });
|
|
238
|
-
// Awaited rather than returned: `await using` disposes the client when this scope exits,
|
|
239
|
-
// and a disposed `APIClient` refuses every later request.
|
|
240
|
-
return await downloadUSGSPostOffices(client, {
|
|
241
|
-
outputDir: options.outRoot(SLUG),
|
|
242
|
-
signal: options.signal,
|
|
243
|
-
report,
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
//# sourceMappingURL=usgs-post-offices.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usgs-post-offices.js","sourceRoot":"","sources":["../../../../lib/us/tools/fetch/usgs-post-offices.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAC1D,OAAO,EACN,mBAAmB,EACnB,eAAe,EACf,QAAQ,EACR,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,GAClB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAwB,MAAM,SAAS,CAAA;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EACN,kCAAkC,EAClC,0BAA0B,GAG1B,MAAM,8CAA8C,CAAA;AAErD;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,yEAAyE,CAAA;AAEpH;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,2BAA2B,WAAW,CAAA;AAEpF;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAA;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA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