@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
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
/**
|
|
4
|
+
* Every point layer of the structures MapServer, in layer-id order.
|
|
5
|
+
*/
|
|
6
|
+
export const USGS_STRUCTURE_LAYERS = [
|
|
7
|
+
{ layerID: 37, slug: "cemeteries", name: "Cemeteries", poiCategory: "cemeteries", trains: true },
|
|
8
|
+
{ layerID: 38, slug: "post-offices", name: "Post Offices", poiCategory: "post_office", trains: true },
|
|
9
|
+
{ layerID: 39, slug: "city-town-halls", name: "City/Town Halls", poiCategory: "town_hall", trains: true },
|
|
10
|
+
{ layerID: 40, slug: "courthouses", name: "Courthouses", poiCategory: "courthouse", trains: true },
|
|
11
|
+
{
|
|
12
|
+
layerID: 41,
|
|
13
|
+
slug: "state-capitols",
|
|
14
|
+
name: "State Capitols",
|
|
15
|
+
poiCategory: "local_and_state_government_offices",
|
|
16
|
+
trains: true,
|
|
17
|
+
},
|
|
18
|
+
{ layerID: 42, slug: "state-supreme-courts", name: "State Supreme Courts", poiCategory: "courthouse", trains: true },
|
|
19
|
+
{
|
|
20
|
+
layerID: 43,
|
|
21
|
+
slug: "white-house",
|
|
22
|
+
name: "The White House",
|
|
23
|
+
poiCategory: "federal_government_offices",
|
|
24
|
+
trains: true,
|
|
25
|
+
},
|
|
26
|
+
{ layerID: 44, slug: "us-capitol", name: "U.S. Capitol", poiCategory: "federal_government_offices", trains: true },
|
|
27
|
+
{ layerID: 45, slug: "us-supreme-court", name: "U.S. Supreme Court", poiCategory: "courthouse", trains: true },
|
|
28
|
+
{
|
|
29
|
+
layerID: 46,
|
|
30
|
+
slug: "historic-sites",
|
|
31
|
+
name: "Historic Sites/Points of Interest",
|
|
32
|
+
poiCategory: "landmark_and_historical_building",
|
|
33
|
+
trains: false,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
layerID: 47,
|
|
37
|
+
slug: "national-symbols-monuments",
|
|
38
|
+
name: "National Symbols/Monuments",
|
|
39
|
+
poiCategory: "monument",
|
|
40
|
+
trains: false,
|
|
41
|
+
},
|
|
42
|
+
{ layerID: 49, slug: "hospitals", name: "Hospitals/Medical Centers", poiCategory: "hospital", trains: true },
|
|
43
|
+
{
|
|
44
|
+
layerID: 50,
|
|
45
|
+
slug: "ambulance-services",
|
|
46
|
+
name: "Ambulance Services",
|
|
47
|
+
poiCategory: "ambulance_and_ems_services",
|
|
48
|
+
trains: true,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
layerID: 51,
|
|
52
|
+
slug: "fire-ems-stations",
|
|
53
|
+
name: "Fire Stations/EMS Stations",
|
|
54
|
+
poiCategory: "fire_station",
|
|
55
|
+
trains: true,
|
|
56
|
+
},
|
|
57
|
+
{ layerID: 53, slug: "police-stations", name: "Police Stations", poiCategory: "police_station", trains: true },
|
|
58
|
+
{
|
|
59
|
+
layerID: 54,
|
|
60
|
+
slug: "prisons",
|
|
61
|
+
name: "Prisons/Correctional Facilities",
|
|
62
|
+
poiCategory: "jail_and_prison",
|
|
63
|
+
trains: true,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
layerID: 56,
|
|
67
|
+
slug: "colleges-universities",
|
|
68
|
+
name: "Colleges/Universities",
|
|
69
|
+
poiCategory: "college_university",
|
|
70
|
+
trains: true,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
layerID: 57,
|
|
74
|
+
slug: "technical-trade-schools",
|
|
75
|
+
name: "Technical/Trade Schools",
|
|
76
|
+
poiCategory: "vocational_and_technical_school",
|
|
77
|
+
trains: true,
|
|
78
|
+
},
|
|
79
|
+
{ layerID: 58, slug: "schools", name: "Schools", poiCategory: "school", trains: true },
|
|
80
|
+
{ layerID: 60, slug: "campgrounds", name: "Campgrounds", poiCategory: "campground", trains: false },
|
|
81
|
+
{ layerID: 61, slug: "trailheads", name: "Trailheads", poiCategory: "trail", trains: false },
|
|
82
|
+
{ layerID: 62, slug: "cabins", name: "Cabins", poiCategory: "cabin", trains: false },
|
|
83
|
+
// The publisher files shelters under the campground feature code, 82008.
|
|
84
|
+
{ layerID: 63, slug: "shelters", name: "Shelters", poiCategory: "campground", trains: false },
|
|
85
|
+
{ layerID: 64, slug: "picnic-areas", name: "Picnic Areas", poiCategory: "park", trains: false },
|
|
86
|
+
{
|
|
87
|
+
layerID: 65,
|
|
88
|
+
slug: "headquarters",
|
|
89
|
+
name: "Headquarters",
|
|
90
|
+
poiCategory: "federal_government_offices",
|
|
91
|
+
trains: true,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
layerID: 66,
|
|
95
|
+
slug: "visitor-centers",
|
|
96
|
+
name: "Visitor/Information Centers",
|
|
97
|
+
poiCategory: "visitor_center",
|
|
98
|
+
trains: true,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
layerID: 67,
|
|
102
|
+
slug: "ranger-stations",
|
|
103
|
+
name: "Ranger Stations",
|
|
104
|
+
poiCategory: "federal_government_offices",
|
|
105
|
+
trains: true,
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
const BY_ID = new Map(USGS_STRUCTURE_LAYERS.map((layer) => [layer.layerID, layer]));
|
|
109
|
+
/**
|
|
110
|
+
* The layer with id `layerID`.
|
|
111
|
+
*
|
|
112
|
+
* @throws When the table holds no such layer, so a feature from an unlisted layer
|
|
113
|
+
* is never filed under a guessed category.
|
|
114
|
+
*/
|
|
115
|
+
export function usgsStructureLayer(layerID) {
|
|
116
|
+
const layer = BY_ID.get(layerID);
|
|
117
|
+
if (!layer)
|
|
118
|
+
throw new Error(`the USGS structures layer table holds no layer ${layerID}`);
|
|
119
|
+
return layer;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=layers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layers.js","sourceRoot":"","sources":["../../../../lib/us/structures/usgs/layers.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAiDlE;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAkC;IACnE,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE;IAChG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE;IACrG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE;IACzG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE;IAClG;QACC,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,oCAAoC;QACjD,MAAM,EAAE,IAAI;KACZ;IACD,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,sBAAsB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE;IACpH;QACC,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,4BAA4B;QACzC,MAAM,EAAE,IAAI;KACZ;IACD,EAAE,OAAO,EAAE,EAAE,EA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BAAiB;QACvB,IAAI,EAAE,6BAA6B;QACnC,WAAW,EAAE,gBAAgB;QAC7B,MAAM,EAAE,IAAI;KACZ;IACD;QACC,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,4BAA4B;QACzC,MAAM,EAAE,IAAI;KACZ;CACD,CAAA;AAED,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAA;AAEnF;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IACjD,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAEhC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,kDAAkD,OAAO,EAAE,CAAC,CAAA;IAExF,OAAO,KAAK,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type UnitSplitter } from "#adapters/street/unit";
|
|
2
|
+
import { type StructureRecord, type StructureSource } from "#structures/source";
|
|
3
|
+
import { type USGSStructureFeature } from "#us/adapters/usgov/usgs-structures/adapter";
|
|
4
|
+
/**
|
|
5
|
+
* One fetched feature as a structure record, or `null` when it has no permanent identifier.
|
|
6
|
+
*
|
|
7
|
+
* The address is split as the `usgov-usgs-structures` adapter splits it.
|
|
8
|
+
*/
|
|
9
|
+
export declare function usgsStructureRecord(feature: USGSStructureFeature, units: UnitSplitter): StructureRecord | null;
|
|
10
|
+
/**
|
|
11
|
+
* The USGS National Map's structures.
|
|
12
|
+
*/
|
|
13
|
+
export declare const usgsNationalMapStructures: StructureSource;
|
|
14
|
+
//# sourceMappingURL=national-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"national-map.d.ts","sourceRoot":"","sources":["../../../../lib/us/structures/usgs/national-map.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,eAAe,EAEpB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAGN,KAAK,oBAAoB,EAEzB,MAAM,4CAA4C,CAAA;AAInD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,YAAY,GAAG,eAAe,GAAG,IAAI,CAc9G;AAgBD;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,eAoBvC,CAAA"}
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
3
|
import { JSONSpliterator } from "spliterator";
|
|
4
4
|
import { createUnitSplitter } from "#adapters/street/unit";
|
|
5
|
-
import {
|
|
5
|
+
import { StructureProvenance, } from "#structures/source";
|
|
6
6
|
import { readManifest } from "#tools/fetch/download";
|
|
7
|
-
import {
|
|
7
|
+
import { USGOV_USGS_STRUCTURES_ADAPTER_ID, USGS_STRUCTURES_FILENAME, usgsStructureAddress, } from "#us/adapters/usgov/usgs-structures/adapter";
|
|
8
|
+
import { usgsStructureLayer } from "#us/structures/usgs/layers";
|
|
8
9
|
/**
|
|
9
|
-
* One fetched feature as a
|
|
10
|
+
* One fetched feature as a structure record, or `null` when it has no permanent identifier.
|
|
10
11
|
*
|
|
11
|
-
* The address is split as the `usgov-usgs-
|
|
12
|
+
* The address is split as the `usgov-usgs-structures` adapter splits it.
|
|
12
13
|
*/
|
|
13
|
-
export function
|
|
14
|
+
export function usgsStructureRecord(feature, units) {
|
|
14
15
|
const id = feature.properties.permanent_identifier;
|
|
15
16
|
if (!id)
|
|
16
17
|
return null;
|
|
@@ -18,39 +19,40 @@ export function usgsPostOfficeRecord(feature, units) {
|
|
|
18
19
|
return {
|
|
19
20
|
id,
|
|
20
21
|
name: feature.properties.name,
|
|
22
|
+
category: usgsStructureLayer(feature.properties.layer_id).poiCategory,
|
|
21
23
|
point: typeof latitude === "number" && typeof longitude === "number" ? { latitude, longitude } : null,
|
|
22
|
-
address:
|
|
24
|
+
address: usgsStructureAddress(feature.properties, units),
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
27
|
async function* records(path) {
|
|
26
28
|
const units = await createUnitSplitter();
|
|
27
29
|
for await (const feature of JSONSpliterator.fromAsync(path.toString())) {
|
|
28
|
-
const record =
|
|
30
|
+
const record = usgsStructureRecord(feature, units);
|
|
29
31
|
if (record) {
|
|
30
32
|
yield record;
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
|
-
const FETCH_COMMAND = "mailwoman corpus fetch usgs-
|
|
36
|
+
const FETCH_COMMAND = "mailwoman corpus fetch usgs-structures";
|
|
35
37
|
/**
|
|
36
|
-
* The USGS National Map's
|
|
38
|
+
* The USGS National Map's structures.
|
|
37
39
|
*/
|
|
38
|
-
export const
|
|
40
|
+
export const usgsNationalMapStructures = {
|
|
39
41
|
id: "usgs-national-map",
|
|
40
42
|
country: "US",
|
|
41
43
|
publisher: "U.S. Geological Survey",
|
|
42
44
|
attribution: "U.S. Geological Survey, The National Map",
|
|
43
45
|
license: "LicenseRef-USGov-Public-Domain",
|
|
44
46
|
registerSource: "us-public-administration-3",
|
|
45
|
-
provenance:
|
|
47
|
+
provenance: StructureProvenance.MappingAgency,
|
|
46
48
|
fetchCommand: FETCH_COMMAND,
|
|
47
49
|
async read(sourcesRoot) {
|
|
48
|
-
const directory = sourcesRoot(
|
|
50
|
+
const directory = sourcesRoot(USGOV_USGS_STRUCTURES_ADAPTER_ID);
|
|
49
51
|
const manifest = await readManifest(directory("MANIFEST.json"));
|
|
50
52
|
if (!manifest?.downloaded_at) {
|
|
51
53
|
throw new Error(`${directory} holds no MANIFEST.json with a fetch date. Run \`${FETCH_COMMAND}\` first.`);
|
|
52
54
|
}
|
|
53
|
-
return { vintage: manifest.downloaded_at.slice(0, 10), records: records(directory(
|
|
55
|
+
return { vintage: manifest.downloaded_at.slice(0, 10), records: records(directory(USGS_STRUCTURES_FILENAME)) };
|
|
54
56
|
},
|
|
55
57
|
};
|
|
56
|
-
//# sourceMappingURL=
|
|
58
|
+
//# sourceMappingURL=national-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"national-map.js","sourceRoot":"","sources":["../../../../lib/us/structures/usgs/national-map.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAgBlE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,EAAE,kBAAkB,EAAqB,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EACN,mBAAmB,GAInB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EACN,gCAAgC,EAChC,wBAAwB,EAExB,oBAAoB,GACpB,MAAM,4CAA4C,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAG/D;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAA6B,EAAE,KAAmB;IACrF,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAA;IAElD,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAA;IAEpB,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,QAAQ,EAAE,WAAW,IAAI,EAAE,CAAA;IAEjE,OAAO;QACN,EAAE;QACF,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;QAC7B,QAAQ,EAAE,kBAAkB,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,WAAW;QACrE,KAAK,EAAE,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,E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,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAA;IAC/G,CAAC;CACD,CAAA"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetches the Populated Places layer of the USGS National Map geonames MapServer: the Geographic
|
|
3
|
+
* Names Information System's populated places, one per GNIS id, in every state and territory.
|
|
4
|
+
*
|
|
5
|
+
* A work of the United States Government, public domain under 17 U.S.C. § 105.
|
|
6
|
+
*
|
|
7
|
+
* The layer answers at most 2,000 features per request, and `pageArcGISLayer` pages it by `OBJECTID`.
|
|
8
|
+
* Each place is written as one JSON line: its GNIS id, name, feature class, state, county and point.
|
|
9
|
+
*
|
|
10
|
+
* The layer stores a place's point as a one-point multipoint, and the fetcher writes that point.
|
|
11
|
+
*
|
|
12
|
+
* The service description is saved beside the places as `service.json`.
|
|
13
|
+
* Its `copyrightText` states the publisher's refresh date.
|
|
14
|
+
*
|
|
15
|
+
* Invoke via `mailwoman corpus fetch usgs-gnis`.
|
|
16
|
+
*/
|
|
17
|
+
import { APIClient } from "@mailwoman/core/api";
|
|
18
|
+
import { type PathBuilderLike } from "path-ts";
|
|
19
|
+
import type { BaseFetchOptions, FetchSummary, SourceManifest } from "#tools/fetch/download";
|
|
20
|
+
/**
|
|
21
|
+
* The directory a fetch writes under, below the fetch root.
|
|
22
|
+
*/
|
|
23
|
+
export declare const USGS_GNIS_SLUG = "usgov-usgs-gnis";
|
|
24
|
+
/**
|
|
25
|
+
* The geonames MapServer.
|
|
26
|
+
*/
|
|
27
|
+
export declare const USGS_GNIS_SERVICE_URL = "https://carto.nationalmap.gov/arcgis/rest/services/geonames/MapServer";
|
|
28
|
+
/**
|
|
29
|
+
* The Populated Places layer of {@link USGS_GNIS_SERVICE_URL}.
|
|
30
|
+
*/
|
|
31
|
+
export declare const USGS_GNIS_POPULATED_PLACES_LAYER = 3;
|
|
32
|
+
/**
|
|
33
|
+
* The service's `maxRecordCount`: the most features one query returns.
|
|
34
|
+
*/
|
|
35
|
+
export declare const USGS_GNIS_PAGE_SIZE = 2000;
|
|
36
|
+
/**
|
|
37
|
+
* The layer fields the fetcher asks for, in the service's spelling.
|
|
38
|
+
*/
|
|
39
|
+
export declare const USGS_GNIS_FIELDS: readonly ["OBJECTID", "gaz_id", "gaz_name", "gaz_featureclass", "fcode", "state_alpha", "county_name", "incounty_id", "isunknowncoords"];
|
|
40
|
+
/**
|
|
41
|
+
* The file the places are written to.
|
|
42
|
+
*/
|
|
43
|
+
export declare const USGS_GNIS_PLACES_FILENAME = "populated-places.jsonl";
|
|
44
|
+
/**
|
|
45
|
+
* The file the service description is saved to, beside the places.
|
|
46
|
+
*/
|
|
47
|
+
export declare const USGS_GNIS_SERVICE_FILENAME = "service.json";
|
|
48
|
+
/**
|
|
49
|
+
* One GNIS populated place as the fetch writes it.
|
|
50
|
+
*/
|
|
51
|
+
export interface GNISPopulatedPlace {
|
|
52
|
+
gnisID: number;
|
|
53
|
+
name: string;
|
|
54
|
+
featureClass: string | null;
|
|
55
|
+
fcode: number | null;
|
|
56
|
+
/**
|
|
57
|
+
* The USPS state or territory code.
|
|
58
|
+
*/
|
|
59
|
+
state: string | null;
|
|
60
|
+
county: string | null;
|
|
61
|
+
/**
|
|
62
|
+
* The GNIS id of the county the place lies in.
|
|
63
|
+
*/
|
|
64
|
+
countyGNISID: number | null;
|
|
65
|
+
/**
|
|
66
|
+
* Whether GNIS marks the place's coordinates as unknown.
|
|
67
|
+
*/
|
|
68
|
+
unknownCoordinates: boolean;
|
|
69
|
+
longitude: number | null;
|
|
70
|
+
latitude: number | null;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* What one run recorded.
|
|
74
|
+
*
|
|
75
|
+
* `publisher_version` is the service's `copyrightText`, which states its refresh.
|
|
76
|
+
*/
|
|
77
|
+
export interface USGSGNISManifest extends SourceManifest {
|
|
78
|
+
service_url: string;
|
|
79
|
+
layer_id: number;
|
|
80
|
+
feature_count: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* One service feature as a {@link GNISPopulatedPlace}.
|
|
84
|
+
*
|
|
85
|
+
* @throws When the value isn't a GeoJSON feature, or has no GNIS id or name.
|
|
86
|
+
*/
|
|
87
|
+
export declare function normalizeGNISFeature(value: unknown): GNISPopulatedPlace;
|
|
88
|
+
/**
|
|
89
|
+
* Per-invocation options.
|
|
90
|
+
*/
|
|
91
|
+
export interface DownloadUSGSGNISOptions {
|
|
92
|
+
outputDir: PathBuilderLike;
|
|
93
|
+
signal?: AbortSignal;
|
|
94
|
+
report?: (line: string) => void;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Pages the Populated Places layer into `<outputDir>/populated-places.jsonl` and writes the manifest.
|
|
98
|
+
*
|
|
99
|
+
* The places are written to a staging file.
|
|
100
|
+
* The file moves into place only once the pull holds the feature count the service stated.
|
|
101
|
+
* A failed run leaves the previous file as it was.
|
|
102
|
+
*/
|
|
103
|
+
export declare function downloadUSGSGNIS(client: Pick<APIClient, "fetch">, options: DownloadUSGSGNISOptions): Promise<FetchSummary>;
|
|
104
|
+
/**
|
|
105
|
+
* The path a fetch under `outRoot` writes the places to.
|
|
106
|
+
*/
|
|
107
|
+
export declare function usgsGNISPlacesPath(outRoot: BaseFetchOptions["outRoot"]): PathBuilderLike;
|
|
108
|
+
/**
|
|
109
|
+
* Per-invocation options for the registry entry.
|
|
110
|
+
*/
|
|
111
|
+
export interface FetchUSGSGNISOptions extends BaseFetchOptions {
|
|
112
|
+
signal?: AbortSignal;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The registry entry.
|
|
116
|
+
*/
|
|
117
|
+
export declare function fetchUSGSGNIS(options: FetchUSGSGNISOptions, report?: (line: string) => void): Promise<FetchSummary>;
|
|
118
|
+
//# sourceMappingURL=gnis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gnis.d.ts","sourceRoot":"","sources":["../../../../../lib/us/t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BAAiB,SAAQ,cAAc;IACvD,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;CACrB;AAcD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,CA6BvE;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,SAAS,EAAE,eAAe,CAAA;IAC1B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAChC,OAAO,EAAE,uBAAuB,GAC9B,OAAO,CAAC,YAAY,CAAC,CAuEvB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,GAAG,eAAe,CAExF;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC7D,MAAM,CAAC,EAAE,WAAW,CAAA;CACpB;AAED;;GAEG;AACH,wBAAsB,aAAa,CAClC,OAAO,EAAE,oBAAoB,EAC7B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,YAAY,CAAC,CAMvB"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
/**
|
|
4
|
+
* Fetches the Populated Places layer of the USGS National Map geonames MapServer: the Geographic
|
|
5
|
+
* Names Information System's populated places, one per GNIS id, in every state and territory.
|
|
6
|
+
*
|
|
7
|
+
* A work of the United States Government, public domain under 17 U.S.C. § 105.
|
|
8
|
+
*
|
|
9
|
+
* The layer answers at most 2,000 features per request, and `pageArcGISLayer` pages it by `OBJECTID`.
|
|
10
|
+
* Each place is written as one JSON line: its GNIS id, name, feature class, state, county and point.
|
|
11
|
+
*
|
|
12
|
+
* The layer stores a place's point as a one-point multipoint, and the fetcher writes that point.
|
|
13
|
+
*
|
|
14
|
+
* The service description is saved beside the places as `service.json`.
|
|
15
|
+
* Its `copyrightText` states the publisher's refresh date.
|
|
16
|
+
*
|
|
17
|
+
* Invoke via `mailwoman corpus fetch usgs-gnis`.
|
|
18
|
+
*/
|
|
19
|
+
import { APIClient } from "@mailwoman/core/api";
|
|
20
|
+
import { arcGISFields, arcGISInteger, arcGISText, pageArcGISLayer, readArcGISJSON } from "@mailwoman/core/api/arcgis";
|
|
21
|
+
import { ByteFormatter } from "@mailwoman/core/fs/formatters";
|
|
22
|
+
import { statPath } from "@mailwoman/core/fs/readers/stat";
|
|
23
|
+
import { appendLocalTextFile, makeDirectories, movePath, removePathIfPresent, stagingSiblingPath, writeLocalJSONFile, } from "@mailwoman/core/fs/writers";
|
|
24
|
+
import { sha256File } from "@mailwoman/core/hash";
|
|
25
|
+
import { stringifyJSON } from "@mailwoman/core/json";
|
|
26
|
+
import { readPointCoordinates } from "@mailwoman/spatial/geometries/point/coordinates";
|
|
27
|
+
import { PathBuilder } from "path-ts";
|
|
28
|
+
import { writeManifest } from "#tools/fetch/download";
|
|
29
|
+
/**
|
|
30
|
+
* The directory a fetch writes under, below the fetch root.
|
|
31
|
+
*/
|
|
32
|
+
export const USGS_GNIS_SLUG = "usgov-usgs-gnis";
|
|
33
|
+
/**
|
|
34
|
+
* The geonames MapServer.
|
|
35
|
+
*/
|
|
36
|
+
export const USGS_GNIS_SERVICE_URL = "https://carto.nationalmap.gov/arcgis/rest/services/geonames/MapServer";
|
|
37
|
+
/**
|
|
38
|
+
* The Populated Places layer of {@link USGS_GNIS_SERVICE_URL}.
|
|
39
|
+
*/
|
|
40
|
+
export const USGS_GNIS_POPULATED_PLACES_LAYER = 3;
|
|
41
|
+
/**
|
|
42
|
+
* The service's `maxRecordCount`: the most features one query returns.
|
|
43
|
+
*/
|
|
44
|
+
export const USGS_GNIS_PAGE_SIZE = 2000;
|
|
45
|
+
/**
|
|
46
|
+
* The layer fields the fetcher asks for, in the service's spelling.
|
|
47
|
+
*/
|
|
48
|
+
export const USGS_GNIS_FIELDS = [
|
|
49
|
+
"OBJECTID",
|
|
50
|
+
"gaz_id",
|
|
51
|
+
"gaz_name",
|
|
52
|
+
"gaz_featureclass",
|
|
53
|
+
"fcode",
|
|
54
|
+
"state_alpha",
|
|
55
|
+
"county_name",
|
|
56
|
+
"incounty_id",
|
|
57
|
+
"isunknowncoords",
|
|
58
|
+
];
|
|
59
|
+
/**
|
|
60
|
+
* The file the places are written to.
|
|
61
|
+
*/
|
|
62
|
+
export const USGS_GNIS_PLACES_FILENAME = "populated-places.jsonl";
|
|
63
|
+
/**
|
|
64
|
+
* The file the service description is saved to, beside the places.
|
|
65
|
+
*/
|
|
66
|
+
export const USGS_GNIS_SERVICE_FILENAME = "service.json";
|
|
67
|
+
/**
|
|
68
|
+
* The point of a GeoJSON Point, or the first point of a MultiPoint, or `null` when it has none.
|
|
69
|
+
*
|
|
70
|
+
* `readPointCoordinates` refuses an out-of-range value and the `(0, 0)` placeholder.
|
|
71
|
+
*/
|
|
72
|
+
function firstPoint(geometry) {
|
|
73
|
+
const { type, coordinates } = (geometry ?? {});
|
|
74
|
+
const point = readPointCoordinates(type === "MultiPoint" && Array.isArray(coordinates) ? coordinates[0] : geometry);
|
|
75
|
+
return point ? [point[0], point[1]] : null;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* One service feature as a {@link GNISPopulatedPlace}.
|
|
79
|
+
*
|
|
80
|
+
* @throws When the value isn't a GeoJSON feature, or has no GNIS id or name.
|
|
81
|
+
*/
|
|
82
|
+
export function normalizeGNISFeature(value) {
|
|
83
|
+
if (value == null || typeof value !== "object" || value.type !== "Feature") {
|
|
84
|
+
throw new Error(`${USGS_GNIS_SLUG}: expected a GeoJSON Feature, got ${String(stringifyJSON(value)).slice(0, 200)}`);
|
|
85
|
+
}
|
|
86
|
+
const feature = value;
|
|
87
|
+
const properties = arcGISFields(feature.properties);
|
|
88
|
+
const gnisID = arcGISInteger(properties["gaz_id"]);
|
|
89
|
+
const name = arcGISText(properties["gaz_name"]);
|
|
90
|
+
if (gnisID === null || !name) {
|
|
91
|
+
throw new Error(`${USGS_GNIS_SLUG}: a feature has no GNIS id or name: ${String(stringifyJSON(properties))}`);
|
|
92
|
+
}
|
|
93
|
+
const point = firstPoint(feature.geometry);
|
|
94
|
+
return {
|
|
95
|
+
gnisID,
|
|
96
|
+
name,
|
|
97
|
+
featureClass: arcGISText(properties["gaz_featureclass"]),
|
|
98
|
+
fcode: arcGISInteger(properties["fcode"]),
|
|
99
|
+
state: arcGISText(properties["state_alpha"])?.toUpperCase() ?? null,
|
|
100
|
+
county: arcGISText(properties["county_name"]),
|
|
101
|
+
countyGNISID: arcGISInteger(properties["incounty_id"]),
|
|
102
|
+
unknownCoordinates: arcGISInteger(properties["isunknowncoords"]) === 1,
|
|
103
|
+
longitude: point?.[0] ?? null,
|
|
104
|
+
latitude: point?.[1] ?? null,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Pages the Populated Places layer into `<outputDir>/populated-places.jsonl` and writes the manifest.
|
|
109
|
+
*
|
|
110
|
+
* The places are written to a staging file.
|
|
111
|
+
* The file moves into place only once the pull holds the feature count the service stated.
|
|
112
|
+
* A failed run leaves the previous file as it was.
|
|
113
|
+
*/
|
|
114
|
+
export async function downloadUSGSGNIS(client, options) {
|
|
115
|
+
const { report, signal } = options;
|
|
116
|
+
const destDir = PathBuilder.from(options.outputDir);
|
|
117
|
+
const placesPath = destDir(USGS_GNIS_PLACES_FILENAME);
|
|
118
|
+
report?.(`=== ${USGS_GNIS_SLUG} / ${USGS_GNIS_PLACES_FILENAME}`);
|
|
119
|
+
const service = await readArcGISJSON(client, `${USGS_GNIS_SERVICE_URL}?f=json`, USGS_GNIS_SLUG, signal);
|
|
120
|
+
report?.(` ${service.copyrightText ?? "no copyrightText"}`);
|
|
121
|
+
await makeDirectories(destDir);
|
|
122
|
+
const staging = stagingSiblingPath(placesPath);
|
|
123
|
+
let written = 0;
|
|
124
|
+
try {
|
|
125
|
+
await appendLocalTextFile("", staging);
|
|
126
|
+
const pages = pageArcGISLayer(client, { serviceURL: USGS_GNIS_SERVICE_URL, layerID: USGS_GNIS_POPULATED_PLACES_LAYER }, {
|
|
127
|
+
outFields: USGS_GNIS_FIELDS,
|
|
128
|
+
pageSize: USGS_GNIS_PAGE_SIZE,
|
|
129
|
+
context: USGS_GNIS_SLUG,
|
|
130
|
+
signal,
|
|
131
|
+
onCount: (count) => report?.(` Populated Places: ${count.toLocaleString()} features`),
|
|
132
|
+
onPage: (done, count) => report?.(` ${done.toLocaleString()} / ${count.toLocaleString()}`),
|
|
133
|
+
});
|
|
134
|
+
for await (const page of pages) {
|
|
135
|
+
const places = page.map(normalizeGNISFeature);
|
|
136
|
+
await appendLocalTextFile(`${places.map((place) => stringifyJSON(place)).join("\n")}\n`, staging);
|
|
137
|
+
written += places.length;
|
|
138
|
+
}
|
|
139
|
+
await movePath(staging, placesPath);
|
|
140
|
+
}
|
|
141
|
+
finally {
|
|
142
|
+
await removePathIfPresent(staging);
|
|
143
|
+
}
|
|
144
|
+
await writeLocalJSONFile(service, destDir(USGS_GNIS_SERVICE_FILENAME));
|
|
145
|
+
const sha256 = await sha256File(placesPath);
|
|
146
|
+
const { size: bytes } = await statPath(placesPath);
|
|
147
|
+
const manifest = {
|
|
148
|
+
source_url: USGS_GNIS_SERVICE_URL,
|
|
149
|
+
service_url: USGS_GNIS_SERVICE_URL,
|
|
150
|
+
layer_id: USGS_GNIS_POPULATED_PLACES_LAYER,
|
|
151
|
+
filename: USGS_GNIS_PLACES_FILENAME,
|
|
152
|
+
feature_count: written,
|
|
153
|
+
bytes,
|
|
154
|
+
sha256,
|
|
155
|
+
...(service.copyrightText ? { publisher_version: service.copyrightText } : {}),
|
|
156
|
+
downloaded_at: new Date().toISOString(),
|
|
157
|
+
};
|
|
158
|
+
await writeManifest(destDir("MANIFEST.json"), manifest);
|
|
159
|
+
report?.(` ✓ ${written.toLocaleString()} places, ${ByteFormatter.formatIEC(bytes)} sha256=${sha256}`);
|
|
160
|
+
return { fetched: 1, skipped: 0, failed: 0, failedCodes: [] };
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* The path a fetch under `outRoot` writes the places to.
|
|
164
|
+
*/
|
|
165
|
+
export function usgsGNISPlacesPath(outRoot) {
|
|
166
|
+
return outRoot(USGS_GNIS_SLUG, USGS_GNIS_PLACES_FILENAME);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* The registry entry.
|
|
170
|
+
*/
|
|
171
|
+
export async function fetchUSGSGNIS(options, report) {
|
|
172
|
+
// One request at a time with a pause between them: a full pull is about 100 requests to a public service.
|
|
173
|
+
await using client = new APIClient({ displayName: USGS_GNIS_SLUG, retry: true, minRequestIntervalMs: 500 });
|
|
174
|
+
// Awaited rather than returned, because `await using` disposes the client when this scope exits.
|
|
175
|
+
return await downloadUSGSGNIS(client, { outputDir: options.outRoot(USGS_GNIS_SLUG), signal: options.signal, report });
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=gnis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gnis.js","sourceRoot":"","sources":["../../../../../lib/us/tools/fetch/usgs/gnis.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AACrH,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;A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ts";
|
|
3
|
+
import type { BaseFetchOptions, FetchSummary, SourceManifest } from "#tools/fetch/download";
|
|
4
|
+
import { type USGSStructureFeature, type USGSStructureProperties } from "#us/adapters/usgov/usgs-structures/adapter";
|
|
5
|
+
import { type USGSStructureLayer } from "#us/structures/usgs/layers";
|
|
6
|
+
/**
|
|
7
|
+
* The structures MapServer.
|
|
8
|
+
*
|
|
9
|
+
* Its description states the publisher's terms and refresh date.
|
|
10
|
+
*/
|
|
11
|
+
export declare const USGS_STRUCTURES_SERVICE_URL = "https://carto.nationalmap.gov/arcgis/rest/services/structures/MapServer";
|
|
12
|
+
/**
|
|
13
|
+
* The service's `maxRecordCount`: the most features one query returns.
|
|
14
|
+
*/
|
|
15
|
+
export declare const USGS_STRUCTURES_PAGE_SIZE = 2000;
|
|
16
|
+
/**
|
|
17
|
+
* The service fields the fetcher asks for, in the service's spelling.
|
|
18
|
+
*/
|
|
19
|
+
export declare const USGS_STRUCTURE_FIELDS: readonly ["OBJECTID", "PERMANENT_IDENTIFIER", "FCODE", "GNIS_ID", "NAME", "ADDRESSBUILDINGNAME", "ADDRESS", "CITY", "STATE", "ZIPCODE", "LOADDATE", "SOURCE_ORIGINATOR"];
|
|
20
|
+
/**
|
|
21
|
+
* The file the service description is saved to, beside the features.
|
|
22
|
+
*/
|
|
23
|
+
export declare const USGS_STRUCTURES_SERVICE_FILENAME = "service.json";
|
|
24
|
+
/**
|
|
25
|
+
* What one layer contributed to a run.
|
|
26
|
+
*/
|
|
27
|
+
export interface USGSStructuresLayerCount {
|
|
28
|
+
layer_id: number;
|
|
29
|
+
layer: string;
|
|
30
|
+
name: string;
|
|
31
|
+
feature_count: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* What one run recorded.
|
|
35
|
+
*
|
|
36
|
+
* `publisher_version` is the service's `copyrightText`, which states its
|
|
37
|
+
* refresh (`USGS TNM – National Structures Dataset. Data Refreshed October, 2026.`).
|
|
38
|
+
*/
|
|
39
|
+
export interface USGSStructuresManifest extends SourceManifest {
|
|
40
|
+
service_url: string;
|
|
41
|
+
feature_count: number;
|
|
42
|
+
layers: USGSStructuresLayerCount[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The ZIP Code fields for one structure.
|
|
46
|
+
*
|
|
47
|
+
* A known state passes the value through `normalizeZIPCode`, which restores leading zeros a numeric
|
|
48
|
+
* value lost (`725` in Puerto Rico is `00725`) and reads a value that isn't a ZIP Code as `null`.
|
|
49
|
+
* An unknown state keeps the trimmed value.
|
|
50
|
+
*
|
|
51
|
+
* The published value is kept beside the result whenever the two differ.
|
|
52
|
+
*/
|
|
53
|
+
export declare function structureZIPCode(value: unknown, state: string | null): Pick<USGSStructureProperties, "zipcode" | "zipcode_published">;
|
|
54
|
+
/**
|
|
55
|
+
* One service feature of `layer` in the shape the adapter reads.
|
|
56
|
+
*
|
|
57
|
+
* @throws When the value isn't a GeoJSON feature, or has no `OBJECTID`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function normalizeStructureFeature(value: unknown, layer: Pick<USGSStructureLayer, "layerID" | "slug">): USGSStructureFeature;
|
|
60
|
+
/**
|
|
61
|
+
* Per-invocation options.
|
|
62
|
+
*/
|
|
63
|
+
export interface DownloadUSGSStructuresOptions {
|
|
64
|
+
outputDir: PathBuilderLike;
|
|
65
|
+
/**
|
|
66
|
+
* The layers to pull.
|
|
67
|
+
*
|
|
68
|
+
* @defaultValue {@linkcode USGS_STRUCTURE_LAYERS}
|
|
69
|
+
*/
|
|
70
|
+
layers?: readonly USGSStructureLayer[];
|
|
71
|
+
signal?: AbortSignal;
|
|
72
|
+
report?: (line: string) => void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Pages every layer into `<outputDir>/structures.geojsonl` and writes the manifest.
|
|
76
|
+
*
|
|
77
|
+
* The features are written to a staging file.
|
|
78
|
+
* It moves into place only once every layer's 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 layer pull whose size differs from its count.
|
|
83
|
+
*/
|
|
84
|
+
export declare function downloadUSGSStructures(client: Pick<APIClient, "fetch">, options: DownloadUSGSStructuresOptions): Promise<FetchSummary>;
|
|
85
|
+
/**
|
|
86
|
+
* The path `#us/adapters/usgov/usgs-structures/adapter` reads, given the root a fetch wrote under.
|
|
87
|
+
*/
|
|
88
|
+
export declare function usgsStructuresInputPath(outRoot: BaseFetchOptions["outRoot"]): PathBuilderLike;
|
|
89
|
+
/**
|
|
90
|
+
* Per-invocation options for the registry entry.
|
|
91
|
+
*/
|
|
92
|
+
export interface FetchUSGSStructuresOptions extends BaseFetchOptions {
|
|
93
|
+
signal?: AbortSignal;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The registry entry.
|
|
97
|
+
*/
|
|
98
|
+
export declare function fetchUSGSStructures(options: FetchUSGSStructuresOptions, report?: (line: string) => void): Promise<FetchSummary>;
|
|
99
|
+
//# sourceMappingURL=structures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structures.d.ts","sourceRoot":"","sources":["../../../../../lib/us/tools/fetch/usgs/structures.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAe/C,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE3F,OAAO,EAGN,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,MAAM,4CAA4C,CAAA;AACnD,OAAO,EAAyB,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAE3F;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,4EAA4E,CAAA;AAEpH;;GAEG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAA;AAE7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