@mailwoman/zoning 9.4.0 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +169 -163
- package/lib/index.ts +89 -120
- package/lib/paths.ts +24 -0
- package/lib/ring-roles.ts +30 -71
- package/lib/rings.ts +2 -13
- package/lib/schema.ts +96 -114
- package/lib/vocabulary.ts +52 -130
- package/out/index.d.ts +75 -95
- package/out/index.d.ts.map +1 -1
- package/out/index.js +25 -82
- package/out/index.js.map +1 -1
- package/out/paths.d.ts +19 -0
- package/out/paths.d.ts.map +1 -0
- package/out/paths.js +21 -0
- package/out/paths.js.map +1 -0
- package/out/ring-roles.d.ts +16 -50
- package/out/ring-roles.d.ts.map +1 -1
- package/out/ring-roles.js +18 -51
- package/out/ring-roles.js.map +1 -1
- package/out/rings.d.ts +2 -13
- package/out/rings.d.ts.map +1 -1
- package/out/rings.js +2 -13
- package/out/rings.js.map +1 -1
- package/out/schema.d.ts +93 -108
- package/out/schema.d.ts.map +1 -1
- package/out/schema.js +16 -44
- package/out/schema.js.map +1 -1
- package/out/sdk/build-zoning.d.ts +58 -111
- package/out/sdk/build-zoning.d.ts.map +1 -1
- package/out/sdk/build-zoning.js +48 -137
- package/out/sdk/build-zoning.js.map +1 -1
- package/out/sdk/cells.d.ts +20 -61
- package/out/sdk/cells.d.ts.map +1 -1
- package/out/sdk/cells.js +13 -50
- package/out/sdk/cells.js.map +1 -1
- package/out/sdk/client.d.ts +23 -67
- package/out/sdk/client.d.ts.map +1 -1
- package/out/sdk/client.js +29 -77
- package/out/sdk/client.js.map +1 -1
- package/out/sdk/download.d.ts +7 -27
- package/out/sdk/download.d.ts.map +1 -1
- package/out/sdk/download.js +7 -27
- package/out/sdk/download.js.map +1 -1
- package/out/sdk/ingest/chunk.d.ts +106 -0
- package/out/sdk/ingest/chunk.d.ts.map +1 -0
- package/out/sdk/{ingest-chunk.js → ingest/chunk.js} +17 -50
- package/out/sdk/ingest/chunk.js.map +1 -0
- package/out/sdk/ingest/worker.d.ts +9 -0
- package/out/sdk/ingest/worker.d.ts.map +1 -0
- package/out/{scripts/ingest-chunk.js → sdk/ingest/worker.js} +5 -7
- package/out/sdk/ingest/worker.js.map +1 -0
- package/out/sdk/ingest.d.ts +54 -77
- package/out/sdk/ingest.d.ts.map +1 -1
- package/out/sdk/ingest.js +50 -87
- package/out/sdk/ingest.js.map +1 -1
- package/out/sdk/measure-resolutions.d.ts +6 -23
- package/out/sdk/measure-resolutions.d.ts.map +1 -1
- package/out/sdk/measure-resolutions.js +4 -21
- package/out/sdk/measure-resolutions.js.map +1 -1
- package/out/sdk/test-kit.d.ts +75 -0
- package/out/sdk/test-kit.d.ts.map +1 -0
- package/out/{test-kit.js → sdk/test-kit.js} +20 -43
- package/out/sdk/test-kit.js.map +1 -0
- package/out/sdk/verify.d.ts +74 -56
- package/out/sdk/verify.d.ts.map +1 -1
- package/out/sdk/verify.js +70 -57
- package/out/sdk/verify.js.map +1 -1
- package/out/vocabulary.d.ts +52 -120
- package/out/vocabulary.d.ts.map +1 -1
- package/out/vocabulary.js +47 -125
- package/out/vocabulary.js.map +1 -1
- package/package.json +37 -161
- package/{lib/sdk → sdk}/build-zoning.ts +100 -186
- package/{lib/sdk → sdk}/cells.ts +24 -63
- package/{lib/sdk → sdk}/client.ts +34 -82
- package/sdk/download.ts +58 -0
- package/{lib/sdk/ingest-chunk.ts → sdk/ingest/chunk.ts} +32 -61
- package/{lib/scripts/ingest-chunk.ts → sdk/ingest/worker.ts} +4 -6
- package/sdk/ingest.ts +366 -0
- package/{lib/sdk → sdk}/measure-resolutions.ts +8 -25
- package/{lib → sdk}/test-kit.ts +20 -43
- package/{lib/sdk → sdk}/verify.ts +102 -75
- package/lib/sdk/download.ts +0 -78
- package/lib/sdk/index.ts +0 -15
- package/lib/sdk/ingest.ts +0 -398
- package/out/scripts/ingest-chunk.d.ts +0 -11
- package/out/scripts/ingest-chunk.d.ts.map +0 -1
- package/out/scripts/ingest-chunk.js.map +0 -1
- package/out/sdk/index.d.ts +0 -15
- package/out/sdk/index.d.ts.map +0 -1
- package/out/sdk/index.js +0 -15
- package/out/sdk/index.js.map +0 -1
- package/out/sdk/ingest-chunk.d.ts +0 -130
- package/out/sdk/ingest-chunk.d.ts.map +0 -1
- package/out/sdk/ingest-chunk.js.map +0 -1
- package/out/test-kit.d.ts +0 -96
- package/out/test-kit.d.ts.map +0 -1
- package/out/test-kit.js.map +0 -1
package/lib/sdk/ingest.ts
DELETED
|
@@ -1,398 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Read the Department's bulk export as a stream of WGS84 features, through ogr2ogr.
|
|
7
|
-
*
|
|
8
|
-
* OGR IS BUILD TOOLING, NEVER A SERVE DEPENDENCY (SCOPE invariant 6). It converts the authority's geometry
|
|
9
|
-
* into the structure the runtime probes, and nothing downstream of this module knows GDAL exists.
|
|
10
|
-
*
|
|
11
|
-
* THE STREAM IS WKT, NOT GEOJSON, AND THAT IS A CORRECTNESS CHOICE RATHER THAN A TASTE ONE. This service
|
|
12
|
-
* encodes hole roles by ring ORIENTATION — clockwise exterior, the inverse of RFC 7946 — and puts each ring
|
|
13
|
-
* in its own `MultiPolygon` part on the features that carry holes that way. GDAL's GeoJSON writer enforces
|
|
14
|
-
* the RFC 7946 winding unconditionally: `-lco RFC7946=NO` is not a GeoJSONSeq option, and
|
|
15
|
-
* `--config OGR_ORGANIZE_POLYGONS SKIP` changes nothing. Measured on the largest feature in the country,
|
|
16
|
-
* Meath's `RA - Rural Area`: through GeoJSONSeq it arrives as 107 counter-clockwise rings totalling
|
|
17
|
-
* 2,371.9 km², through CSV/WKT as the source's own 5 clockwise and 102 counter-clockwise totalling
|
|
18
|
-
* 2,223.1 km² against the Department's published 2,232.1 km². The GeoJSON path has silently turned 102
|
|
19
|
-
* holes into 102 zoned areas.
|
|
20
|
-
*
|
|
21
|
-
* AND THE TRANSPORT IS NOT THE SLOW HALF. Measured on this lab over the whole national export: ogr2ogr
|
|
22
|
-
* reprojects to 224,066,621 bytes of WKT CSV in 13.2 s, and `CSVSpliterator` plus the WKT parse reads
|
|
23
|
-
* 85,330 rows, 93,483 rings and 6,327,256 positions back out of it in 2.2 s.
|
|
24
|
-
*
|
|
25
|
-
* THE SOURCE IS NOT IN WGS84 AND SAYING SO IS THE CHECK. The bulk export is IRENET95 / Irish Transverse
|
|
26
|
-
* Mercator — metres, easting/northing, EPSG:2157 — declared in a top-level `crs` member RFC 7946 removed
|
|
27
|
-
* from the format. GDAL honours the legacy member; a strict reader ignores it and places Ireland's zoning
|
|
28
|
-
* at latitude 735,435. So the projection is asserted against the source's declared authority code before a
|
|
29
|
-
* single feature is read, and every reprojected vertex is asserted inside the Department's own declared
|
|
30
|
-
* extent — which is the check that catches a coordinate-order mistake the projection check cannot see.
|
|
31
|
-
*
|
|
32
|
-
* THE DATUM SHIFT NEEDS A GRID, AND ITS ABSENCE IS SILENT. PROJ substitutes a ballpark offset when the
|
|
33
|
-
* accurate transformation is unavailable and produces coordinates that are metres wrong and
|
|
34
|
-
* indistinguishable from correct ones. {@linkcode assertDatumTransformationAvailable} asks `projinfo` what
|
|
35
|
-
* PROJ would choose and refuses a ballpark; for this source it names
|
|
36
|
-
* `Inverse of Irish Transverse Mercator + IRENET95 to WGS 84 (1), 1 m`.
|
|
37
|
-
*
|
|
38
|
-
* THE PUBLISHER'S OWN AREA COLUMN IS NOT IN THE ARCHIVE. `Shape__Area` is a service field and the export
|
|
39
|
-
* drops it, so the area cross-check reads it from the live service instead — which makes it a genuine
|
|
40
|
-
* two-path check rather than the archive agreeing with itself. See `sdk/client.ts`.
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
import { declaredFeatureCount } from "@mailwoman/core/layers"
|
|
44
|
-
import { assertRingsInsideExtent, requireArealPolygons, type MultiPolygonRings } from "@mailwoman/spatial"
|
|
45
|
-
import { readOGRLayerIdentity } from "@mailwoman/spatial/tools/ogr"
|
|
46
|
-
import { spawnOGR2OGR } from "@mailwoman/spatial/tools/ogr-stream"
|
|
47
|
-
import { wellKnownGeometryToGeoJSON } from "@mailwoman/spatial/well-known-text"
|
|
48
|
-
import { CSVSpliterator } from "spliterator"
|
|
49
|
-
|
|
50
|
-
import { resolveRingRoles, type ResolvedRingRoles } from "#rings"
|
|
51
|
-
import { GZT_DECLARED_BBOX, GZT_SOURCE_EPSG } from "#vocabulary"
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* One zoning feature, reprojected to WGS84 with its hole roles resolved.
|
|
55
|
-
*/
|
|
56
|
-
export interface ZoningSourceFeature {
|
|
57
|
-
/**
|
|
58
|
-
* The authority's own `OBJECTID`, as a string.
|
|
59
|
-
*/
|
|
60
|
-
areaID: string
|
|
61
|
-
/**
|
|
62
|
-
* `LA_CODE`, verbatim — `Fl` for Fingal, and never repaired.
|
|
63
|
-
*/
|
|
64
|
-
authorityCode: string
|
|
65
|
-
authorityName: string
|
|
66
|
-
planID: string
|
|
67
|
-
planName: string
|
|
68
|
-
planLevel: string
|
|
69
|
-
planFrom: string | null
|
|
70
|
-
planTo: string | null
|
|
71
|
-
currentPlan: number
|
|
72
|
-
/**
|
|
73
|
-
* `ZONE_ORIG`, verbatim, including case and any trailing space.
|
|
74
|
-
*/
|
|
75
|
-
localCode: string
|
|
76
|
-
localDescription: string | null
|
|
77
|
-
localCodeURL: string | null
|
|
78
|
-
/**
|
|
79
|
-
* `ZONE_GZT` — the Department's national generic type for THIS polygon.
|
|
80
|
-
*/
|
|
81
|
-
crosswalkCode: string | null
|
|
82
|
-
crosswalkDescription: string | null
|
|
83
|
-
/**
|
|
84
|
-
* `SZO` — the coarser national code, as published.
|
|
85
|
-
*/
|
|
86
|
-
crosswalkRollup: string | null
|
|
87
|
-
/**
|
|
88
|
-
* The rings, with hole roles resolved from orientation, plus the receipt of that resolution.
|
|
89
|
-
*/
|
|
90
|
-
rings: ResolvedRingRoles
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* What the ingest was pointed at.
|
|
95
|
-
*/
|
|
96
|
-
export interface ZoningIngestOptions {
|
|
97
|
-
/**
|
|
98
|
-
* Path to the bulk GeoJSON export.
|
|
99
|
-
*/
|
|
100
|
-
exportPath: string
|
|
101
|
-
/**
|
|
102
|
-
* Stop after this many features — the fixtures and smoke rungs use it; a full build does not set it.
|
|
103
|
-
*/
|
|
104
|
-
limit?: number
|
|
105
|
-
/**
|
|
106
|
-
* The EPSG code the source must declare. A source declaring anything else is a product change, not a variation to
|
|
107
|
-
* absorb.
|
|
108
|
-
*/
|
|
109
|
-
expectEPSG?: number
|
|
110
|
-
/**
|
|
111
|
-
* The extent every reprojected vertex must land inside. Defaults to the Department's own declaration.
|
|
112
|
-
*/
|
|
113
|
-
declaredBBox?: readonly [number, number, number, number]
|
|
114
|
-
/**
|
|
115
|
-
* Read only the authority's feature ids in `[objectIDFrom, objectIDTo]`, inclusive.
|
|
116
|
-
*
|
|
117
|
-
* This is what makes a bounded build possible: h3's WASM heap cannot be reset from JavaScript, so the classification
|
|
118
|
-
* runs one child process per range of the authority's OWN ids. Ranges rather than an offset because `OBJECTID` is the
|
|
119
|
-
* source's stable key — a range names the same features on every run, which an offset into a result set does not.
|
|
120
|
-
*
|
|
121
|
-
* A NARROWER RANGE COSTS A WHOLE PASS. The source is one GeoJSON document rather than an indexed store, so ogr2ogr
|
|
122
|
-
* scans all 247 MB for every range. The national set fits inside one chunk at the default bound, so that cost is not
|
|
123
|
-
* paid on a full build.
|
|
124
|
-
*/
|
|
125
|
-
objectIDFrom?: number
|
|
126
|
-
objectIDTo?: number
|
|
127
|
-
/**
|
|
128
|
-
* Restrict to one local authority's own `LA_CODE` — the smoke rung.
|
|
129
|
-
*/
|
|
130
|
-
authorityCode?: string
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* What the source declares about itself, read before any feature is.
|
|
135
|
-
*/
|
|
136
|
-
export interface ZoningSourceIdentity {
|
|
137
|
-
epsg: number
|
|
138
|
-
featureCount: number
|
|
139
|
-
layer: string
|
|
140
|
-
/**
|
|
141
|
-
* The source's own attribute field names. A `-select` naming a column this set does not hold makes ogr2ogr write an
|
|
142
|
-
* empty column rather than refuse, so the query is built from the set rather than from a schema read off a sibling
|
|
143
|
-
* publication.
|
|
144
|
-
*/
|
|
145
|
-
fields: ReadonlySet<string>
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Coordinate decimals ogr2ogr writes into the stream. Nine is ~0.1 mm at this latitude — far past the source's own
|
|
150
|
-
* precision, and chosen so the reprojection contributes nothing measurable to the area cross-check.
|
|
151
|
-
*/
|
|
152
|
-
const COORDINATE_PRECISION = 9
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* How far outside the declared extent a vertex may fall before the ingest refuses.
|
|
156
|
-
*
|
|
157
|
-
* A declared extent is itself a rounded published value, so an exact test would be brittle; this margin is small enough
|
|
158
|
-
* that an unprojected or axis-swapped read — which lands degrees or whole hemispheres away — still fails.
|
|
159
|
-
*/
|
|
160
|
-
const BBOX_MARGIN_DEGREES = 0.01
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* The attribute columns the ingest reads. Every one is required: this product publishes a single schema, and a column
|
|
164
|
-
* that vanished would be a product change rather than a variation to absorb.
|
|
165
|
-
*/
|
|
166
|
-
export const ZONING_SOURCE_FIELDS: ReadonlyArray<string> = [
|
|
167
|
-
"OBJECTID",
|
|
168
|
-
"LA_CODE",
|
|
169
|
-
"LA_NAME",
|
|
170
|
-
"PLAN_ID",
|
|
171
|
-
"PLAN_NAME",
|
|
172
|
-
"PLAN_LEVEL",
|
|
173
|
-
"PLAN_FROM",
|
|
174
|
-
"PLAN_TO",
|
|
175
|
-
"CURRENT_PLAN",
|
|
176
|
-
"ZONE_ORIG",
|
|
177
|
-
"ZONE_DESC",
|
|
178
|
-
"ZONE_LINK",
|
|
179
|
-
"ZONE_GZT",
|
|
180
|
-
"GZT_DESC",
|
|
181
|
-
"SZO",
|
|
182
|
-
]
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* What the source declares about itself: its authority code, its feature count and its field list.
|
|
186
|
-
*
|
|
187
|
-
* @throws {Error} When the export is unreadable, its declared EPSG is not `expectEPSG`, or it is missing a field the
|
|
188
|
-
* ingest reads.
|
|
189
|
-
*/
|
|
190
|
-
export async function readZoningSourceIdentity(options: ZoningIngestOptions): Promise<ZoningSourceIdentity> {
|
|
191
|
-
const identity = await readOGRLayerIdentity({
|
|
192
|
-
path: options.exportPath,
|
|
193
|
-
expectEPSG: options.expectEPSG ?? GZT_SOURCE_EPSG,
|
|
194
|
-
context: "zoning ingest",
|
|
195
|
-
areaOfUse: "Ireland",
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
const missing = ZONING_SOURCE_FIELDS.filter((field) => field !== "OBJECTID" && !identity.fields.has(field))
|
|
199
|
-
|
|
200
|
-
// `-select` on a missing column makes ogr2ogr write an EMPTY column rather than refuse, so a schema change would
|
|
201
|
-
// arrive as a stream of nulls: every local code blank, every plan unnamed, and a well-formed artifact describing
|
|
202
|
-
// nothing. Refused here instead, by name.
|
|
203
|
-
if (missing.length) {
|
|
204
|
-
throw new Error(
|
|
205
|
-
`zoning ingest: ${options.exportPath} carries no ${missing.join(", ")} column(s) — ogr2ogr writes a missing column as empty rather than refusing, so a schema change would arrive as a stream of blank codes`
|
|
206
|
-
)
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
return { epsg: identity.epsg, featureCount: identity.featureCount, layer: identity.layer, fields: identity.fields }
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* The `-where` predicate for a bounded chunk or a one-authority smoke run.
|
|
214
|
-
*/
|
|
215
|
-
function whereClause(options: ZoningIngestOptions): string[] {
|
|
216
|
-
const bounds: string[] = []
|
|
217
|
-
|
|
218
|
-
if (options.objectIDFrom !== undefined) {
|
|
219
|
-
bounds.push(`OBJECTID >= ${options.objectIDFrom}`)
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
if (options.objectIDTo !== undefined) {
|
|
223
|
-
bounds.push(`OBJECTID <= ${options.objectIDTo}`)
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
if (options.authorityCode !== undefined) {
|
|
227
|
-
bounds.push(`LA_CODE = '${options.authorityCode.replaceAll("'", "''")}'`)
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
return bounds.length ? ["-where", bounds.join(" AND ")] : []
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* A published value, as a string or null. An EMPTY STRING IS NOT NULL HERE for the local code, which is the one column
|
|
235
|
-
* this layer exists to repeat: a blank one is refused by the ingest rather than stored.
|
|
236
|
-
*/
|
|
237
|
-
function blankToNull(value: string | undefined): string | null {
|
|
238
|
-
if (value === undefined) return null
|
|
239
|
-
|
|
240
|
-
return value.length ? value : null
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Stream the export through ogr2ogr as reprojected WKT, checking every vertex against the declared extent.
|
|
245
|
-
*
|
|
246
|
-
* A swapped coordinate order survives a projection check — both axes are still numbers in a plausible range — and shows
|
|
247
|
-
* up here immediately, before 85,330 polygons are written to the wrong side of the planet.
|
|
248
|
-
*
|
|
249
|
-
* @throws {Error} When ogr2ogr fails, when a feature carries no geometry, when a reprojected vertex falls outside the
|
|
250
|
-
* declared extent, or when a feature's rings cannot be resolved into at least one exterior.
|
|
251
|
-
*/
|
|
252
|
-
export async function* readZoningFeatures(options: ZoningIngestOptions): AsyncGenerator<ZoningSourceFeature> {
|
|
253
|
-
const [minLon, minLat, maxLon, maxLat] = options.declaredBBox ?? GZT_DECLARED_BBOX
|
|
254
|
-
|
|
255
|
-
const args = [
|
|
256
|
-
"-f",
|
|
257
|
-
"CSV",
|
|
258
|
-
"/vsistdout/",
|
|
259
|
-
"-t_srs",
|
|
260
|
-
"EPSG:4326",
|
|
261
|
-
"-lco",
|
|
262
|
-
"GEOMETRY=AS_WKT",
|
|
263
|
-
"-lco",
|
|
264
|
-
"CREATE_CSVT=NO",
|
|
265
|
-
"-lco",
|
|
266
|
-
`COORDINATE_PRECISION=${COORDINATE_PRECISION}`,
|
|
267
|
-
"-select",
|
|
268
|
-
ZONING_SOURCE_FIELDS.join(","),
|
|
269
|
-
...whereClause(options),
|
|
270
|
-
...(options.limit === undefined ? [] : ["-limit", String(options.limit)]),
|
|
271
|
-
options.exportPath,
|
|
272
|
-
]
|
|
273
|
-
|
|
274
|
-
const proc = spawnOGR2OGR(args, "zoning ingest")
|
|
275
|
-
|
|
276
|
-
try {
|
|
277
|
-
for await (const row of CSVSpliterator.fromAsync<Record<string, string>>(proc.stdout, {
|
|
278
|
-
mode: "object",
|
|
279
|
-
// Opt-in end-to-end quoting: the WKT column carries commas and spaces on every row, so a reader without it
|
|
280
|
-
// mis-splits every feature into hundreds of columns.
|
|
281
|
-
enableQuoteHandling: true,
|
|
282
|
-
})) {
|
|
283
|
-
const areaID = row.OBJECTID ?? ""
|
|
284
|
-
|
|
285
|
-
if (!areaID) {
|
|
286
|
-
throw new Error("zoning ingest: a row carries no OBJECTID — the authority's own key is the artifact's key")
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
const wkt = row.WKT
|
|
290
|
-
|
|
291
|
-
if (!wkt) {
|
|
292
|
-
throw new Error(`zoning ingest: feature ${areaID} carries no geometry`)
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
const polygons = normalizePolygons(wkt, `feature ${areaID}`)
|
|
296
|
-
|
|
297
|
-
assertRingsInsideExtent(
|
|
298
|
-
polygons,
|
|
299
|
-
`feature ${areaID}`,
|
|
300
|
-
{ minLon, minLat, maxLon, maxLat },
|
|
301
|
-
BBOX_MARGIN_DEGREES,
|
|
302
|
-
"zoning ingest"
|
|
303
|
-
)
|
|
304
|
-
|
|
305
|
-
const localCode = row.ZONE_ORIG ?? ""
|
|
306
|
-
|
|
307
|
-
// The local code is what this layer exists to repeat, so a blank one is refused rather than stored: it would read
|
|
308
|
-
// as a zone the authority named nothing, which is not a reading the authority ever makes.
|
|
309
|
-
if (!localCode.trim()) {
|
|
310
|
-
throw new Error(
|
|
311
|
-
`zoning ingest: feature ${areaID} carries a blank ZONE_ORIG — the authority's own code is the claim, so a blank is refused rather than stored`
|
|
312
|
-
)
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
yield {
|
|
316
|
-
areaID,
|
|
317
|
-
authorityCode: row.LA_CODE ?? "",
|
|
318
|
-
authorityName: row.LA_NAME ?? "",
|
|
319
|
-
planID: row.PLAN_ID ?? "",
|
|
320
|
-
planName: row.PLAN_NAME ?? "",
|
|
321
|
-
planLevel: row.PLAN_LEVEL ?? "",
|
|
322
|
-
planFrom: blankToNull(row.PLAN_FROM),
|
|
323
|
-
planTo: blankToNull(row.PLAN_TO),
|
|
324
|
-
currentPlan: Number(row.CURRENT_PLAN ?? 0),
|
|
325
|
-
// VERBATIM, and deliberately un-trimmed: `Proposed Residential ` carries a trailing space in the source, and
|
|
326
|
-
// five of the 581 distinct strings collide with another only on case or that space.
|
|
327
|
-
localCode,
|
|
328
|
-
localDescription: blankToNull(row.ZONE_DESC),
|
|
329
|
-
localCodeURL: blankToNull(row.ZONE_LINK),
|
|
330
|
-
crosswalkCode: blankToNull(row.ZONE_GZT),
|
|
331
|
-
crosswalkDescription: blankToNull(row.GZT_DESC),
|
|
332
|
-
crosswalkRollup: blankToNull(row.SZO),
|
|
333
|
-
rings: resolveRingRoles(polygons, areaID),
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
} finally {
|
|
337
|
-
proc.kill()
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
await proc.settled
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Parse one WKT geometry into the ring shape the rest of this package works in.
|
|
345
|
-
*
|
|
346
|
-
* @throws {Error} When the geometry is neither a `Polygon` nor a `MultiPolygon`.
|
|
347
|
-
*/
|
|
348
|
-
function normalizePolygons(wkt: string, label: string): MultiPolygonRings {
|
|
349
|
-
const geometry = wellKnownGeometryToGeoJSON<{ type: string; coordinates: unknown }>(wkt)
|
|
350
|
-
|
|
351
|
-
return requireArealPolygons(geometry, label, "zoning ingest")
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Where a build's features come from, and what the source declares about itself.
|
|
356
|
-
*
|
|
357
|
-
* The builder takes ONE of these rather than a path, which is what makes the fixture rung possible: hand-built geometry
|
|
358
|
-
* with no network and no GDAL still exercises the whole database half — the domain checks, the ring-role resolution,
|
|
359
|
-
* the cell classification, the coverage rows, the manifest and the seal. A fixture rung that could only run through
|
|
360
|
-
* ogr2ogr would test the conversion on the machines that have it and nothing at all on the ones that do not.
|
|
361
|
-
*/
|
|
362
|
-
export interface ZoningFeatureSource {
|
|
363
|
-
/**
|
|
364
|
-
* What the source says it holds. The build compares its own streamed total against this, so a short read throws
|
|
365
|
-
* instead of building a smaller country.
|
|
366
|
-
*/
|
|
367
|
-
declaredFeatureCount: number
|
|
368
|
-
epsg: number
|
|
369
|
-
/**
|
|
370
|
-
* A description of where these features came from, for the receipt.
|
|
371
|
-
*/
|
|
372
|
-
origin: string
|
|
373
|
-
features: () => AsyncIterable<ZoningSourceFeature>
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
export interface ExportSourceOptions extends ZoningIngestOptions {
|
|
377
|
-
declaredFeatureCount?: number
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* The bulk export as a feature source — identity read up front, features streamed on demand.
|
|
382
|
-
*/
|
|
383
|
-
export async function createExportFeatureSource(options: ExportSourceOptions): Promise<ZoningFeatureSource> {
|
|
384
|
-
const identity = await readZoningSourceIdentity(options)
|
|
385
|
-
|
|
386
|
-
return {
|
|
387
|
-
// A RANGE's or an authority's own count is supplied by the caller, because `ogrinfo` reports a layer's total and
|
|
388
|
-
// nothing narrower.
|
|
389
|
-
declaredFeatureCount: declaredFeatureCount({
|
|
390
|
-
declared: options.declaredFeatureCount,
|
|
391
|
-
limit: options.limit,
|
|
392
|
-
layerCount: identity.featureCount,
|
|
393
|
-
}),
|
|
394
|
-
epsg: identity.epsg,
|
|
395
|
-
origin: options.exportPath,
|
|
396
|
-
features: () => readZoningFeatures(options),
|
|
397
|
-
}
|
|
398
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* One chunk of the zoning ingest, as its own process — spawned by `buildZoningDatabase`, never run by
|
|
7
|
-
* hand. The process boundary and the stdout contract live with `runIngestChunkScript`; what stays here is
|
|
8
|
-
* only this product's flags and its feature-source constructor.
|
|
9
|
-
*/
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=ingest-chunk.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ingest-chunk.d.ts","sourceRoot":"","sources":["../../lib/scripts/ingest-chunk.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ingest-chunk.js","sourceRoot":"","sources":["../../lib/scripts/ingest-chunk.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAA;AAIxG,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAErD,MAAM,oBAAoB,CAAC;IAC1B,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE;QACR,GAAG,kBAAkB;QACrB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACpC,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAClC;IACD,GAAG,EAAE,KAAK,EAAE,QAAwC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CACtE,iBAAiB,CAAC,QAAQ,EAAE;QAC3B,MAAM,EAAE,MAAM,yBAAyB,CAAC;YACvC,UAAU,EAAE,gBAAgB,CAAC,qBAAqB,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;YAC5E,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC;YACrG,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC;YAC/F,8GAA8G;YAC9G,iGAAiG;YACjG,oBAAoB,EAAE,CAAC;SACvB,CAAC;QACF,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;QAC5C,UAAU,EAAE,KAAK,CAAC,UAAU;KAC5B,CAAC;CACH,CAAC,CAAA"}
|
package/out/sdk/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
* @file The acquisition + build surface for the Irish zoning layer. The READER is the package root.
|
|
6
|
-
*/
|
|
7
|
-
export * from "#sdk/build-zoning";
|
|
8
|
-
export * from "#sdk/cells";
|
|
9
|
-
export * from "#sdk/client";
|
|
10
|
-
export * from "#sdk/download";
|
|
11
|
-
export * from "#sdk/ingest";
|
|
12
|
-
export * from "#sdk/ingest-chunk";
|
|
13
|
-
export * from "#sdk/measure-resolutions";
|
|
14
|
-
export * from "#sdk/verify";
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
package/out/sdk/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,aAAa,CAAA"}
|
package/out/sdk/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
* @file The acquisition + build surface for the Irish zoning layer. The READER is the package root.
|
|
6
|
-
*/
|
|
7
|
-
export * from "#sdk/build-zoning";
|
|
8
|
-
export * from "#sdk/cells";
|
|
9
|
-
export * from "#sdk/client";
|
|
10
|
-
export * from "#sdk/download";
|
|
11
|
-
export * from "#sdk/ingest";
|
|
12
|
-
export * from "#sdk/ingest-chunk";
|
|
13
|
-
export * from "#sdk/measure-resolutions";
|
|
14
|
-
export * from "#sdk/verify";
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
package/out/sdk/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,aAAa,CAAA"}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The streaming pass — every feature into `zoning_area` and into `zoning_cell` — as a unit of work that can
|
|
7
|
-
* run over PART of the source.
|
|
8
|
-
*
|
|
9
|
-
* WHY THIS IS A CHUNK RATHER THAN THE WHOLE FILE. h3's WASM heap cannot be reset from JavaScript, and it
|
|
10
|
-
* does not survive an unbounded number of polyfill calls: over a sibling product, runs died after roughly
|
|
11
|
-
* 510,000 and 798,000 features on geometry that classifies in milliseconds in a fresh process. A build that
|
|
12
|
-
* completes only when fragmentation happens to stay low is not a reproducible build, so the classification
|
|
13
|
-
* is bounded BY CONSTRUCTION — one process per range of the authority's own feature ids. This product's
|
|
14
|
-
* 85,330 features fit inside the default bound; the bound ships anyway, because determinism by construction
|
|
15
|
-
* is not the same fact as determinism by luck.
|
|
16
|
-
*
|
|
17
|
-
* THE VOCABULARY IS A CENSUS, NOT A CHECK. The declared generic-type domain is closed and the source
|
|
18
|
-
* already breaks it — `N/A` appears on 4 rows and in no domain — so an undeclared value is RECORDED as
|
|
19
|
-
* observed-but-undeclared rather than throwing. That is the opposite of the sibling layers' rule and it is
|
|
20
|
-
* the publisher's own doing: refusing here would refuse the Department's own data. What DOES throw is a
|
|
21
|
-
* blank local code, because the local code is the claim.
|
|
22
|
-
*
|
|
23
|
-
* THE CROSSWALK PAIRS ARE COUNTED HERE BECAUSE THEY ARE THE ARGUMENT FOR THE SCHEMA. If a local code
|
|
24
|
-
* determined a generic type, the mapping could ship as an edge table and the local column would be
|
|
25
|
-
* redundant. It does not: measured nationally, 52 of 795 (authority, local code) pairs take more than one
|
|
26
|
-
* generic type. The chunk reports the pairs it saw and the build refuses to write an edge table while any
|
|
27
|
-
* such pair exists, so the empty `zoning_crosswalk_edge` is a checked consequence rather than an omission.
|
|
28
|
-
*
|
|
29
|
-
* THE CHUNK OWNS NO ARTIFACT. It appends rows to a database the parent created and will seal, and returns
|
|
30
|
-
* counts the parent adds up. Chunks run one at a time against that file, so there is no concurrent writer
|
|
31
|
-
* and no locking to reason about. The jurisdiction, plan and vocabulary rows are RETURNED rather than
|
|
32
|
-
* written: they are per-chunk partials that have to be merged before insertion, and 30 authorities, 63
|
|
33
|
-
* plans and about 880 vocabulary rows cross a process boundary for nothing.
|
|
34
|
-
*/
|
|
35
|
-
import type { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
36
|
-
import type { ZoningDatabase } from "#schema";
|
|
37
|
-
import type { ZoningFeatureSource, ZoningSourceFeature } from "#sdk/ingest";
|
|
38
|
-
/**
|
|
39
|
-
* One observed vocabulary value: which scheme, which code, the publisher's own label for it, and how many rows carry
|
|
40
|
-
* it.
|
|
41
|
-
*/
|
|
42
|
-
export type ObservedTerm = [scheme: string, code: string, label: string, rows: number];
|
|
43
|
-
/**
|
|
44
|
-
* One (authority, local code) pair and every generic type the publisher assigned to it.
|
|
45
|
-
*/
|
|
46
|
-
export type CrosswalkPair = [authorityCode: string, localCode: string, crosswalkCodes: string[]];
|
|
47
|
-
/**
|
|
48
|
-
* What one chunk produced. Every field is JSON-serializable, because a chunk normally reports across a process
|
|
49
|
-
* boundary.
|
|
50
|
-
*/
|
|
51
|
-
export interface ZoningChunkResult {
|
|
52
|
-
features: number;
|
|
53
|
-
/**
|
|
54
|
-
* Features whose bounding box forced a resolution coarser than the target.
|
|
55
|
-
*/
|
|
56
|
-
coarsened: number;
|
|
57
|
-
/**
|
|
58
|
-
* Cell rows written, split by tier.
|
|
59
|
-
*/
|
|
60
|
-
wholeCellRows: number;
|
|
61
|
-
partialCellRows: number;
|
|
62
|
-
/**
|
|
63
|
-
* `[coverageCell, polygonsReachingIt]` pairs — an array rather than a `Map` so it survives the process boundary.
|
|
64
|
-
*/
|
|
65
|
-
observedByCoverageCell: Array<[number, number]>;
|
|
66
|
-
/**
|
|
67
|
-
* Square metres. `signed` is the raw ring sum as published; `nested` is the per-polygon hole-aware reading;
|
|
68
|
-
* `allExterior` is what the same rings say read WITHOUT their holes.
|
|
69
|
-
*/
|
|
70
|
-
area: {
|
|
71
|
-
signedM2: number;
|
|
72
|
-
nestedM2: number;
|
|
73
|
-
allExteriorM2: number;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* The ring-role census — the receipt that the orientation was read rather than assumed.
|
|
77
|
-
*/
|
|
78
|
-
rings: {
|
|
79
|
-
total: number;
|
|
80
|
-
exteriors: number;
|
|
81
|
-
holes: number;
|
|
82
|
-
nestedHoles: number;
|
|
83
|
-
adjacentHoles: number;
|
|
84
|
-
/**
|
|
85
|
-
* Features whose exterior was chosen by MAGNITUDE because no ring read as one by orientation — measured at one of
|
|
86
|
-
* 85,330. See `ResolvedRingRoles.exteriorByMagnitude`.
|
|
87
|
-
*/
|
|
88
|
-
exteriorByMagnitude: number;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* The authorities this chunk saw, by their own code.
|
|
92
|
-
*/
|
|
93
|
-
jurisdictions: Array<[code: string, name: string]>;
|
|
94
|
-
/**
|
|
95
|
-
* The plans this chunk saw.
|
|
96
|
-
*/
|
|
97
|
-
plans: Array<{
|
|
98
|
-
planID: string;
|
|
99
|
-
authorityCode: string;
|
|
100
|
-
name: string;
|
|
101
|
-
level: string;
|
|
102
|
-
from: string | null;
|
|
103
|
-
to: string | null;
|
|
104
|
-
currentPlan: number;
|
|
105
|
-
}>;
|
|
106
|
-
vocabulary: ObservedTerm[];
|
|
107
|
-
crosswalkPairs: CrosswalkPair[];
|
|
108
|
-
}
|
|
109
|
-
export interface IngestZoningChunkOptions {
|
|
110
|
-
source: ZoningFeatureSource;
|
|
111
|
-
indexResolution: number;
|
|
112
|
-
coverageResolution: number;
|
|
113
|
-
onProgress?: (message: string) => void;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Stream one chunk of the source into `database`.
|
|
117
|
-
*
|
|
118
|
-
* @throws {Error} On a feature the classifier or the ring-role resolver refuses.
|
|
119
|
-
*/
|
|
120
|
-
export declare function ingestZoningChunk(database: DatabaseClient<ZoningDatabase>, options: IngestZoningChunkOptions): Promise<ZoningChunkResult>;
|
|
121
|
-
/**
|
|
122
|
-
* One feature's own contribution, for a caller that wants the numbers without a database — the fixture rung's
|
|
123
|
-
* arithmetic and nothing else.
|
|
124
|
-
*/
|
|
125
|
-
export declare function featureAreaReadings(feature: ZoningSourceFeature): {
|
|
126
|
-
signed: number;
|
|
127
|
-
nested: number;
|
|
128
|
-
allExterior: number;
|
|
129
|
-
};
|
|
130
|
-
//# sourceMappingURL=ingest-chunk.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ingest-chunk.d.ts","sourceRoot":"","sources":["../../lib/sdk/ingest-chunk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAWH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAc3E;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;AAEtF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAA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