@mailwoman/corpus 10.5.0 → 10.7.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/data/PROVENANCE.md +24 -0
- package/data/address-source-register.json +18948 -8757
- package/data/corpus-source-inputs.json +4756 -0
- package/data/license-decisions.json +7260 -0
- package/data/licenses/whosonfirst-licenses.md +3 -2
- package/data/reviewed-ve-postcode-tuples.json +5 -72
- package/data/source-additions.json +2450 -0
- package/data/source-resolutions.json +87 -0
- package/data/training-manifests/v0.7.10-gb-county.effective.json +2335 -0
- package/data/training-manifests/v0.7.10-gb-county.json +1132 -0
- package/data/training-manifests/v0.7.2-address-systems.effective.json +3 -2
- package/data/training-manifests/v0.7.7-no-ppd.json +550 -0
- package/data/training-manifests/v0.7.8-rights-clean.json +538 -0
- package/data/training-manifests/v0.7.9-country-gap.json +1132 -0
- package/data/us-situs-sources.json +128 -0
- package/lib/adapters/cordis/adapter.ts +1 -1
- package/lib/adapters/libpostal-dictionary.ts +23 -3
- package/lib/adapters/osm/adapter.ts +42 -11
- package/lib/adapters.ts +14 -0
- package/lib/az/adapters/opendata/adapter.ts +389 -0
- package/lib/bs/adapters/gbpa/adapter.ts +248 -0
- package/lib/build/types.ts +16 -0
- package/lib/build.ts +21 -0
- package/lib/ee/adapters/ads/adapter.ts +18 -0
- package/lib/fo/adapters/adressur/adapter.ts +242 -0
- package/lib/gb/adapters/os-open/adapter.ts +14 -2
- package/lib/gb/county.ts +59 -0
- package/lib/gb/os-open/{open-names.ts → open/names.ts} +41 -0
- package/lib/gu/adapters/bsp/adapter.ts +434 -0
- package/lib/im/adapters/land-registry/adapter.ts +340 -0
- package/lib/international/recipes/locale.ts +164 -19
- package/lib/li/adapters/llv/adapter.ts +246 -0
- package/lib/recipes/bare/postcode.ts +10 -34
- package/lib/recipes/country-balanced.ts +95 -78
- package/lib/recipes/intersection.ts +22 -30
- package/lib/recipes/po/box/cedex/recipe.ts +8 -5
- package/lib/recipes/po/box/cedex/sources.ts +2 -23
- package/lib/recipes/scaffold.ts +28 -3
- package/lib/recipes/sources.ts +112 -1
- package/lib/recipes/street/affix.ts +17 -29
- package/lib/recipes/sub/venue/context.ts +33 -9
- package/lib/recipes/sub/venue/sources.ts +54 -13
- package/lib/recipes/sub/venue.ts +68 -23
- package/lib/recipes/unit.ts +20 -7
- package/lib/registers.ts +33 -0
- package/lib/source-register/corpus-inputs.ts +528 -0
- package/lib/source-register/effective-manifest.ts +37 -5
- package/lib/source-register/types.ts +20 -0
- package/lib/south-asia/recipes/register.ts +1 -1
- package/lib/tools/overlay/manifest.ts +109 -1
- package/lib/tools/source-register/build.ts +47 -1
- package/lib/tools/variety-sample.ts +633 -0
- package/lib/us/adapters/usgov/nad/adapter.ts +39 -10
- package/lib/us/recipes/skeleton-sources.ts +156 -0
- package/lib/us/tools/nad-skeletons.ts +395 -0
- package/lib/uy/adapters/ide/adapter.ts +275 -0
- package/lib/ve/recipes/reviewed-postcode-tail.ts +29 -6
- package/out/adapters/cordis/adapter.d.ts +1 -1
- package/out/adapters/cordis/adapter.js +1 -1
- package/out/adapters/libpostal-dictionary.d.ts +9 -0
- package/out/adapters/libpostal-dictionary.d.ts.map +1 -1
- package/out/adapters/libpostal-dictionary.js +19 -3
- package/out/adapters/libpostal-dictionary.js.map +1 -1
- package/out/adapters/osm/adapter.d.ts +12 -1
- package/out/adapters/osm/adapter.d.ts.map +1 -1
- package/out/adapters/osm/adapter.js +30 -13
- package/out/adapters/osm/adapter.js.map +1 -1
- package/out/adapters.d.ts.map +1 -1
- package/out/adapters.js +14 -0
- package/out/adapters.js.map +1 -1
- package/out/az/adapters/opendata/adapter.d.ts +88 -0
- package/out/az/adapters/opendata/adapter.d.ts.map +1 -0
- package/out/az/adapters/opendata/adapter.js +282 -0
- package/out/az/adapters/opendata/adapter.js.map +1 -0
- package/out/bs/adapters/gbpa/adapter.d.ts +64 -0
- package/out/bs/adapters/gbpa/adapter.d.ts.map +1 -0
- package/out/bs/adapters/gbpa/adapter.js +187 -0
- package/out/bs/adapters/gbpa/adapter.js.map +1 -0
- package/out/build/types.d.ts +15 -0
- package/out/build/types.d.ts.map +1 -1
- package/out/build/types.js.map +1 -1
- package/out/build.d.ts.map +1 -1
- package/out/build.js +17 -0
- package/out/build.js.map +1 -1
- package/out/ee/adapters/ads/adapter.d.ts +6 -0
- package/out/ee/adapters/ads/adapter.d.ts.map +1 -1
- package/out/ee/adapters/ads/adapter.js +16 -0
- package/out/ee/adapters/ads/adapter.js.map +1 -1
- package/out/fo/adapters/adressur/adapter.d.ts +63 -0
- package/out/fo/adapters/adressur/adapter.d.ts.map +1 -0
- package/out/fo/adapters/adressur/adapter.js +177 -0
- package/out/fo/adapters/adressur/adapter.js.map +1 -0
- package/out/gb/adapters/os-open/adapter.d.ts +10 -2
- package/out/gb/adapters/os-open/adapter.d.ts.map +1 -1
- package/out/gb/adapters/os-open/adapter.js +13 -2
- package/out/gb/adapters/os-open/adapter.js.map +1 -1
- package/out/gb/county.d.ts +30 -0
- package/out/gb/county.d.ts.map +1 -0
- package/out/gb/county.js +51 -0
- package/out/gb/county.js.map +1 -0
- package/out/gb/os-open/{open-names.d.ts → open/names.d.ts} +18 -1
- package/out/gb/os-open/open/names.d.ts.map +1 -0
- package/out/gb/os-open/{open-names.js → open/names.js} +20 -1
- package/out/gb/os-open/open/names.js.map +1 -0
- package/out/gb/os-open/{open-roads.d.ts → open/roads.d.ts} +1 -1
- package/out/gb/os-open/open/roads.d.ts.map +1 -0
- package/out/gb/os-open/{open-roads.js → open/roads.js} +1 -1
- package/out/gb/os-open/open/roads.js.map +1 -0
- package/out/gu/adapters/bsp/adapter.d.ts +83 -0
- package/out/gu/adapters/bsp/adapter.d.ts.map +1 -0
- package/out/gu/adapters/bsp/adapter.js +346 -0
- package/out/gu/adapters/bsp/adapter.js.map +1 -0
- package/out/im/adapters/land-registry/adapter.d.ts +68 -0
- package/out/im/adapters/land-registry/adapter.d.ts.map +1 -0
- package/out/im/adapters/land-registry/adapter.js +261 -0
- package/out/im/adapters/land-registry/adapter.js.map +1 -0
- package/out/international/recipes/locale.d.ts +24 -4
- package/out/international/recipes/locale.d.ts.map +1 -1
- package/out/international/recipes/locale.js +107 -15
- package/out/international/recipes/locale.js.map +1 -1
- package/out/li/adapters/llv/adapter.d.ts +69 -0
- package/out/li/adapters/llv/adapter.d.ts.map +1 -0
- package/out/li/adapters/llv/adapter.js +181 -0
- package/out/li/adapters/llv/adapter.js.map +1 -0
- package/out/recipes/bare/postcode.d.ts.map +1 -1
- package/out/recipes/bare/postcode.js +9 -30
- package/out/recipes/bare/postcode.js.map +1 -1
- package/out/recipes/country-balanced.d.ts.map +1 -1
- package/out/recipes/country-balanced.js +82 -73
- package/out/recipes/country-balanced.js.map +1 -1
- package/out/recipes/intersection.d.ts +3 -2
- package/out/recipes/intersection.d.ts.map +1 -1
- package/out/recipes/intersection.js +20 -26
- package/out/recipes/intersection.js.map +1 -1
- package/out/recipes/po/box/cedex/recipe.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/recipe.js +5 -4
- package/out/recipes/po/box/cedex/recipe.js.map +1 -1
- package/out/recipes/po/box/cedex/sources.d.ts +2 -45
- package/out/recipes/po/box/cedex/sources.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/sources.js +0 -20
- package/out/recipes/po/box/cedex/sources.js.map +1 -1
- package/out/recipes/scaffold.d.ts +15 -2
- package/out/recipes/scaffold.d.ts.map +1 -1
- package/out/recipes/scaffold.js +21 -1
- package/out/recipes/scaffold.js.map +1 -1
- package/out/recipes/sources.d.ts.map +1 -1
- package/out/recipes/sources.js +112 -1
- package/out/recipes/sources.js.map +1 -1
- package/out/recipes/street/affix.d.ts.map +1 -1
- package/out/recipes/street/affix.js +8 -20
- package/out/recipes/street/affix.js.map +1 -1
- package/out/recipes/sub/venue/context.d.ts +14 -3
- package/out/recipes/sub/venue/context.d.ts.map +1 -1
- package/out/recipes/sub/venue/context.js +29 -9
- package/out/recipes/sub/venue/context.js.map +1 -1
- package/out/recipes/sub/venue/sources.d.ts +41 -8
- package/out/recipes/sub/venue/sources.d.ts.map +1 -1
- package/out/recipes/sub/venue/sources.js +26 -7
- package/out/recipes/sub/venue/sources.js.map +1 -1
- package/out/recipes/sub/venue.d.ts.map +1 -1
- package/out/recipes/sub/venue.js +35 -14
- package/out/recipes/sub/venue.js.map +1 -1
- package/out/recipes/unit.d.ts +4 -0
- package/out/recipes/unit.d.ts.map +1 -1
- package/out/recipes/unit.js +7 -6
- package/out/recipes/unit.js.map +1 -1
- package/out/registers.d.ts +33 -0
- package/out/registers.d.ts.map +1 -1
- package/out/registers.js +33 -0
- package/out/registers.js.map +1 -1
- package/out/source-register/corpus-inputs.d.ts +240 -0
- package/out/source-register/corpus-inputs.d.ts.map +1 -0
- package/out/source-register/corpus-inputs.js +275 -0
- package/out/source-register/corpus-inputs.js.map +1 -0
- package/out/source-register/effective-manifest.d.ts +2 -0
- package/out/source-register/effective-manifest.d.ts.map +1 -1
- package/out/source-register/effective-manifest.js +33 -4
- package/out/source-register/effective-manifest.js.map +1 -1
- package/out/source-register/types.d.ts +21 -1
- package/out/source-register/types.d.ts.map +1 -1
- package/out/source-register/types.js +20 -0
- package/out/source-register/types.js.map +1 -1
- package/out/south-asia/recipes/register.js +1 -1
- package/out/south-asia/recipes/register.js.map +1 -1
- package/out/tools/overlay/manifest.d.ts +7 -0
- package/out/tools/overlay/manifest.d.ts.map +1 -1
- package/out/tools/overlay/manifest.js +72 -1
- package/out/tools/overlay/manifest.js.map +1 -1
- package/out/tools/source-register/build.d.ts +9 -0
- package/out/tools/source-register/build.d.ts.map +1 -1
- package/out/tools/source-register/build.js +25 -3
- package/out/tools/source-register/build.js.map +1 -1
- package/out/tools/variety-sample.d.ts +196 -0
- package/out/tools/variety-sample.d.ts.map +1 -0
- package/out/tools/variety-sample.js +417 -0
- package/out/tools/variety-sample.js.map +1 -0
- package/out/us/adapters/usgov/nad/adapter.d.ts +80 -0
- package/out/us/adapters/usgov/nad/adapter.d.ts.map +1 -1
- package/out/us/adapters/usgov/nad/adapter.js +27 -8
- package/out/us/adapters/usgov/nad/adapter.js.map +1 -1
- package/out/us/recipes/skeleton-sources.d.ts +92 -0
- package/out/us/recipes/skeleton-sources.d.ts.map +1 -0
- package/out/us/recipes/skeleton-sources.js +121 -0
- package/out/us/recipes/skeleton-sources.js.map +1 -0
- package/out/us/tools/nad-skeletons.d.ts +120 -0
- package/out/us/tools/nad-skeletons.d.ts.map +1 -0
- package/out/us/tools/nad-skeletons.js +262 -0
- package/out/us/tools/nad-skeletons.js.map +1 -0
- package/out/uy/adapters/ide/adapter.d.ts +64 -0
- package/out/uy/adapters/ide/adapter.d.ts.map +1 -0
- package/out/uy/adapters/ide/adapter.js +206 -0
- package/out/uy/adapters/ide/adapter.js.map +1 -0
- package/out/ve/recipes/reviewed-postcode-tail.d.ts +6 -2
- package/out/ve/recipes/reviewed-postcode-tail.d.ts.map +1 -1
- package/out/ve/recipes/reviewed-postcode-tail.js +16 -5
- package/out/ve/recipes/reviewed-postcode-tail.js.map +1 -1
- package/package.json +14 -14
- package/lib/recipes/unit/sources.ts +0 -44
- package/lib/tools/fetch/ppd.ts +0 -121
- package/out/gb/os-open/open-names.d.ts.map +0 -1
- package/out/gb/os-open/open-names.js.map +0 -1
- package/out/gb/os-open/open-roads.d.ts.map +0 -1
- package/out/gb/os-open/open-roads.js.map +0 -1
- package/out/recipes/unit/sources.d.ts +0 -28
- package/out/recipes/unit/sources.d.ts.map +0 -1
- package/out/recipes/unit/sources.js +0 -30
- package/out/recipes/unit/sources.js.map +0 -1
- package/out/tools/fetch/ppd.d.ts +0 -15
- package/out/tools/fetch/ppd.d.ts.map +0 -1
- package/out/tools/fetch/ppd.js +0 -86
- package/out/tools/fetch/ppd.js.map +0 -1
- /package/lib/gb/os-open/{open-roads.ts → open/roads.ts} +0 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `ide-uy`: the national address points of Uruguay, `Direcciones Geográficas del Uruguay`, which the
|
|
7
|
+
* Infraestructura de Datos Espaciales (IDE) publishes on catalogodatos.gub.uy as one CSV per department.
|
|
8
|
+
*
|
|
9
|
+
* The CSVs are Windows-1252 (`ORDOÑEZ` reads `ORDO\xd1EZ`), and quote a street name that holds a
|
|
10
|
+
* nickname in doubled quotes (`"AVENIDA JOSE ""PEPE"" D' ELIA"`). Absent values read `N/A`.
|
|
11
|
+
*
|
|
12
|
+
* The adapter reads `nombre_via` as the street, `num_puerta` with `letra_puerta` as the house number,
|
|
13
|
+
* `codigo_postal` as the postcode, `localidad` as the locality, `departamento` as the region and
|
|
14
|
+
* `nombre_inmueble` as a venue. A census locality named `<DEPARTAMENTO> RURAL` names the department's rural
|
|
15
|
+
* remainder rather than a place, so such a row keeps the department and no locality. A street the register
|
|
16
|
+
* leaves unnamed carries a generated code (`UYARMQA_SN_012`) and is dropped, as is a point located only by a
|
|
17
|
+
* route kilometer, which has no door number to render.
|
|
18
|
+
*
|
|
19
|
+
* The IDE publishes the dataset under the Licencia de Datos Abiertos – Uruguay, which grants adaptation and
|
|
20
|
+
* commercial use and requires the note of origin to name the provider, the license and the dataset, and to
|
|
21
|
+
* mention changes. Every row records that license.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { formatAddressRow } from "@mailwoman/codex/address/format"
|
|
25
|
+
import { matchCountryPostcode } from "@mailwoman/codex/postcode/country-formats"
|
|
26
|
+
import { readLocalBuffer } from "@mailwoman/core/fs/readers"
|
|
27
|
+
import { tryStat } from "@mailwoman/core/fs/readers/stat"
|
|
28
|
+
import { decodeBytes } from "@mailwoman/core/fs/streams"
|
|
29
|
+
import { resolvePath } from "path-ts"
|
|
30
|
+
import { CSVSpliterator } from "spliterator"
|
|
31
|
+
import { Globerator } from "spliterator/node/fs"
|
|
32
|
+
|
|
33
|
+
import { UnsupportedCountryError } from "#adapters/errors"
|
|
34
|
+
import { stableSourceIDFromParts } from "#adapters/source-id"
|
|
35
|
+
import { composeHouseNumber } from "#adapters/street-line"
|
|
36
|
+
import { SourceRegister } from "#registers"
|
|
37
|
+
import {
|
|
38
|
+
AddressRole,
|
|
39
|
+
type AdapterOptions,
|
|
40
|
+
type CanonicalRow,
|
|
41
|
+
type CorpusAdapter,
|
|
42
|
+
countDropped,
|
|
43
|
+
SurfaceOrigin,
|
|
44
|
+
} from "#types"
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Registry id for this adapter, stamped into every row it emits.
|
|
48
|
+
*/
|
|
49
|
+
export const IDE_UY_ADAPTER_ID = "ide-uy"
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The license the IDE publishes the dataset under.
|
|
53
|
+
* It has no SPDX identifier.
|
|
54
|
+
*/
|
|
55
|
+
export const IDE_UY_LICENSE = "LicenseRef-Licencia-Datos-Abiertos-Uruguay-0.1"
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Every jurisdiction this adapter emits, checked against a caller's `--country`.
|
|
59
|
+
*/
|
|
60
|
+
export const IDE_UY_COUNTRIES: readonly string[] = ["UY"]
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The columns the adapter reads from each department's CSV.
|
|
64
|
+
*/
|
|
65
|
+
export interface IDEUruguayRecord {
|
|
66
|
+
codigo_postal: string
|
|
67
|
+
codigo_via: string
|
|
68
|
+
nombre_via: string
|
|
69
|
+
num_puerta: string
|
|
70
|
+
letra_puerta: string
|
|
71
|
+
km: string
|
|
72
|
+
nombre_inmueble: string
|
|
73
|
+
localidad: string
|
|
74
|
+
departamento: string
|
|
75
|
+
latitud: string
|
|
76
|
+
longitud: string
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const ABSENT = "N/A"
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A value, or null when the IDE writes it as absent.
|
|
83
|
+
*/
|
|
84
|
+
function present(value: string | undefined): string | null {
|
|
85
|
+
const trimmed = value?.trim() ?? ""
|
|
86
|
+
|
|
87
|
+
return trimmed && trimmed !== ABSENT ? trimmed : null
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The house-number suffixes `letra_puerta` holds that a door number is written with:
|
|
92
|
+
* `BIS` and a single letter.
|
|
93
|
+
*
|
|
94
|
+
* The two-letter values (`DU`, `CC`, `TR`) are codes the dataset's metadata
|
|
95
|
+
* does not define, so they are left off.
|
|
96
|
+
*/
|
|
97
|
+
const LETTER_SUFFIX = /^(?:BIS|[A-Z])$/u
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* A street the register leaves unnamed carries a generated code, such as `UYARMQA_SN_012`.
|
|
101
|
+
*/
|
|
102
|
+
const GENERATED_STREET = /_SN_|^[A-Z0-9]+_[A-Z0-9_]+$/u
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Maps one record onto the components the corpus asserts, or returns null when the row is refused.
|
|
106
|
+
*
|
|
107
|
+
* Each refusal increments its reason in `dropped`.
|
|
108
|
+
*/
|
|
109
|
+
export function componentsForIDERecord(
|
|
110
|
+
record: IDEUruguayRecord,
|
|
111
|
+
dropped?: Pick<AdapterOptions, "dropped">
|
|
112
|
+
): CanonicalRow["components"] | null {
|
|
113
|
+
const tally = dropped ?? {}
|
|
114
|
+
const street = present(record.nombre_via)
|
|
115
|
+
|
|
116
|
+
if (!street) {
|
|
117
|
+
countDropped(tally, "row:no-street")
|
|
118
|
+
|
|
119
|
+
return null
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (GENERATED_STREET.test(street)) {
|
|
123
|
+
countDropped(tally, "row:street-generated-code")
|
|
124
|
+
|
|
125
|
+
return null
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const number = present(record.num_puerta)
|
|
129
|
+
|
|
130
|
+
if (!number) {
|
|
131
|
+
countDropped(tally, present(record.km) ? "row:route-kilometer-without-door-number" : "row:no-door-number")
|
|
132
|
+
|
|
133
|
+
return null
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const letter = present(record.letra_puerta)
|
|
137
|
+
const suffix = letter && LETTER_SUFFIX.test(letter) ? letter : ""
|
|
138
|
+
|
|
139
|
+
if (letter && !suffix) {
|
|
140
|
+
countDropped(tally, "component:letra_puerta:code")
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const components: CanonicalRow["components"] = {
|
|
144
|
+
house_number: composeHouseNumber(number, suffix, " "),
|
|
145
|
+
street,
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const venue = present(record.nombre_inmueble)
|
|
149
|
+
|
|
150
|
+
// A post office's distribution agent is listed under the agent's own name (`Agente` and a person's names),
|
|
151
|
+
// and a code such as `CH109` names no place, so neither becomes a venue.
|
|
152
|
+
if (venue && /^AGENTE\b/iu.test(venue)) {
|
|
153
|
+
countDropped(tally, "component:venue:names-a-person")
|
|
154
|
+
} else if (venue && !/\p{L}{3}/u.test(venue)) {
|
|
155
|
+
countDropped(tally, "component:venue:code")
|
|
156
|
+
} else if (venue) {
|
|
157
|
+
components.venue = venue
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const postcode = present(record.codigo_postal)
|
|
161
|
+
const matched = postcode ? matchCountryPostcode(postcode, "UY") : null
|
|
162
|
+
|
|
163
|
+
if (matched) {
|
|
164
|
+
components.postcode = matched
|
|
165
|
+
} else if (postcode) {
|
|
166
|
+
countDropped(tally, "component:postcode:not-country-format")
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const locality = present(record.localidad)
|
|
170
|
+
const region = present(record.departamento)
|
|
171
|
+
|
|
172
|
+
if (locality && !locality.endsWith(" RURAL")) {
|
|
173
|
+
components.locality = locality
|
|
174
|
+
} else if (locality) {
|
|
175
|
+
countDropped(tally, "component:locality:rural-remainder")
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (region && region !== components.locality) {
|
|
179
|
+
components.region = region
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (!components.locality && !components.postcode) {
|
|
183
|
+
countDropped(tally, "row:no-locality-or-postcode")
|
|
184
|
+
|
|
185
|
+
return null
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return components
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* The department CSVs an input names: the file itself, or every `.csv` in a directory, in name order.
|
|
193
|
+
*/
|
|
194
|
+
async function departmentFiles(inputPath: string): Promise<string[]> {
|
|
195
|
+
const stat = await tryStat(inputPath)
|
|
196
|
+
|
|
197
|
+
if (!stat?.isDirectory()) return [inputPath]
|
|
198
|
+
|
|
199
|
+
const names = await Globerator.from("*.csv", { cwd: inputPath, absolute: false }).toSorted()
|
|
200
|
+
|
|
201
|
+
return names.map((name) => `${inputPath}/${name}`)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export function createIDEUruguayAdapter(): CorpusAdapter {
|
|
205
|
+
return {
|
|
206
|
+
id: IDE_UY_ADAPTER_ID,
|
|
207
|
+
defaultLicense: IDE_UY_LICENSE,
|
|
208
|
+
addressRole: AddressRole.Premise,
|
|
209
|
+
register: SourceRegister.UruguayIDEDirecciones,
|
|
210
|
+
surface: SurfaceOrigin.Rendered,
|
|
211
|
+
description: "Direcciones Geográficas del Uruguay (IDE Uruguay): national address points, one CSV per department.",
|
|
212
|
+
|
|
213
|
+
async *rows(opts: AdapterOptions): AsyncIterable<CanonicalRow> {
|
|
214
|
+
if (opts.country && !IDE_UY_COUNTRIES.includes(opts.country)) {
|
|
215
|
+
throw new UnsupportedCountryError(IDE_UY_ADAPTER_ID, IDE_UY_COUNTRIES, opts.country)
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
let emitted = 0
|
|
219
|
+
|
|
220
|
+
for (const file of await departmentFiles(resolvePath(opts.inputPath))) {
|
|
221
|
+
// The largest department file is 65 MB, and the publisher fixes the partition, so each is decoded whole.
|
|
222
|
+
const text = decodeBytes(await readLocalBuffer(file), "windows-1252")
|
|
223
|
+
const records = CSVSpliterator.from<IDEUruguayRecord>(Buffer.from(text, "utf8"), { normalizeKeys: false })
|
|
224
|
+
|
|
225
|
+
for (const record of records) {
|
|
226
|
+
if (opts.signal?.aborted) return
|
|
227
|
+
|
|
228
|
+
if (opts.limit !== undefined && emitted >= opts.limit) return
|
|
229
|
+
|
|
230
|
+
const components = componentsForIDERecord(record, opts)
|
|
231
|
+
|
|
232
|
+
if (!components) continue
|
|
233
|
+
|
|
234
|
+
const rendered = formatAddressRow(components, "UY", { singleLine: true })
|
|
235
|
+
|
|
236
|
+
if (!rendered) {
|
|
237
|
+
countDropped(opts, "row:render-failed")
|
|
238
|
+
|
|
239
|
+
continue
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
for (const tag of rendered.unplaced) {
|
|
243
|
+
countDropped(opts, `component:${tag}:not-rendered`)
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const { raw, components: aligned } = rendered
|
|
247
|
+
|
|
248
|
+
yield {
|
|
249
|
+
raw,
|
|
250
|
+
components: aligned,
|
|
251
|
+
country: "UY",
|
|
252
|
+
locale: "es-UY",
|
|
253
|
+
source: IDE_UY_ADAPTER_ID,
|
|
254
|
+
// The point's coordinates separate two doors the rendered components cannot,
|
|
255
|
+
// such as the several access points one `num_puerta` has on a corner lot.
|
|
256
|
+
source_id: stableSourceIDFromParts(IDE_UY_ADAPTER_ID, {
|
|
257
|
+
...aligned,
|
|
258
|
+
lat: record.latitud ?? "",
|
|
259
|
+
lon: record.longitud ?? "",
|
|
260
|
+
}),
|
|
261
|
+
corpus_version: "",
|
|
262
|
+
license: IDE_UY_LICENSE,
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
emitted++
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* The configured adapter instance registered with the corpus builder.
|
|
274
|
+
*/
|
|
275
|
+
export const ideUruguayAdapter = createIDEUruguayAdapter()
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Renders
|
|
6
|
+
* Renders hand-reviewed Venezuelan postcode facts in the `locality postcode, region` order.
|
|
7
|
+
*
|
|
8
|
+
* A fact is kept in the data file only when its citation reaches a register row whose elected decision permits
|
|
9
|
+
* transform and train. None does today, so the file holds no tuple and the recipe refuses to run.
|
|
7
10
|
*/
|
|
8
11
|
|
|
9
12
|
import { readLocalJSONFile } from "@mailwoman/core/fs/readers"
|
|
@@ -23,8 +26,6 @@ import { SurfaceOrigin } from "#types"
|
|
|
23
26
|
*/
|
|
24
27
|
export const REVIEWED_POSTCODE_TAIL_SOURCE = defaultRecipeSource("synth-reviewed-postcode-tail")
|
|
25
28
|
|
|
26
|
-
const REVIEWED_TUPLE_COUNT = 4
|
|
27
|
-
|
|
28
29
|
interface ReviewedTupleProvenance {
|
|
29
30
|
publisher: string
|
|
30
31
|
url: string
|
|
@@ -51,6 +52,11 @@ export interface ReviewedPostcodeTuple {
|
|
|
51
52
|
interface ReviewedPostcodeTupleFile {
|
|
52
53
|
version: string
|
|
53
54
|
reviewedAt: string
|
|
55
|
+
/**
|
|
56
|
+
* How many tuples the file declares, so a tuple lost in an edit fails the read
|
|
57
|
+
* rather than shrinking the output.
|
|
58
|
+
*/
|
|
59
|
+
tupleCount: number
|
|
54
60
|
tuples: ReviewedPostcodeTuple[]
|
|
55
61
|
}
|
|
56
62
|
|
|
@@ -80,15 +86,24 @@ export function defaultReviewedPostcodeTuplePath(): string {
|
|
|
80
86
|
/**
|
|
81
87
|
* Reads and validates the reviewed tuples.
|
|
82
88
|
*
|
|
83
|
-
* @throws When the file does not hold
|
|
89
|
+
* @throws When the file does not hold as many complete, unique, reviewed
|
|
90
|
+
* tuples as its `tupleCount` declares.
|
|
84
91
|
*/
|
|
85
92
|
export async function readReviewedPostcodeTuples(
|
|
86
93
|
path: PathBuilderLike = defaultReviewedPostcodeTuplePath()
|
|
87
94
|
): Promise<ReviewedPostcodeTuple[]> {
|
|
88
95
|
const document = await readLocalJSONFile<ReviewedPostcodeTupleFile>(path)
|
|
89
96
|
|
|
90
|
-
if (
|
|
91
|
-
|
|
97
|
+
if (
|
|
98
|
+
!document.version ||
|
|
99
|
+
!ISO_DATE.test(document.reviewedAt) ||
|
|
100
|
+
!Number.isInteger(document.tupleCount) ||
|
|
101
|
+
document.tuples.length !== document.tupleCount
|
|
102
|
+
) {
|
|
103
|
+
throw new Error(
|
|
104
|
+
`reviewed postcode tuple file must declare a version, a review date, and a tupleCount matching its ` +
|
|
105
|
+
`${document.tuples?.length ?? 0} tuples`
|
|
106
|
+
)
|
|
92
107
|
}
|
|
93
108
|
|
|
94
109
|
const ids = new Set<string>()
|
|
@@ -177,6 +192,14 @@ export const reviewedPostcodeTailRecipe: CorpusRecipe = {
|
|
|
177
192
|
mode: "generate",
|
|
178
193
|
async run(opts, write) {
|
|
179
194
|
const tuples = await readReviewedPostcodeTuples(opts.input)
|
|
195
|
+
|
|
196
|
+
if (!tuples.length) {
|
|
197
|
+
throw new Error(
|
|
198
|
+
"reviewed-postcode-tail has no tuple to render: no reviewed fact's citation reaches a register row " +
|
|
199
|
+
"permitting transform and train"
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
|
|
180
203
|
let emitted = 0
|
|
181
204
|
let skipped = 0
|
|
182
205
|
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
*
|
|
68
68
|
* A country whose codex `layoutForCountry` is `null` has no rendering to write the row in.
|
|
69
69
|
* The row is refused with {@linkcode CORDISRefusal.CountryNoLayout} rather than rendered in another
|
|
70
|
-
* country's order
|
|
70
|
+
* country's order.
|
|
71
71
|
*
|
|
72
72
|
* ## The street line
|
|
73
73
|
*
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
*
|
|
68
68
|
* A country whose codex `layoutForCountry` is `null` has no rendering to write the row in.
|
|
69
69
|
* The row is refused with {@linkcode CORDISRefusal.CountryNoLayout} rather than rendered in another
|
|
70
|
-
* country's order
|
|
70
|
+
* country's order.
|
|
71
71
|
*
|
|
72
72
|
* ## The street line
|
|
73
73
|
*
|
|
@@ -17,4 +17,13 @@
|
|
|
17
17
|
* The largest dictionary is 8.4 KB, and each caller loads it once per process at module load.
|
|
18
18
|
*/
|
|
19
19
|
export declare function loadLibpostalDictionary(language: string, filename: string): Promise<Set<string>>;
|
|
20
|
+
/**
|
|
21
|
+
* Loads one curated libpostal dictionary as a map from each lower-cased form
|
|
22
|
+
* to its line's canonical spelling.
|
|
23
|
+
*
|
|
24
|
+
* `ул.` and `улица` both map to `улица`, so a count of distinct canonical values
|
|
25
|
+
* counts street types rather than their spellings.
|
|
26
|
+
* A form two lines share keeps the first line's canonical spelling.
|
|
27
|
+
*/
|
|
28
|
+
export declare function loadLibpostalCanonicalForms(language: string, filename: string): Promise<Map<string, string>>;
|
|
20
29
|
//# sourceMappingURL=libpostal-dictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libpostal-dictionary.d.ts","sourceRoot":"","sources":["../../lib/adapters/libpostal-dictionary.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"libpostal-dictionary.d.ts","sourceRoot":"","sources":["../../lib/adapters/libpostal-dictionary.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAEtG;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAqBlH"}
|
|
@@ -20,15 +20,31 @@ import { TextSpliterator } from "spliterator";
|
|
|
20
20
|
* The largest dictionary is 8.4 KB, and each caller loads it once per process at module load.
|
|
21
21
|
*/
|
|
22
22
|
export async function loadLibpostalDictionary(language, filename) {
|
|
23
|
+
return new Set((await loadLibpostalCanonicalForms(language, filename)).keys());
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Loads one curated libpostal dictionary as a map from each lower-cased form
|
|
27
|
+
* to its line's canonical spelling.
|
|
28
|
+
*
|
|
29
|
+
* `ул.` and `улица` both map to `улица`, so a count of distinct canonical values
|
|
30
|
+
* counts street types rather than their spellings.
|
|
31
|
+
* A form two lines share keeps the first line's canonical spelling.
|
|
32
|
+
*/
|
|
33
|
+
export async function loadLibpostalCanonicalForms(language, filename) {
|
|
23
34
|
const text = await readLocalTextFile(resourceDictionaryPath("libpostal", language, filename));
|
|
24
|
-
const
|
|
35
|
+
const forms = new Map();
|
|
25
36
|
for (const line of TextSpliterator.from(text)) {
|
|
26
37
|
if (line.startsWith("#"))
|
|
27
38
|
continue;
|
|
39
|
+
let canonical = null;
|
|
28
40
|
for (const form of TextSpliterator.from(line, { delimiter: "|" })) {
|
|
29
|
-
|
|
41
|
+
const lower = form.toLowerCase();
|
|
42
|
+
canonical ??= lower;
|
|
43
|
+
if (!forms.has(lower)) {
|
|
44
|
+
forms.set(lower, canonical);
|
|
45
|
+
}
|
|
30
46
|
}
|
|
31
47
|
}
|
|
32
|
-
return
|
|
48
|
+
return forms;
|
|
33
49
|
}
|
|
34
50
|
//# sourceMappingURL=libpostal-dictionary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libpostal-dictionary.js","sourceRoot":"","sources":["../../lib/adapters/libpostal-dictionary.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AAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAQ;QAElC,IAAI,SAAS,GAAkB,IAAI,CAAA;QAEnC,KAAK,MAAM,IAAI,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;YACnE,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;YAEhC,SAAS,KAAK,KAAK,CAAA;YAEnB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBACvB,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;YAC5B,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAA;AACb,CAAC"}
|
|
@@ -48,6 +48,15 @@ interface OSMCorpusRow {
|
|
|
48
48
|
district?: string | null;
|
|
49
49
|
province?: string | null;
|
|
50
50
|
country?: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* The containing administrative area's name, which `emit-corpus-jsonl --locality-level`
|
|
53
|
+
* writes for a record without `addr:city`.
|
|
54
|
+
*/
|
|
55
|
+
boundary_locality?: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* The same for a record without `addr:suburb`, from `--dependent-locality-level`.
|
|
58
|
+
*/
|
|
59
|
+
boundary_dependent_locality?: string | null;
|
|
51
60
|
}
|
|
52
61
|
/**
|
|
53
62
|
* Whether `addr:housenumber` holds a street designator — digits with an optional letter,
|
|
@@ -85,9 +94,11 @@ export declare function splitCityValue(value: string): {
|
|
|
85
94
|
* A row whose `addr:street` holds a line rather than a name stays refused:
|
|
86
95
|
* the mapper supplied a street, and the value is a line.
|
|
87
96
|
*
|
|
97
|
+
* A postcode is kept when the whole value has `country`'s postcode format.
|
|
98
|
+
*
|
|
88
99
|
* Each refusal and each discarded component increments its reason in `dropped`.
|
|
89
100
|
*/
|
|
90
|
-
export declare function componentsForOSMRow(row: OSMCorpusRow, dropped?: Pick<AdapterOptions, "dropped">): CanonicalRow["components"] | null;
|
|
101
|
+
export declare function componentsForOSMRow(row: OSMCorpusRow, country: string, dropped?: Pick<AdapterOptions, "dropped">): CanonicalRow["components"] | null;
|
|
91
102
|
/**
|
|
92
103
|
* Whether two place names are the same name: case, whitespace, diacritics and a leading
|
|
93
104
|
* admin generic folded (`Bắc Ninh` = `Bac Ninh`; `Hà Nội` = `Thành phố Hà Nội`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../lib/adapters/osm/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../lib/adapters/osm/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,EAGlB,MAAM,QAAQ,CAAA;AAEf;;GAEG;AACH,eAAO,MAAM,cAAc,QAAQ,CAAA;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,WAAW,aAAa,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,eAAe,mDAAmD,CAAA;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,QAEyC,CAAA;AAErE;;GAEG;AACH,UAAU,YAAY;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC;;OAEG;IACH,2BAA2B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3C;AAID;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI9D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CASnD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAQvF;AAoBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAClC,GAAG,EAAE,YAAY,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,GACvC,YAAY,CAAC,YAAY,CAAC,GAAG,IAAI,CAyGnC;AAQD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAWtD;AAED,wBAAgB,gBAAgB,IAAI,aAAa,CAkFhD;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,eAAqB,CAAA"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* That is why `defaultLicense` is not an option on this adapter.
|
|
11
11
|
*/
|
|
12
12
|
import { formatAddressRow } from "@mailwoman/codex/address/format";
|
|
13
|
+
import { countryPostcodeFormat, matchCountryPostcode } from "@mailwoman/codex/postcode/country-formats";
|
|
13
14
|
import { tryParsingJSON } from "@mailwoman/core/json";
|
|
14
15
|
import { extractDelimited } from "@mailwoman/core/scripting/arguments";
|
|
15
16
|
import { stripCombiningMarks } from "@mailwoman/normalize/fold";
|
|
@@ -102,9 +103,11 @@ function parseLine(line) {
|
|
|
102
103
|
* A row whose `addr:street` holds a line rather than a name stays refused:
|
|
103
104
|
* the mapper supplied a street, and the value is a line.
|
|
104
105
|
*
|
|
106
|
+
* A postcode is kept when the whole value has `country`'s postcode format.
|
|
107
|
+
*
|
|
105
108
|
* Each refusal and each discarded component increments its reason in `dropped`.
|
|
106
109
|
*/
|
|
107
|
-
export function componentsForOSMRow(row, dropped) {
|
|
110
|
+
export function componentsForOSMRow(row, country, dropped) {
|
|
108
111
|
const tally = dropped ?? {};
|
|
109
112
|
const street = clean(row.street);
|
|
110
113
|
const number = clean(row.number);
|
|
@@ -129,31 +132,45 @@ export function componentsForOSMRow(row, dropped) {
|
|
|
129
132
|
components.unit = unit;
|
|
130
133
|
}
|
|
131
134
|
const postcode = clean(row.postcode);
|
|
132
|
-
if (postcode
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
if (postcode) {
|
|
136
|
+
// The country's own format decides, so Argentina's `C1425ABC`, Brunei's `BS8811` and Chile's
|
|
137
|
+
// seven digits stay postcodes, and a value outside the country's form is dropped by name.
|
|
138
|
+
const matched = matchCountryPostcode(postcode, country);
|
|
139
|
+
if (matched) {
|
|
140
|
+
components.postcode = matched;
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
countDropped(tally, countryPostcodeFormat(country) ? "component:postcode:not-country-format" : "component:postcode:country-has-none");
|
|
144
|
+
}
|
|
137
145
|
}
|
|
138
146
|
const city = clean(row.city);
|
|
139
147
|
const split = city ? splitCityValue(city) : null;
|
|
140
148
|
if (split) {
|
|
141
149
|
components.locality = split.locality;
|
|
142
150
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
151
|
+
else {
|
|
152
|
+
// The containing boundary's name stands in only where the mapper tagged no city,
|
|
153
|
+
// so a tagged value is never replaced by a position.
|
|
154
|
+
const boundary = clean(row.boundary_locality);
|
|
155
|
+
if (boundary) {
|
|
156
|
+
components.locality = boundary;
|
|
157
|
+
countDropped(tally, "kept:locality-from-boundary");
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// Dependent-locality candidates in priority order (suburb, subdistrict, district, place,
|
|
161
|
+
// city head, then the containing boundary's name); `district` never becomes `region`,
|
|
162
|
+
// because Vietnam's country template renders it only when no city is present.
|
|
163
|
+
const dependent = [row.suburb, row.subdistrict, row.district, row.place, split?.head, row.boundary_dependent_locality]
|
|
147
164
|
.map((value) => clean(value))
|
|
148
165
|
.find((value) => value !== null &&
|
|
149
166
|
!value.includes(",") &&
|
|
150
167
|
(street === null || !sameName(value, street)) &&
|
|
151
|
-
(
|
|
168
|
+
(!components.locality || !sameName(value, components.locality)));
|
|
152
169
|
if (dependent) {
|
|
153
170
|
components.dependent_locality = dependent;
|
|
154
171
|
}
|
|
155
172
|
const province = clean(row.province);
|
|
156
|
-
if (province && (!
|
|
173
|
+
if (province && (!components.locality || !sameName(province, components.locality))) {
|
|
157
174
|
components.region = province;
|
|
158
175
|
}
|
|
159
176
|
// A streetless premise is a house number within a place that has a name, so it needs
|
|
@@ -228,7 +245,7 @@ export function createOSMAdapter() {
|
|
|
228
245
|
if (!tagged) {
|
|
229
246
|
countDropped(opts, "kept:country-untagged");
|
|
230
247
|
}
|
|
231
|
-
const components = componentsForOSMRow(row, opts);
|
|
248
|
+
const components = componentsForOSMRow(row, country, opts);
|
|
232
249
|
if (!components)
|
|
233
250
|
continue;
|
|
234
251
|
const rendered = formatAddressRow(components, country, { singleLine: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../lib/adapters/osm/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AA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1B,+BAA+B,EAC/B,oBAAoB,GACpB,MAAM,sCAAsC,CAAA;AAE7C,OAAO,EACN,yBAAyB,EACzB,8BAA8B,EAC9B,mBAAmB,GACnB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACN,wBAAwB,EACxB,6BAA6B,EAC7B,kBAAkB,GAClB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAEjH,OAAO,EACN,sBAAsB,EACtB,2BAA2B,EAC3B,iBAAiB,GACjB,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EACN,uBAAuB,EACvB,4BAA4B,EAC5B,kCAAkC,GAClC,MAAM,qDAAqD,CAAA;AAE5D,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACxF,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA"}
|
package/out/adapters.js
CHANGED
|
@@ -49,9 +49,11 @@ import { defaultAdapterRegistry } from "#adapters/registry";
|
|
|
49
49
|
import { wofAdminAdapter } from "#adapters/wof/admin/json/adapter";
|
|
50
50
|
import { wofPostalcodeAdapter } from "#adapters/wof/postalcode-json/adapter";
|
|
51
51
|
import { gnafAdapter } from "#au/adapters/gnaf/adapter";
|
|
52
|
+
import { azerbaijanPlacesAdapter } from "#az/adapters/opendata/adapter";
|
|
52
53
|
import { brusselsAdapter } from "#be/adapters/brussels/adapter";
|
|
53
54
|
import { vlaanderenAdapter } from "#be/adapters/vlaanderen/adapter";
|
|
54
55
|
import { wallonieAdapter } from "#be/adapters/wallonie/adapter";
|
|
56
|
+
import { gbpaAdapter } from "#bs/adapters/gbpa/adapter";
|
|
55
57
|
import { czCuzkAdapter } from "#cz/adapters/cuzk/adapter";
|
|
56
58
|
import { dkInspireAdapter } from "#dk/adapters/inspire/adapter";
|
|
57
59
|
import { adsAdapter } from "#ee/adapters/ads/adapter";
|
|
@@ -60,11 +62,15 @@ import { esCatastroAdapter } from "#es/adapters/catastro/adapter";
|
|
|
60
62
|
import { esGipuzkoaAdapter } from "#es/adapters/gipuzkoa/adapter";
|
|
61
63
|
import { esNavarraAdapter } from "#es/adapters/navarra/adapter";
|
|
62
64
|
import { ryhtiAdapter } from "#fi/adapters/ryhti/adapter";
|
|
65
|
+
import { adressurFaroeAdapter } from "#fo/adapters/adressur/adapter";
|
|
63
66
|
import { annuaireEducationAdapter } from "#fr/adapters/annuaire-education/adapter";
|
|
64
67
|
import { banAdapter } from "#fr/adapters/ban/adapter";
|
|
65
68
|
import { finessAdapter } from "#fr/adapters/finess/adapter";
|
|
66
69
|
import { gbOSOpenAdapter } from "#gb/adapters/os-open/adapter";
|
|
70
|
+
import { guamAddressPointsAdapter } from "#gu/adapters/bsp/adapter";
|
|
71
|
+
import { isleOfManLandRegistryAdapter } from "#im/adapters/land-registry/adapter";
|
|
67
72
|
import { itANACAdapter } from "#it/adapters/anac/adapter";
|
|
73
|
+
import { llvLiechtensteinAdapter } from "#li/adapters/llv/adapter";
|
|
68
74
|
import { bdAdressesAdapter } from "#lu/adapters/bd-adresses/adapter";
|
|
69
75
|
import { varisAdapter } from "#lv/adapters/varis/adapter";
|
|
70
76
|
import { nlKadasterAdapter } from "#nl/adapters/kadaster/adapter";
|
|
@@ -83,6 +89,7 @@ import { usgovImlsPlsAdapter } from "#us/adapters/usgov/imls-pls/adapter";
|
|
|
83
89
|
import { USGovIRSBMFAdapter } from "#us/adapters/usgov/irs-bmf/adapter";
|
|
84
90
|
import { usgovNADAdapter } from "#us/adapters/usgov/nad/adapter";
|
|
85
91
|
import { usgovNPPESAdapter } from "#us/adapters/usgov/nppes/adapter";
|
|
92
|
+
import { ideUruguayAdapter } from "#uy/adapters/ide/adapter";
|
|
86
93
|
/**
|
|
87
94
|
* Built-in adapters.
|
|
88
95
|
*
|
|
@@ -104,6 +111,13 @@ export const BUILTIN_ADAPTERS = [
|
|
|
104
111
|
banAdapter,
|
|
105
112
|
matrikkelenAdapter,
|
|
106
113
|
ryhtiAdapter,
|
|
114
|
+
ideUruguayAdapter,
|
|
115
|
+
llvLiechtensteinAdapter,
|
|
116
|
+
adressurFaroeAdapter,
|
|
117
|
+
isleOfManLandRegistryAdapter,
|
|
118
|
+
gbpaAdapter,
|
|
119
|
+
azerbaijanPlacesAdapter,
|
|
120
|
+
guamAddressPointsAdapter,
|
|
107
121
|
czCuzkAdapter,
|
|
108
122
|
dkInspireAdapter,
|
|
109
123
|
adsAdapter,
|