@mailwoman/zoning 10.0.0 → 10.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +169 -163
  2. package/lib/index.ts +103 -135
  3. package/lib/paths.ts +24 -0
  4. package/lib/ring-roles.ts +30 -71
  5. package/lib/rings.ts +2 -13
  6. package/lib/schema.ts +98 -139
  7. package/lib/vocabulary.ts +52 -130
  8. package/out/index.d.ts +81 -101
  9. package/out/index.d.ts.map +1 -1
  10. package/out/index.js +37 -96
  11. package/out/index.js.map +1 -1
  12. package/out/paths.d.ts +19 -0
  13. package/out/paths.d.ts.map +1 -0
  14. package/out/paths.js +21 -0
  15. package/out/paths.js.map +1 -0
  16. package/out/ring-roles.d.ts +16 -50
  17. package/out/ring-roles.d.ts.map +1 -1
  18. package/out/ring-roles.js +18 -51
  19. package/out/ring-roles.js.map +1 -1
  20. package/out/rings.d.ts +2 -13
  21. package/out/rings.d.ts.map +1 -1
  22. package/out/rings.js +2 -13
  23. package/out/rings.js.map +1 -1
  24. package/out/schema.d.ts +90 -132
  25. package/out/schema.d.ts.map +1 -1
  26. package/out/schema.js +17 -45
  27. package/out/schema.js.map +1 -1
  28. package/out/sdk/build-zoning.d.ts +58 -111
  29. package/out/sdk/build-zoning.d.ts.map +1 -1
  30. package/out/sdk/build-zoning.js +50 -139
  31. package/out/sdk/build-zoning.js.map +1 -1
  32. package/out/sdk/cells.d.ts +21 -62
  33. package/out/sdk/cells.d.ts.map +1 -1
  34. package/out/sdk/cells.js +15 -52
  35. package/out/sdk/cells.js.map +1 -1
  36. package/out/sdk/client.d.ts +23 -67
  37. package/out/sdk/client.d.ts.map +1 -1
  38. package/out/sdk/client.js +29 -77
  39. package/out/sdk/client.js.map +1 -1
  40. package/out/sdk/download.d.ts +7 -27
  41. package/out/sdk/download.d.ts.map +1 -1
  42. package/out/sdk/download.js +8 -28
  43. package/out/sdk/download.js.map +1 -1
  44. package/out/sdk/ingest/chunk.d.ts +19 -43
  45. package/out/sdk/ingest/chunk.d.ts.map +1 -1
  46. package/out/sdk/ingest/chunk.js +19 -52
  47. package/out/sdk/ingest/chunk.js.map +1 -1
  48. package/out/sdk/ingest/worker.d.ts +9 -0
  49. package/out/sdk/ingest/worker.d.ts.map +1 -0
  50. package/out/{scripts/ingest-chunk.js → sdk/ingest/worker.js} +8 -10
  51. package/out/sdk/ingest/worker.js.map +1 -0
  52. package/out/sdk/ingest.d.ts +152 -0
  53. package/out/sdk/ingest.d.ts.map +1 -0
  54. package/out/sdk/ingest.js +200 -0
  55. package/out/sdk/ingest.js.map +1 -0
  56. package/out/sdk/measure-resolutions.d.ts +7 -34
  57. package/out/sdk/measure-resolutions.d.ts.map +1 -1
  58. package/out/sdk/measure-resolutions.js +5 -23
  59. package/out/sdk/measure-resolutions.js.map +1 -1
  60. package/out/sdk/test-kit.d.ts +75 -0
  61. package/out/sdk/test-kit.d.ts.map +1 -0
  62. package/out/{test-kit.js → sdk/test-kit.js} +20 -43
  63. package/out/sdk/test-kit.js.map +1 -0
  64. package/out/sdk/verify.d.ts +79 -80
  65. package/out/sdk/verify.d.ts.map +1 -1
  66. package/out/sdk/verify.js +83 -70
  67. package/out/sdk/verify.js.map +1 -1
  68. package/out/vocabulary.d.ts +52 -120
  69. package/out/vocabulary.d.ts.map +1 -1
  70. package/out/vocabulary.js +47 -125
  71. package/out/vocabulary.js.map +1 -1
  72. package/package.json +38 -162
  73. package/{lib/sdk → sdk}/build-zoning.ts +102 -188
  74. package/{lib/sdk → sdk}/cells.ts +27 -66
  75. package/{lib/sdk → sdk}/client.ts +34 -82
  76. package/sdk/download.ts +58 -0
  77. package/{lib/sdk → sdk}/ingest/chunk.ts +36 -65
  78. package/{lib/scripts/ingest-chunk.ts → sdk/ingest/worker.ts} +7 -9
  79. package/sdk/ingest.ts +354 -0
  80. package/sdk/measure-resolutions.ts +72 -0
  81. package/{lib → sdk}/test-kit.ts +21 -44
  82. package/sdk/verify.ts +367 -0
  83. package/lib/sdk/download.ts +0 -78
  84. package/lib/sdk/index.ts +0 -15
  85. package/lib/sdk/ingest/index.ts +0 -393
  86. package/lib/sdk/measure-resolutions.ts +0 -101
  87. package/lib/sdk/verify.ts +0 -357
  88. package/out/scripts/ingest-chunk.d.ts +0 -11
  89. package/out/scripts/ingest-chunk.d.ts.map +0 -1
  90. package/out/scripts/ingest-chunk.js.map +0 -1
  91. package/out/sdk/index.d.ts +0 -15
  92. package/out/sdk/index.d.ts.map +0 -1
  93. package/out/sdk/index.js +0 -15
  94. package/out/sdk/index.js.map +0 -1
  95. package/out/sdk/ingest/index.d.ts +0 -185
  96. package/out/sdk/ingest/index.d.ts.map +0 -1
  97. package/out/sdk/ingest/index.js +0 -232
  98. package/out/sdk/ingest/index.js.map +0 -1
  99. package/out/test-kit.d.ts +0 -96
  100. package/out/test-kit.d.ts.map +0 -1
  101. package/out/test-kit.js.map +0 -1
@@ -3,40 +3,40 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The two-path agreement check, and its negative half.
6
+ * The check compares the artifact with a second path. A separate half tests locations outside its coverage.
7
7
  *
8
- * POSITIVE HALF. A sample of points is answered from the sealed artifact and then re-asked of the
9
- * Department's own feature service — the same authority, a different distribution channel, and geometry
10
- * this package has never touched. The point test is run again on the service's own rings, so what is
11
- * compared is a verdict against a verdict rather than a file against itself. That is what makes it a check
12
- * on OUR CONVERSION rather than on the authority.
8
+ * The positive half samples points from the sealed artifact and asks the Department's feature service about them.
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.
11
+ * This measures our conversion against the authority's published geometry.
13
12
  *
14
- * AND THE SERVICE ANSWERS IN THE PUBLISHER'S OWN RING CONVENTION, so the comparison exercises the hole
15
- * handling twice over. `outSR=4326` on the query path returns the same clockwise-exterior rings the bulk
16
- * export carries, so this side re-derives the roles the same way the ingest did — and a point inside a hole
17
- * comes back OUTSIDE on both paths or on neither.
13
+ * The service returns geometry in the publisher's ring convention. `outSR=4326` returns the same clockwise-exterior
14
+ * rings as the bulk export. This path re-derives ring roles as ingest does. A point inside a hole then falls outside
15
+ * on both paths or inside on both paths.
18
16
  *
19
- * NEGATIVE HALF, AND IT MATTERS MORE HERE THAN FOR ANY SIBLING LAYER. Donegal is the one local authority of
20
- * 31 the Department does not publish, and Northern Ireland is outside the product entirely — so points in
21
- * both must come back `unknown` with NO designation. A positive-only check would pass on an artifact that
22
- * reported the whole island as zoned, and this layer's entire coverage posture exists because an absent
23
- * polygon is not a statement.
17
+ * The negative half checks locations outside the publication area. The Department omits Donegal, one of 31 local
18
+ * authorities. The product also excludes Northern Ireland. Points in both areas must return `unknown` with no
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.
24
21
  *
25
- * THE CHANNELS DIFFER IN COORDINATE PRECISION AND THAT IS WHY A BOUNDARY POINT IS NOT A FAILURE. The
26
- * archive publishes nine decimals through this package's ingest; the service's own JSON rounds. A point
27
- * within roughly a metre of a zone boundary can land on opposite sides of two renderings of the same edge.
28
- * Those are reported as `boundary_tolerance` with their distance to the nearest edge, and the count is part
29
- * of the receipt.
22
+ * The channels use different coordinate precision. A boundary-point disagreement therefore does not establish a
23
+ * conversion defect. The archive publishes nine decimals through this package's ingest. The service rounds its JSON.
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.
30
26
  *
31
- * THE DISTANCE IS TO THE EDGE, NOT TO THE NEAREST VERTEX. A point a centimetre from a long edge can be
32
- * metres from every vertex of it — a sibling layer's one near-miss read 1.58 m to vertices and 0.009 m to
33
- * edges, an overstatement of 175-fold — so measuring vertices makes the boundary tolerance far stricter than
34
- * it reads, which is how a rendering difference gets reported as a conversion defect.
27
+ * The distance measures to the edge rather than to the nearest vertex. A point a centimeter from a long edge can be
28
+ * meters from every vertex. In one sibling-layer near-miss, vertex distance measured 1.58 m and edge distance
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.
35
31
  */
32
+ import type { OGCFeature } from "@mailwoman/core/api";
33
+ import type { OutsideCoverageRow } from "@mailwoman/core/layers";
34
+ import type { PathBuilderLike } from "path-ts";
36
35
  import { type ZoningReading } from "#index";
37
36
  import type { GZTClient } from "#sdk/client";
38
37
  /**
39
- * One point, both verdicts, and whether they agree.
38
+ * Records one point and both verdicts.
39
+ * It also records whether they agree.
40
40
  */
41
41
  export interface AgreementRow {
42
42
  label: string;
@@ -51,34 +51,25 @@ export interface AgreementRow {
51
51
  */
52
52
  serviceInside: boolean;
53
53
  /**
54
- * The local code the SERVICE reports at the point, where it reports one. Compared verbatim against the artifact's,
55
- * because carrying the code verbatim is what this layer is for: two paths that agree on containment and disagree on
56
- * the code would be a silent vocabulary defect.
57
- */
58
- serviceLocalCode?: string;
59
- outcome: "agree" | "disagree" | "boundary_tolerance";
60
- /**
61
- * Metres from the point to the nearest EDGE of any polygon the service returned nearby.
54
+ * The local code the service reports at the point, where it reports one.
62
55
  *
63
- * Carried on every row rather than only the tolerated ones, because it is what separates a real defect from the two
64
- * channels rendering the same edge differently — and a receipt that omits it forces a re-run. `undefined` means the
65
- * service returned no polygon at all near the point.
56
+ * Compared verbatim against the artifact's, because carrying the code verbatim
57
+ * is what this layer is for: two paths that agree on containment and disagree
58
+ * on the code would be a silent vocabulary defect.
66
59
  */
67
- nearestEdgeMetres?: number;
68
- }
69
- /**
70
- * The negative half: a point this product's publication does not reach.
71
- */
72
- export interface OutsideRow {
73
- label: string;
74
- latitude: number;
75
- longitude: number;
76
- kind: string;
77
- designations: number;
60
+ serviceLocalCode: string | null;
61
+ result: "agree" | "disagree" | "boundary_tolerance";
78
62
  /**
79
- * True when the artifact answered `unknown` with no designation — the only acceptable reading here.
63
+ * Meters from the point to the nearest edge of any polygon the service returned nearby.
64
+ *
65
+ * Every row includes this distance.
66
+ * It separates a real defect from a difference caused by the two channels
67
+ * rendering the same edge differently.
68
+ *
69
+ * A receipt without it forces a re-run.
70
+ * `null` means the service returned no polygon at all near the point.
80
71
  */
81
- passed: boolean;
72
+ nearestEdgeMetres: number | null;
82
73
  }
83
74
  export interface VerifyZoningResult {
84
75
  agreement: AgreementRow[];
@@ -89,16 +80,22 @@ export interface VerifyZoningResult {
89
80
  * Points where both paths placed the location inside a zone and the local codes differed.
90
81
  */
91
82
  codeMismatches: number;
92
- outside: OutsideRow[];
83
+ outside: OutsideCoverageRow[];
93
84
  outsidePassed: number;
94
85
  }
95
86
  /**
96
- * Points this product's publication does not reach, named. Each is a place, not a bare pair of numbers: a coordinate a
97
- * reader cannot name is a coordinate nobody can check.
87
+ * Point identifiers for locations outside this product's publication area.
88
+ *
89
+ * Each is a place rather than a bare pair of numbers: a coordinate a reader a
90
+ * coordinate without a reference source cannot be checked.
91
+ *
92
+ * The check requires points from two populations.
93
+ * The Donegal points are the case this layer's coverage posture exists for.
94
+ *
95
+ * The Department has not published that authority's zoning.
96
+ * A builder that reads the absence as "unrestricted" would answer these points confidently.
98
97
  *
99
- * TWO POPULATIONS, AND BOTH ARE LOAD-BEARING. The Donegal points are the case this layer's coverage posture exists for
100
- * — the Department has not published that authority's zoning, and a builder that read absence as "unrestricted" would
101
- * answer them confidently. The Northern Irish points confirm the artifact is clipped to the Republic rather than to the
98
+ * The Northern Irish points confirm the artifact is clipped to the Republic rather than to the
102
99
  * island: zoning there is a different jurisdiction's instrument under a different planning act.
103
100
  */
104
101
  export declare const OUTSIDE_PUBLICATION_POINTS: ReadonlyArray<{
@@ -107,37 +104,38 @@ export declare const OUTSIDE_PUBLICATION_POINTS: ReadonlyArray<{
107
104
  longitude: number;
108
105
  }>;
109
106
  /**
110
- * One feature as the service publishes it — the only shape the comparison reads.
107
+ * One feature as the service publishes it.
108
+ * The only shape the comparison reads.
111
109
  */
112
- export interface ServiceFeature {
113
- properties?: Record<string, unknown>;
114
- geometry?: {
115
- type: string;
116
- coordinates: unknown;
117
- };
118
- }
110
+ export type ServiceFeature = OGCFeature;
119
111
  /**
120
- * The ONE call the verification makes against the service: the features it publishes near a point.
112
+ * The one call the verification makes against the service: the features it publishes near a point.
113
+ *
114
+ * The function exposes only the service read.
115
+ * This keeps the check's own logic testable.
121
116
  *
122
- * A function rather than the client, and that is what makes the check's own logic testable. The comparison's value is
123
- * that it decides which of three outcomes a point gets; expressed against an HTTP client it could only ever be watched
124
- * on a live run, and a scripted reader lets those decisions be pinned. {@link createServiceReader} builds the real
125
- * one.
117
+ * The comparison's value is that it decides which of three results a point gets.
118
+ *
119
+ * An HTTP client would let tests observe these decisions only during a live run.
120
+ * A scripted reader pins the decisions. {@link createServiceReader} builds the real reader.
126
121
  */
127
122
  export type ServiceFeatureReader = (latitude: number, longitude: number) => Promise<ServiceFeature[]>;
128
123
  /**
129
124
  * The reader the live check uses: a bounding-box query against the Department's own service.
130
125
  *
131
- * The service answers a BOX, not a point, so this returns what it published nearby and the containment decision is made
132
- * in {@link readServiceContainment} against those rings — comparing the artifact's verdict against a bare "the service
133
- * returned something here" would pass on any polygon within eleven metres.
126
+ * The service answers a BOX rather than a point, so this returns what it published nearby
127
+ * and the containment decision is made in {@link readServiceContainment} against
128
+ * those rings — comparing the artifact's verdict against a bare "the service returned
129
+ * something here" would pass on any polygon within eleven meters.
134
130
  */
135
131
  export declare function createServiceReader(client: Pick<GZTClient, "readFeaturesNear">): ServiceFeatureReader;
136
132
  export interface VerifyZoningOptions {
137
- databasePath: string;
133
+ databasePath: PathBuilderLike;
138
134
  readServiceFeatures: ServiceFeatureReader;
139
135
  /**
140
- * Points to re-ask the service about. A caller samples them from the artifact — see {@link sampleAgreementPoints}.
136
+ * Points to re-ask the service about.
137
+ *
138
+ * A caller samples them from the artifact — see {@link sampleAgreementPoints}.
141
139
  */
142
140
  points: ReadonlyArray<{
143
141
  label: string;
@@ -157,15 +155,16 @@ export interface VerifyZoningOptions {
157
155
  */
158
156
  export declare function verifyZoningDatabase(options: VerifyZoningOptions): Promise<VerifyZoningResult>;
159
157
  /**
160
- * Draw a reproducible sample of points from the artifact — interior points of stored polygons, spread across
161
- * authorities.
158
+ * Draw a reproducible sample of points from the artifact — interior points of
159
+ * stored polygons, spread across authorities.
162
160
  *
163
- * SPREAD ACROSS AUTHORITIES RATHER THAN DRAWN FROM ONE, because 30 local authorities publish 581 distinct local codes
164
- * between them and a sample from one would verify one authority's conversion while reporting on all of them. The stride
165
- * discipline — keys chosen before any geometry is read, deterministic rather than random — is
166
- * `strideSampleInteriorPoints`'s.
161
+ * Spread across authorities rather than drawn from one, because 30 local authorities
162
+ * publish 581 distinct local codes between them and a sample from one would verify
163
+ * one authority's conversion while reporting on all of them.
164
+ * The stride discipline — keys chosen before any geometry is read, deterministic
165
+ * rather than random — is `strideSampleInteriorPoints`'s.
167
166
  */
168
- export declare function sampleAgreementPoints(databasePath: string, options?: {
167
+ export declare function sampleAgreementPoints(databasePath: PathBuilderLike, options?: {
169
168
  count?: number;
170
169
  }): Array<{
171
170
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../lib/sdk/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAYH,OAAO,EAAmC,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAA;AAG5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,KAAK,EAAE,aAAa,CAAA;IACpB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAA;IACtB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,E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oBAAoB,CAErG;AAED,MAAM,WAAW,mBAAmB;IACnC,YAAY,EAAE,eAAe,CAAA;IAC7B,mBAAmB,EAAE,oBAAoB,CAAA;IACzC;;;;OAIG;IACH,MAAM,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACjG,aAAa,CAAC,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACrF,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACtC;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA2DpG;AA6DD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACpC,YAAY,EAAE,eAAe,EAC7B,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAC9B,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAwClF"}
package/out/sdk/verify.js CHANGED
@@ -3,47 +3,50 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The two-path agreement check, and its negative half.
6
+ * The check compares the artifact with a second path. A separate half tests locations outside its coverage.
7
7
  *
8
- * POSITIVE HALF. A sample of points is answered from the sealed artifact and then re-asked of the
9
- * Department's own feature service — the same authority, a different distribution channel, and geometry
10
- * this package has never touched. The point test is run again on the service's own rings, so what is
11
- * compared is a verdict against a verdict rather than a file against itself. That is what makes it a check
12
- * on OUR CONVERSION rather than on the authority.
8
+ * The positive half samples points from the sealed artifact and asks the Department's feature service about them.
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.
11
+ * This measures our conversion against the authority's published geometry.
13
12
  *
14
- * AND THE SERVICE ANSWERS IN THE PUBLISHER'S OWN RING CONVENTION, so the comparison exercises the hole
15
- * handling twice over. `outSR=4326` on the query path returns the same clockwise-exterior rings the bulk
16
- * export carries, so this side re-derives the roles the same way the ingest did — and a point inside a hole
17
- * comes back OUTSIDE on both paths or on neither.
13
+ * The service returns geometry in the publisher's ring convention. `outSR=4326` returns the same clockwise-exterior
14
+ * rings as the bulk export. This path re-derives ring roles as ingest does. A point inside a hole then falls outside
15
+ * on both paths or inside on both paths.
18
16
  *
19
- * NEGATIVE HALF, AND IT MATTERS MORE HERE THAN FOR ANY SIBLING LAYER. Donegal is the one local authority of
20
- * 31 the Department does not publish, and Northern Ireland is outside the product entirely — so points in
21
- * both must come back `unknown` with NO designation. A positive-only check would pass on an artifact that
22
- * reported the whole island as zoned, and this layer's entire coverage posture exists because an absent
23
- * polygon is not a statement.
17
+ * The negative half checks locations outside the publication area. The Department omits Donegal, one of 31 local
18
+ * authorities. The product also excludes Northern Ireland. Points in both areas must return `unknown` with no
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.
24
21
  *
25
- * THE CHANNELS DIFFER IN COORDINATE PRECISION AND THAT IS WHY A BOUNDARY POINT IS NOT A FAILURE. The
26
- * archive publishes nine decimals through this package's ingest; the service's own JSON rounds. A point
27
- * within roughly a metre of a zone boundary can land on opposite sides of two renderings of the same edge.
28
- * Those are reported as `boundary_tolerance` with their distance to the nearest edge, and the count is part
29
- * of the receipt.
22
+ * The channels use different coordinate precision. A boundary-point disagreement therefore does not establish a
23
+ * conversion defect. The archive publishes nine decimals through this package's ingest. The service rounds its JSON.
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.
30
26
  *
31
- * THE DISTANCE IS TO THE EDGE, NOT TO THE NEAREST VERTEX. A point a centimetre from a long edge can be
32
- * metres from every vertex of it — a sibling layer's one near-miss read 1.58 m to vertices and 0.009 m to
33
- * edges, an overstatement of 175-fold — so measuring vertices makes the boundary tolerance far stricter than
34
- * it reads, which is how a rendering difference gets reported as a conversion defect.
27
+ * The distance measures to the edge rather than to the nearest vertex. A point a centimeter from a long edge can be
28
+ * meters from every vertex. In one sibling-layer near-miss, vertex distance measured 1.58 m and edge distance
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.
35
31
  */
32
+ import { stringifyJSON } from "@mailwoman/core/json";
36
33
  import { nearestRingEdgeMetres, pointInEncodedRings, strideSampleInteriorPoints, encodeRings, } from "@mailwoman/spatial";
37
34
  import { DatabaseClient } from "@mailwoman/sqlite/client";
38
35
  import { ZoningLookup, ZoningReadingKind } from "#index";
39
36
  import { resolveRingRoles } from "#rings";
40
37
  /**
41
- * Points this product's publication does not reach, named. Each is a place, not a bare pair of numbers: a coordinate a
42
- * reader cannot name is a coordinate nobody can check.
38
+ * Point identifiers for locations outside this product's publication area.
43
39
  *
44
- * TWO POPULATIONS, AND BOTH ARE LOAD-BEARING. The Donegal points are the case this layer's coverage posture exists for
45
- * — the Department has not published that authority's zoning, and a builder that read absence as "unrestricted" would
46
- * answer them confidently. The Northern Irish points confirm the artifact is clipped to the Republic rather than to the
40
+ * Each is a place rather than a bare pair of numbers: a coordinate a reader a
41
+ * coordinate without a reference source cannot be checked.
42
+ *
43
+ * The check requires points from two populations.
44
+ * The Donegal points are the case this layer's coverage posture exists for.
45
+ *
46
+ * The Department has not published that authority's zoning.
47
+ * A builder that reads the absence as "unrestricted" would answer these points confidently.
48
+ *
49
+ * The Northern Irish points confirm the artifact is clipped to the Republic rather than to the
47
50
  * island: zoning there is a different jurisdiction's instrument under a different planning act.
48
51
  */
49
52
  export const OUTSIDE_PUBLICATION_POINTS = [
@@ -55,25 +58,30 @@ export const OUTSIDE_PUBLICATION_POINTS = [
55
58
  { label: "Enniskillen, Northern Ireland", latitude: 54.3438, longitude: -7.6316 },
56
59
  ];
57
60
  /**
58
- * Half-width of the bounding box the service is asked for, in degrees. About 11 m at this latitude — wide enough that a
59
- * polygon containing the point is certainly returned, narrow enough that the response stays small.
61
+ * Half-width of the bounding box the service is asked for, in degrees.
62
+ *
63
+ * About 11 m at this latitude — wide enough that a polygon containing the point is
64
+ * certainly returned, narrow enough that the response stays small.
60
65
  */
61
66
  const PROBE_HALF_WIDTH_DEGREES = 0.0001;
62
67
  /**
63
- * How close to a service-polygon edge a disagreement is attributed to the channels' differing coordinate precision
64
- * rather than to the conversion.
68
+ * How close to a service-polygon edge a disagreement is attributed to the channels'
69
+ * differing coordinate precision rather than to the conversion.
70
+ *
71
+ * Half a meter.
72
+ * The two channels render the same edge from the same source coordinates through different
73
+ * rounding, so a point between the two renderings lands on opposite sides.
65
74
  *
66
- * Half a metre. The two channels render the same edge from the same source coordinates through different rounding, so a
67
- * point between the two renderings lands on opposite sides; half a metre is far below any real zoning boundary and far
68
- * above the rounding difference.
75
+ * Half a meter is far below any real zoning boundary and far above the rounding difference.
69
76
  */
70
77
  const BOUNDARY_TOLERANCE_METRES = 0.5;
71
78
  /**
72
79
  * The reader the live check uses: a bounding-box query against the Department's own service.
73
80
  *
74
- * The service answers a BOX, not a point, so this returns what it published nearby and the containment decision is made
75
- * in {@link readServiceContainment} against those rings — comparing the artifact's verdict against a bare "the service
76
- * returned something here" would pass on any polygon within eleven metres.
81
+ * The service answers a BOX rather than a point, so this returns what it published nearby
82
+ * and the containment decision is made in {@link readServiceContainment} against
83
+ * those rings — comparing the artifact's verdict against a bare "the service returned
84
+ * something here" would pass on any polygon within eleven meters.
77
85
  */
78
86
  export function createServiceReader(client) {
79
87
  return async (latitude, longitude) => client.readFeaturesNear(latitude, longitude, PROBE_HALF_WIDTH_DEGREES);
@@ -89,16 +97,16 @@ export async function verifyZoningDatabase(options) {
89
97
  const local = lookup.lookup(point.latitude, point.longitude);
90
98
  const service = await readServiceContainment(options.readServiceFeatures, point.latitude, point.longitude);
91
99
  const localInside = local.kind === ZoningReadingKind.Designated;
92
- const nearEdge = service.nearestEdgeMetres !== undefined && service.nearestEdgeMetres <= BOUNDARY_TOLERANCE_METRES;
100
+ const nearEdge = service.nearestEdgeMetres !== null && service.nearestEdgeMetres <= BOUNDARY_TOLERANCE_METRES;
93
101
  agreement.push({
94
102
  label: point.label,
95
103
  latitude: point.latitude,
96
104
  longitude: point.longitude,
97
105
  local,
98
106
  serviceInside: service.inside,
99
- ...(service.localCode === undefined ? {} : { serviceLocalCode: service.localCode }),
100
- outcome: localInside === service.inside ? "agree" : nearEdge ? "boundary_tolerance" : "disagree",
101
- ...(service.nearestEdgeMetres === undefined ? {} : { nearestEdgeMetres: service.nearestEdgeMetres }),
107
+ serviceLocalCode: service.localCode,
108
+ result: localInside === service.inside ? "agree" : nearEdge ? "boundary_tolerance" : "disagree",
109
+ nearestEdgeMetres: service.nearestEdgeMetres,
102
110
  });
103
111
  options.onProgress?.(`${agreement.length}/${options.points.length} points compared`);
104
112
  }
@@ -116,12 +124,12 @@ export async function verifyZoningDatabase(options) {
116
124
  }
117
125
  return {
118
126
  agreement,
119
- agreed: agreement.filter((row) => row.outcome === "agree").length,
120
- disagreed: agreement.filter((row) => row.outcome === "disagree").length,
121
- boundaryTolerance: agreement.filter((row) => row.outcome === "boundary_tolerance").length,
122
- codeMismatches: agreement.filter((row) => row.outcome === "agree" &&
127
+ agreed: agreement.filter((row) => row.result === "agree").length,
128
+ disagreed: agreement.filter((row) => row.result === "disagree").length,
129
+ boundaryTolerance: agreement.filter((row) => row.result === "boundary_tolerance").length,
130
+ codeMismatches: agreement.filter((row) => row.result === "agree" &&
123
131
  row.serviceInside &&
124
- row.serviceLocalCode !== undefined &&
132
+ row.serviceLocalCode !== null &&
125
133
  !row.local.designations.some((designation) => designation.localCode === row.serviceLocalCode)).length,
126
134
  outside,
127
135
  outsidePassed: outside.filter((row) => row.passed).length,
@@ -132,14 +140,15 @@ export async function verifyZoningDatabase(options) {
132
140
  }
133
141
  }
134
142
  /**
135
- * Whether the SERVICE's own geometry contains the point, decided here with the same ring-role resolution and the same
136
- * even-odd rule the artifact's reader uses — so what is compared is a verdict against a verdict.
143
+ * Whether the service's own geometry contains the point, decided here with the same
144
+ * ring-role resolution and the same even-odd rule the artifact's reader uses.
145
+ * So what is compared is a verdict against a verdict.
137
146
  */
138
147
  async function readServiceContainment(readServiceFeatures, latitude, longitude) {
139
148
  const features = await readServiceFeatures(latitude, longitude);
140
149
  let nearest = Infinity;
141
150
  let inside = false;
142
- let localCode;
151
+ let localCode = null;
143
152
  for (const feature of features) {
144
153
  const geometry = feature.geometry;
145
154
  if (!geometry)
@@ -151,49 +160,53 @@ async function readServiceContainment(readServiceFeatures, latitude, longitude)
151
160
  if (distance < nearest) {
152
161
  nearest = distance;
153
162
  }
154
- // THE SERVICE'S RINGS GET THE SAME ROLE RESOLUTION THE INGEST GAVE THE ARCHIVE'S. The publisher uses one convention on
155
- // both channels, so reading this side as nested GeoJSON would answer "inside" for a point in a hole and report the
156
- // artifact as wrong at exactly the locations the hole handling exists for.
163
+ // the service'S rings GET the same role resolution the ingest gave the archive'S.
164
+ // The publisher uses one convention on both channels, so reading this side as nested
165
+ // GeoJSON would answer "inside" for a point in a hole and report the artifact as
166
+ // wrong at exactly the locations the hole handling exists for.
157
167
  const resolved = resolveRingRoles(raw, `service feature near ${latitude},${longitude}`);
158
- // ENCODED AND RE-READ RATHER THAN RAY-CAST DIRECTLY, deliberately: the artifact answers through
159
- // `pointInEncodedRings`, and running the service's geometry through a different predicate would compare two answers
160
- // that were never asked the same question.
168
+ // encoded and RE-read rather than RAY-cast directly, deliberately: the artifact answers
169
+ // through `pointInEncodedRings`, and running the service's geometry through a different
170
+ // predicate would compare two answers that were never asked the same question.
161
171
  if (pointInEncodedRings(encodeRings(resolved.polygons), longitude, latitude)) {
162
172
  inside = true;
163
173
  const code = feature.properties?.ZONE_ORIG;
164
- if (typeof code === "string" && localCode === undefined) {
174
+ if (typeof code === "string" && !localCode) {
165
175
  localCode = code;
166
176
  }
167
177
  }
168
178
  }
169
179
  return {
170
180
  inside,
171
- ...(localCode === undefined ? {} : { localCode }),
172
- ...(Number.isFinite(nearest) ? { nearestEdgeMetres: nearest } : {}),
181
+ localCode,
182
+ nearestEdgeMetres: Number.isFinite(nearest) ? nearest : null,
173
183
  };
174
184
  }
175
185
  /**
176
- * Draw a reproducible sample of points from the artifact — interior points of stored polygons, spread across
177
- * authorities.
186
+ * Draw a reproducible sample of points from the artifact — interior points of
187
+ * stored polygons, spread across authorities.
178
188
  *
179
- * SPREAD ACROSS AUTHORITIES RATHER THAN DRAWN FROM ONE, because 30 local authorities publish 581 distinct local codes
180
- * between them and a sample from one would verify one authority's conversion while reporting on all of them. The stride
181
- * discipline — keys chosen before any geometry is read, deterministic rather than random — is
182
- * `strideSampleInteriorPoints`'s.
189
+ * Spread across authorities rather than drawn from one, because 30 local authorities
190
+ * publish 581 distinct local codes between them and a sample from one would verify
191
+ * one authority's conversion while reporting on all of them.
192
+ * The stride discipline — keys chosen before any geometry is read, deterministic
193
+ * rather than random — is `strideSampleInteriorPoints`'s.
183
194
  */
184
195
  export function sampleAgreementPoints(databasePath, options = {}) {
185
196
  const count = options.count ?? 48;
186
197
  using database = new DatabaseClient(databasePath, { readOnly: true });
187
- // ORDERED BY THE AUTHORITY FIRST, so a stride walks across the 30 of them rather than down one. A stride over
188
- // `area_id` alone would follow the publisher's own feature numbering, which is grouped by authority — and would draw
189
- // every sample from whichever authorities happen to sit on the stride.
198
+ // Sort by authority so the stride samples across the 30 authorities
199
+ // instead of sampling one authority repeatedly.
200
+ // A stride over `area_id` by itself would follow the publisher's feature numbering.
201
+ // That numbering is grouped by authority, so the stride would select only the
202
+ // authorities that fall on its positions.
190
203
  const areaIDs = database.prepare("SELECT area_id FROM zoning_area ORDER BY jurisdiction_id, area_id").all().map((row) => row.area_id);
191
204
  const selectArea = database.prepare("SELECT area_id, jurisdiction_id, local_code, min_lat, min_lon, max_lat, max_lon, rings FROM zoning_area WHERE area_id = ?");
192
205
  return strideSampleInteriorPoints(areaIDs, count, {
193
206
  fetch: (key) => selectArea.get(key),
194
207
  gridSteps: 17,
195
208
  toPoint: (area, interior) => ({
196
- label: `${area.jurisdiction_id} ${JSON.stringify(area.local_code)} polygon ${area.area_id}`,
209
+ label: `${area.jurisdiction_id} ${stringifyJSON(area.local_code)} polygon ${area.area_id}`,
197
210
  localCode: area.local_code,
198
211
  ...interior,
199
212
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"verify.js","sourceRoot":"","sources":["../../lib/sdk/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACN,qBAAqB,EACrB,mBAAmB,EACnB,0BAA0B,EAC1B,WAAW,GAGX,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAsB,MAAM,QAAQ,CAAA;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAgEzC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAA0E;IAChH,EAAE,KAAK,EAAE,kCAAkC,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE;IACpF,EAAE,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE;IACrE,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE;IAChE,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