@mailwoman/zoning 11.0.0 → 11.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 +18 -18
- package/lib/index.ts +7 -7
- package/lib/paths.ts +3 -4
- package/lib/ring-roles.ts +6 -7
- package/lib/rings.ts +5 -5
- package/lib/schema.ts +5 -8
- package/lib/vocabulary.ts +6 -6
- package/out/index.d.ts +4 -7
- package/out/index.d.ts.map +1 -1
- package/out/index.js +4 -5
- package/out/index.js.map +1 -1
- package/out/paths.d.ts +0 -7
- package/out/paths.d.ts.map +1 -1
- package/out/paths.js +2 -4
- package/out/paths.js.map +1 -1
- package/out/ring-roles.d.ts +3 -7
- package/out/ring-roles.d.ts.map +1 -1
- package/out/ring-roles.js +4 -6
- package/out/ring-roles.js.map +1 -1
- package/out/rings.d.ts +2 -5
- package/out/rings.d.ts.map +1 -1
- package/out/rings.js +4 -5
- package/out/rings.js.map +1 -1
- package/out/schema.d.ts +3 -8
- package/out/schema.d.ts.map +1 -1
- package/out/schema.js +2 -5
- package/out/schema.js.map +1 -1
- package/out/sdk/build-zoning.d.ts +4 -11
- package/out/sdk/build-zoning.d.ts.map +1 -1
- package/out/sdk/build-zoning.js +12 -12
- package/out/sdk/build-zoning.js.map +1 -1
- package/out/sdk/cells.d.ts +3 -6
- package/out/sdk/cells.d.ts.map +1 -1
- package/out/sdk/cells.js +4 -5
- package/out/sdk/cells.js.map +1 -1
- package/out/sdk/client.d.ts +3 -6
- package/out/sdk/client.d.ts.map +1 -1
- package/out/sdk/client.js +5 -6
- package/out/sdk/client.js.map +1 -1
- package/out/sdk/download.d.ts +0 -7
- package/out/sdk/download.d.ts.map +1 -1
- package/out/sdk/download.js +4 -5
- package/out/sdk/download.js.map +1 -1
- package/out/sdk/ingest/chunk.d.ts +0 -7
- package/out/sdk/ingest/chunk.d.ts.map +1 -1
- package/out/sdk/ingest/chunk.js +4 -5
- package/out/sdk/ingest/chunk.js.map +1 -1
- package/out/sdk/ingest/worker.d.ts +0 -7
- package/out/sdk/ingest/worker.d.ts.map +1 -1
- package/out/sdk/ingest/worker.js +5 -6
- package/out/sdk/ingest/worker.js.map +1 -1
- package/out/sdk/ingest.d.ts +0 -11
- package/out/sdk/ingest.d.ts.map +1 -1
- package/out/sdk/ingest.js +7 -7
- package/out/sdk/ingest.js.map +1 -1
- package/out/sdk/measure-resolutions.d.ts +3 -6
- package/out/sdk/measure-resolutions.d.ts.map +1 -1
- package/out/sdk/measure-resolutions.js +3 -8
- package/out/sdk/measure-resolutions.js.map +1 -1
- package/out/sdk/test-kit.d.ts +6 -6
- package/out/sdk/test-kit.d.ts.map +1 -1
- package/out/sdk/test-kit.js +10 -8
- package/out/sdk/test-kit.js.map +1 -1
- package/out/sdk/verify.d.ts +41 -24
- package/out/sdk/verify.d.ts.map +1 -1
- package/out/sdk/verify.js +5 -34
- package/out/sdk/verify.js.map +1 -1
- package/out/vocabulary.d.ts +3 -6
- package/out/vocabulary.d.ts.map +1 -1
- package/out/vocabulary.js +5 -6
- package/out/vocabulary.js.map +1 -1
- package/package.json +5 -5
- package/sdk/build-zoning.ts +13 -12
- package/sdk/cells.ts +6 -6
- package/sdk/client.ts +6 -6
- package/sdk/download.ts +5 -5
- package/sdk/ingest/chunk.ts +5 -5
- package/sdk/ingest/worker.ts +6 -6
- package/sdk/ingest.ts +8 -7
- package/sdk/measure-resolutions.ts +6 -6
- package/sdk/test-kit.ts +11 -8
- package/sdk/verify.ts +45 -25
package/sdk/download.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Acquire the Department's bulk GeoJSON export with raw `fetch` rather than `APIClient`, following the result URL's redirect and keying the cache on the item's own modified date.
|
|
5
|
+
* Acquire the Department's bulk GeoJSON export with raw `fetch` rather than `APIClient`,
|
|
6
|
+
* following the result URL's redirect and keying the cache on the item's own modified date.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { tryStat } from "@mailwoman/core/fs/readers/stat"
|
package/sdk/ingest/chunk.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The streaming pass, bounded to one process per range of the authority's own feature ids because h3's wasm heap cannot be reset from JavaScript and a build that completes only by luck is not reproducible.
|
|
5
|
+
* The streaming pass, bounded to one process per range of the authority's own feature ids because h3's
|
|
6
|
+
* wasm heap cannot be reset from JavaScript and a build that completes only by luck isn't reproducible.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import {
|
package/sdk/ingest/worker.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* One chunk of the zoning ingest, as its own process — spawned by `buildZoningDatabase`, never run by hand.
|
|
5
|
+
* One chunk of the zoning ingest, as its own process — spawned by
|
|
6
|
+
* `buildZoningDatabase`, never run by hand.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { requiredArgument } from "@mailwoman/core/scripting/arguments"
|
|
@@ -28,7 +28,7 @@ await runIngestChunkScript({
|
|
|
28
28
|
exportPath: requiredArgument("zoning ingest-chunk", "export", values.export ?? null),
|
|
29
29
|
...(values["object-id-from"] ? { objectIDFrom: Number(values["object-id-from"]) } : {}),
|
|
30
30
|
...(values["object-id-to"] ? { objectIDTo: Number(values["object-id-to"]) } : {}),
|
|
31
|
-
// A range's count
|
|
31
|
+
// A range's count isn't knowable up front: the source reports only the layer total,
|
|
32
32
|
// so the parent checks the sum against the whole file.
|
|
33
33
|
declaredFeatureCount: 0,
|
|
34
34
|
}),
|
package/sdk/ingest.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
5
|
* Streams the Department's bulk zoning export through ogr2ogr as reprojected WGS84 features.
|
|
7
6
|
*
|
|
8
|
-
* The stream uses CSV with WKT geometry because the source marks holes by ring orientation.
|
|
9
|
-
* GeoJSON writer rewinds every ring to RFC 7946 order.
|
|
10
|
-
*
|
|
7
|
+
* The stream uses CSV with WKT geometry because the source marks holes by ring orientation.
|
|
8
|
+
* GDAL's GeoJSON writer rewinds every ring to RFC 7946 order.
|
|
9
|
+
*
|
|
10
|
+
* That turns holes into zoned areas.
|
|
11
|
+
* The source is in EPSG:2157, declared in a legacy top-level `crs` member that GDAL honors.
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
import { declaredFeatureCount } from "@mailwoman/core/layers"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The `partial` share cannot choose between candidate resolutions, so each is reported by candidates per cell and by the polyfill-only zero-cell count.
|
|
5
|
+
* The `partial` share cannot choose between candidate resolutions, so each is reported
|
|
6
|
+
* by candidates per cell and by the polyfill-only zero-cell count.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { ResolutionMeasurementOptions, ResolutionMeasurementReport } from "@mailwoman/core/layers"
|
|
@@ -25,7 +25,7 @@ const DEFAULT_PROGRESS_EVERY = 5000
|
|
|
25
25
|
/**
|
|
26
26
|
* Measure every candidate resolution over the real source.
|
|
27
27
|
*
|
|
28
|
-
* @throws {Error} When the streamed feature count
|
|
28
|
+
* @throws {Error} When the streamed feature count doesn't match the count the source declares.
|
|
29
29
|
*/
|
|
30
30
|
export async function measureZoningCellResolutions(
|
|
31
31
|
options: MeasureResolutionsOptions
|
package/sdk/test-kit.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
5
|
* `@mailwoman/zoning/test-kit` provides hand-built geometry for fixture tests.
|
|
7
|
-
*
|
|
6
|
+
*
|
|
7
|
+
* It includes zones in two plans over the same ground.
|
|
8
|
+
* It includes a zone with a service-encoded hole.
|
|
9
|
+
*
|
|
8
10
|
* It includes a zone smaller than a cell and a zone the authority states as unzoned.
|
|
9
11
|
*
|
|
10
|
-
* Under this service a clockwise ring is the exterior and a counter-clockwise one is a hole,
|
|
12
|
+
* Under this service a clockwise ring is the exterior and a counter-clockwise one is a hole,
|
|
13
|
+
* the inverse of the GeoJSON convention and of every sibling fixture.
|
|
11
14
|
*/
|
|
12
15
|
|
|
13
16
|
import {
|
|
@@ -111,7 +114,7 @@ export function fixtureFeatures(): ZoningSourceFeature[] {
|
|
|
111
114
|
const zoneB = exteriorRing(lon + FIXTURE_SIDE, lat, lon + 2 * FIXTURE_SIDE, lat + FIXTURE_SIDE)
|
|
112
115
|
|
|
113
116
|
// The real service encodes the hole as a separate part.
|
|
114
|
-
// It
|
|
117
|
+
// It doesn't nest the hole ring.
|
|
115
118
|
const holed: MultiPolygonRings = [
|
|
116
119
|
[exteriorRing(lon, lat + 2 * FIXTURE_SIDE, lon + FIXTURE_SIDE, lat + 3 * FIXTURE_SIDE)],
|
|
117
120
|
[
|
|
@@ -152,7 +155,7 @@ export function fixtureFeatures(): ZoningSourceFeature[] {
|
|
|
152
155
|
crosswalkCode: "N1.1",
|
|
153
156
|
crosswalkDescription: "Road",
|
|
154
157
|
}),
|
|
155
|
-
// The authority marks land as unzoned with a code its own domain
|
|
158
|
+
// The authority marks land as unzoned with a code its own domain doesn't declare.
|
|
156
159
|
fixtureFeature(5, [[unzoned]], {
|
|
157
160
|
localCode: GZT_UNZONED_LOCAL_CODE,
|
|
158
161
|
localDescription: "Unzoned",
|
package/sdk/verify.ts
CHANGED
|
@@ -1,33 +1,53 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
+
* The check compares the artifact with a second path.
|
|
6
|
+
* A separate half tests locations outside its coverage.
|
|
7
|
+
*
|
|
8
|
+
* The positive half samples points from the sealed artifact and asks the
|
|
9
|
+
* Department's feature service about them.
|
|
10
|
+
* The service supplies geometry through a separate distribution channel.
|
|
5
11
|
*
|
|
6
|
-
*
|
|
12
|
+
* This package hasn't touched that geometry.
|
|
13
|
+
* The check runs the point test on the service's rings.
|
|
7
14
|
*
|
|
8
|
-
*
|
|
9
|
-
* The service supplies geometry through a separate distribution channel. This package has not touched that geometry.
|
|
10
|
-
* The check runs the point test on the service's rings. It compares two verdicts from the same authority.
|
|
15
|
+
* It compares two verdicts from the same authority.
|
|
11
16
|
* This measures our conversion against the authority's published geometry.
|
|
12
17
|
*
|
|
13
|
-
* The service returns geometry in the publisher's ring convention.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
18
|
+
* The service returns geometry in the publisher's ring convention.
|
|
19
|
+
* `outSR=4326` returns the same clockwise-exterior rings as the bulk export.
|
|
20
|
+
*
|
|
21
|
+
* This path re-derives ring roles as ingest does.
|
|
22
|
+
* A point inside a hole then falls outside on both paths or inside on both paths.
|
|
23
|
+
*
|
|
24
|
+
* The negative half checks locations outside the publication area.
|
|
25
|
+
* The Department omits Donegal, one of 31 local authorities.
|
|
26
|
+
*
|
|
27
|
+
* The product also excludes Northern Ireland.
|
|
28
|
+
* Points in both areas must return `unknown` with no designation.
|
|
29
|
+
*
|
|
30
|
+
* A positive-only check could pass an artifact that reports the whole island as zoned.
|
|
31
|
+
* The layer treats a missing polygon as no zoning statement.
|
|
32
|
+
*
|
|
33
|
+
* The channels use different coordinate precision.
|
|
34
|
+
* A boundary-point disagreement therefore doesn't establish a conversion defect.
|
|
35
|
+
*
|
|
36
|
+
* The archive publishes nine decimals through this package's ingest.
|
|
37
|
+
* The service rounds its JSON.
|
|
38
|
+
*
|
|
39
|
+
* A point within roughly a meter of a zone boundary can fall on opposite sides of the two rendered edges.
|
|
40
|
+
* The check reports these cases as `boundary_tolerance` with the distance to the nearest edge.
|
|
41
|
+
* The receipt includes their count.
|
|
16
42
|
*
|
|
17
|
-
* The
|
|
18
|
-
*
|
|
19
|
-
* designation. A positive-only check could pass an artifact that reports the whole island as zoned. The layer treats
|
|
20
|
-
* a missing polygon as no zoning statement.
|
|
43
|
+
* The distance measures to the edge rather than to the nearest vertex.
|
|
44
|
+
* A point a centimeter from a long edge can be meters from every vertex.
|
|
21
45
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* A point within roughly a meter of a zone boundary can fall on opposite sides of the two rendered edges. The check
|
|
25
|
-
* reports these cases as `boundary_tolerance` with the distance to the nearest edge. The receipt includes their count.
|
|
46
|
+
* In one sibling-layer near-miss, vertex distance measured 1.58 m and edge distance measured 0.009 m.
|
|
47
|
+
* The vertex measurement overstated distance by 175 times.
|
|
26
48
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* measured 0.009 m. The vertex measurement overstated distance by 175 times. It would make the stated boundary
|
|
30
|
-
* tolerance stricter and report a rendering difference as a conversion defect.
|
|
49
|
+
* It would make the stated boundary tolerance stricter and report a rendering
|
|
50
|
+
* difference as a conversion defect.
|
|
31
51
|
*/
|
|
32
52
|
|
|
33
53
|
import type { OGCFeature } from "@mailwoman/core/api"
|
|
@@ -109,11 +129,11 @@ export interface VerifyZoningResult {
|
|
|
109
129
|
* The check requires points from two populations.
|
|
110
130
|
* The Donegal points are the case this layer's coverage posture exists for.
|
|
111
131
|
*
|
|
112
|
-
* The Department
|
|
132
|
+
* The Department hasn't published that authority's zoning.
|
|
113
133
|
* A builder that reads the absence as "unrestricted" would answer these points confidently.
|
|
114
134
|
*
|
|
115
135
|
* The Northern Irish points confirm the artifact is clipped to the Republic rather than to the
|
|
116
|
-
* island: zoning there
|
|
136
|
+
* island: zoning there's a different jurisdiction's instrument under a different planning act.
|
|
117
137
|
*/
|
|
118
138
|
export const OUTSIDE_PUBLICATION_POINTS: ReadonlyArray<{ label: string; latitude: number; longitude: number }> = [
|
|
119
139
|
{ label: "Letterkenny town centre, Donegal", latitude: 54.9503, longitude: -7.7345 },
|
|
@@ -255,7 +275,7 @@ export async function verifyZoningDatabase(options: VerifyZoningOptions): Promis
|
|
|
255
275
|
/**
|
|
256
276
|
* Whether the service's own geometry contains the point, decided here with the same
|
|
257
277
|
* ring-role resolution and the same even-odd rule the artifact's reader uses.
|
|
258
|
-
* So what
|
|
278
|
+
* So what's compared is a verdict against a verdict.
|
|
259
279
|
*/
|
|
260
280
|
async function readServiceContainment(
|
|
261
281
|
readServiceFeatures: ServiceFeatureReader,
|