@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/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIN,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAYnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAY9C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7D;;GAEG;AACH,eAAO,MAAM,iBAAiB;IAC7B;;OAEG;aACH,UAAU,EAAE,YAAY;IACxB;;OAEG;aACH,OAAO,EAAE,SAAS;CACT,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAA;AAE1F;;GAEG;AACH,eAAO,MAAM,qBAAqB;IACjC;;OAEG;aACH,SAAS,EAAE,YAAY;IACvB;;OAEG;aACH,OAAO,EAAE,UAAU;IACnB;;OAEG;aACH,UAAU,EAAE,cAAc;CACjB,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,q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AchE;IAEM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAE9B;CA+HD"}
|
package/out/index.js
CHANGED
|
@@ -3,50 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* authority's own vocabulary, and on what basis.
|
|
8
|
-
*
|
|
9
|
-
* TWO READINGS, AND THE ONE THAT IS MISSING IS THE POINT.
|
|
10
|
-
*
|
|
11
|
-
* 1. `designated` — an adopted plan places the location inside a zoning polygon, and the polygon is the
|
|
12
|
-
* answer: the authority's own code, its own description, the plan it belongs to and that plan's stated
|
|
13
|
-
* window, with the Department's national generic type BESIDE the local code rather than instead of it.
|
|
14
|
-
* 2. `unknown` — no polygon contains the point. THAT IS NOT AN ABSENCE READING, and this layer has none.
|
|
15
|
-
*
|
|
16
|
-
* THERE IS NO `designated_absence` HERE, AND ZONING IS THE HARDEST CASE OF THE RULE. For flood zones the
|
|
17
|
-
* Environment Agency states England-wide coverage and the Planning Practice Guidance defines Zone 1 as the
|
|
18
|
-
* land outside Zones 2 and 3, so an empty answer inside England IS a designation. No such definition exists
|
|
19
|
-
* anywhere for zoning: a location with no zoning polygon is outside any adopted plan area, or inside one on
|
|
20
|
-
* land the plan does not zone, or in a jurisdiction that has never adopted zoning, or in a jurisdiction
|
|
21
|
-
* whose records nobody has published — and no product distinguishes them. The source itself proves the
|
|
22
|
-
* asymmetry: it states `UNZ - Unzoned` as a POSITIVE value on 4 of 85,330 rows, so where the authority
|
|
23
|
-
* means unzoned it says so, and every other absence is a row that is not there.
|
|
24
|
-
*
|
|
25
|
-
* SO THE CONSTRUCTOR REFUSES A COVERAGE ROW THAT WOULD SUPPORT AN EXCLUSION. Every row must read
|
|
26
|
-
* `source_present`; `supportsExclusion` must be false for all of them. That is not a convention this reader
|
|
27
|
-
* follows — it is a condition it checks at open time, so the day someone writes a stronger basis without
|
|
28
|
-
* settling the footprint question, the layer refuses to open rather than answering confidently.
|
|
29
|
-
*
|
|
30
|
-
* NEITHER READING IS A STATEMENT ABOUT WHAT MAY BE BUILT. The layer reports what a plan assigns at a
|
|
31
|
-
* location, which is a fact about the plan. The Department states that its data are "not published here as
|
|
32
|
-
* legal definitions of the current actuality with regard to Local Authority zoning or their geographic
|
|
33
|
-
* extents" and that "Original data should be sourced directly from the relevant Local Authority" — and
|
|
34
|
-
* `limits` carries the authority's own exclusions on every answer.
|
|
35
|
-
*
|
|
36
|
-
* THE PLAN IS PART OF THE CLAIM, NEVER A PARAMETER OF IT. A zone exists inside a named Development Plan or
|
|
37
|
-
* Local Area Plan with a stated validity window; a reading that dropped the plan would answer a question no
|
|
38
|
-
* authority asked. And `currentPlan = 1` means "not superseded", not "in force today": 2,363 of 85,330 rows
|
|
39
|
-
* carry a `validTo` already in the past, so the window travels on every reading and the comparison against a
|
|
40
|
-
* date is the caller's, made against a clock this reader does not own.
|
|
41
|
-
*
|
|
42
|
-
* THE PROBE IS STRUCTURE FIRST, GEOMETRY LAST. `cellToParent` up the compacted whole-cell chain answers an
|
|
43
|
-
* interior point with primary-key probes alone; only a cell a boundary crosses reaches the ray cast, and
|
|
44
|
-
* then only against the polygons `zoning_cell` already named for that cell.
|
|
45
|
-
*
|
|
46
|
-
* THE READER IS SYNCHRONOUS AND USES RAW PREPARED STATEMENTS, for the same reason the sibling layer readers
|
|
47
|
-
* are: it answers one point per geocode with a bounded number of primary-key probes plus a bounded geometry
|
|
48
|
-
* read, and the ray cast it wraps is synchronous anyway. The DDL that created these tables IS Kysely — see
|
|
49
|
-
* `schema.ts`.
|
|
6
|
+
* Synchronous reader for `zoning-ireland.db` that returns the zoning an adopted local plan assigns at a coordinate.
|
|
50
7
|
*/
|
|
51
8
|
import { assertCoverageLicensesNoExclusion, assertNoCellsFinerThanIndex, parseManifestRows, } from "@mailwoman/core/layers";
|
|
52
9
|
import { CoverageBasis } from "@mailwoman/evidence";
|
|
@@ -58,7 +15,7 @@ import { ZoningCellContainment } from "#schema";
|
|
|
58
15
|
import { GZT_COVERAGE_LIMIT, GZT_CROSSWALK_SCHEME, GZT_LAYER_NAME, GZT_PRODUCT_LIMITS, GZT_UNZONED_LOCAL_CODE, } from "#vocabulary";
|
|
59
16
|
export { GZT_LAYER_NAME, ProvenanceGrade } from "#vocabulary";
|
|
60
17
|
/**
|
|
61
|
-
*
|
|
18
|
+
* The kinds of answer the layer gives for a coordinate.
|
|
62
19
|
*/
|
|
63
20
|
export const ZoningReadingKind = {
|
|
64
21
|
/**
|
|
@@ -66,35 +23,32 @@ export const ZoningReadingKind = {
|
|
|
66
23
|
*/
|
|
67
24
|
Designated: "designated",
|
|
68
25
|
/**
|
|
69
|
-
* No zoning polygon contains the point
|
|
26
|
+
* No zoning polygon contains the point — this kind never means the location is unzoned.
|
|
70
27
|
*/
|
|
71
28
|
Unknown: "unknown",
|
|
72
29
|
};
|
|
73
30
|
/**
|
|
74
|
-
* How
|
|
31
|
+
* How the lookup established containment.
|
|
75
32
|
*/
|
|
76
33
|
export const ZoningContainmentPath = {
|
|
77
34
|
/**
|
|
78
|
-
* The cell lies wholly inside the zone
|
|
35
|
+
* The cell lies wholly inside the zone, so no geometry was read.
|
|
79
36
|
*/
|
|
80
37
|
WholeCell: "whole_cell",
|
|
81
38
|
/**
|
|
82
|
-
*
|
|
39
|
+
* A boundary crosses the cell, so the point was ray-cast against the cell's polygons.
|
|
83
40
|
*/
|
|
84
41
|
RayCast: "ray_cast",
|
|
85
42
|
/**
|
|
86
|
-
* No zone reaches this cell
|
|
43
|
+
* No zone reaches this cell.
|
|
87
44
|
*/
|
|
88
45
|
NoZoneCell: "no_zone_cell",
|
|
89
46
|
};
|
|
90
47
|
/**
|
|
91
|
-
*
|
|
48
|
+
* Reads a sealed `zoning-ireland.db`.
|
|
92
49
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* support an exclusion, an empty jurisdiction table. Each of those would otherwise present as a reader that quietly
|
|
96
|
-
* always answers `unknown` — or, in the exclusion case, as a reader that confidently reports unzoned-and-unmapped land
|
|
97
|
-
* as free of restriction.
|
|
50
|
+
* The constructor throws on a manifest for a different layer, an empty coverage table,
|
|
51
|
+
* a coverage basis that supports exclusion or an empty jurisdiction table.
|
|
98
52
|
*/
|
|
99
53
|
export class ZoningLookup {
|
|
100
54
|
identity;
|
|
@@ -108,7 +62,7 @@ export class ZoningLookup {
|
|
|
108
62
|
constructor(options) {
|
|
109
63
|
this.#database = new DatabaseClient(options.databasePath, { readOnly: true });
|
|
110
64
|
try {
|
|
111
|
-
this.identity = readIdentity(this.#database, options.databasePath);
|
|
65
|
+
this.identity = readIdentity(this.#database, options.databasePath.toString());
|
|
112
66
|
this.#crosswalkTerms = readCrosswalkTerms(this.#database);
|
|
113
67
|
}
|
|
114
68
|
catch (error) {
|
|
@@ -116,10 +70,9 @@ export class ZoningLookup {
|
|
|
116
70
|
throw error;
|
|
117
71
|
}
|
|
118
72
|
this.#selectCell = this.#database.prepare("SELECT area_id, containment FROM zoning_cell WHERE h3_cell = ?");
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
// all.
|
|
73
|
+
// Read without the ring blob.
|
|
74
|
+
// The bounding box rejects most polygons before the ray cast needs rings.
|
|
75
|
+
// A whole cell never reads the blob.
|
|
123
76
|
this.#selectArea = this.#database.prepare("SELECT area_id, jurisdiction_id, plan_id, local_code, local_description, local_code_url, crosswalk_code, " +
|
|
124
77
|
"crosswalk_scheme, crosswalk_description, crosswalk_rollup, provenance_grade, min_lat, min_lon, max_lat, max_lon " +
|
|
125
78
|
"FROM zoning_area WHERE area_id = ?");
|
|
@@ -128,7 +81,7 @@ export class ZoningLookup {
|
|
|
128
81
|
this.#selectCoverage = this.#database.prepare("SELECT h3_cell, completeness, basis, observed_rows FROM layer_coverage WHERE h3_cell = ?");
|
|
129
82
|
}
|
|
130
83
|
/**
|
|
131
|
-
*
|
|
84
|
+
* Returns what an adopted plan assigns at this coordinate.
|
|
132
85
|
*/
|
|
133
86
|
lookup(latitude, longitude) {
|
|
134
87
|
const indexCell = latLngToCell(latitude, longitude, this.identity.indexResolution);
|
|
@@ -148,13 +101,13 @@ export class ZoningLookup {
|
|
|
148
101
|
this.#database.destroy();
|
|
149
102
|
}
|
|
150
103
|
/**
|
|
151
|
-
*
|
|
104
|
+
* Returns the coverage row for the index cell's parent at the coverage resolution.
|
|
152
105
|
*/
|
|
153
106
|
#readCoverage(indexCell) {
|
|
154
107
|
return readCoverageAt(this.#selectCoverage, indexCell, this.identity.coverageResolution);
|
|
155
108
|
}
|
|
156
109
|
/**
|
|
157
|
-
*
|
|
110
|
+
* Walks the cell index up the ancestor chain and reads geometry only for cells that a boundary crosses.
|
|
158
111
|
*/
|
|
159
112
|
#resolveDesignations(indexCell, latitude, longitude) {
|
|
160
113
|
const whole = new Set();
|
|
@@ -179,15 +132,12 @@ export class ZoningLookup {
|
|
|
179
132
|
}
|
|
180
133
|
let rayCastRan = false;
|
|
181
134
|
for (const areaID of [...partial].toSorted()) {
|
|
182
|
-
// A polygon that already answered `whole` higher in the chain needs no geometry read.
|
|
183
135
|
if (whole.has(areaID))
|
|
184
136
|
continue;
|
|
185
137
|
const area = this.#selectArea.get(areaID);
|
|
186
138
|
if (!area)
|
|
187
139
|
continue;
|
|
188
140
|
rayCastRan = true;
|
|
189
|
-
// The bbox is the prefilter the geometry table stores precisely so the ray cast runs on the few polygons that
|
|
190
|
-
// could contain the point rather than on every polygon reaching the cell.
|
|
191
141
|
if (!bboxContains(area, longitude, latitude)) {
|
|
192
142
|
continue;
|
|
193
143
|
}
|
|
@@ -211,7 +161,7 @@ export class ZoningLookup {
|
|
|
211
161
|
};
|
|
212
162
|
}
|
|
213
163
|
/**
|
|
214
|
-
*
|
|
164
|
+
* Converts a stored row to a designation with its plan and jurisdiction.
|
|
215
165
|
*/
|
|
216
166
|
#toDesignation(area, containment) {
|
|
217
167
|
const plan = this.#selectPlan.get(area.plan_id);
|
|
@@ -227,8 +177,6 @@ export class ZoningLookup {
|
|
|
227
177
|
localCode: area.local_code,
|
|
228
178
|
localDescription: area.local_description,
|
|
229
179
|
localCodeURL: area.local_code_url,
|
|
230
|
-
// The crosswalk travels as one object or not at all: a code without its scheme reads as a code in whichever
|
|
231
|
-
// vocabulary the consumer happened to assume.
|
|
232
180
|
...(area.crosswalk_code === null || area.crosswalk_scheme === null
|
|
233
181
|
? {}
|
|
234
182
|
: {
|
|
@@ -256,9 +204,6 @@ export class ZoningLookup {
|
|
|
256
204
|
};
|
|
257
205
|
}
|
|
258
206
|
}
|
|
259
|
-
/**
|
|
260
|
-
* The publisher's crosswalk domain, by code — its label and whether the publisher DECLARED it.
|
|
261
|
-
*/
|
|
262
207
|
function readCrosswalkTerms(database) {
|
|
263
208
|
const rows = database
|
|
264
209
|
.prepare("SELECT code, label, declared FROM zoning_vocabulary WHERE scheme = ?")
|
|
@@ -266,7 +211,7 @@ function readCrosswalkTerms(database) {
|
|
|
266
211
|
return new Map(rows.map((row) => [row.code, { label: row.label, declared: row.declared === 1 }]));
|
|
267
212
|
}
|
|
268
213
|
/**
|
|
269
|
-
*
|
|
214
|
+
* Reads the layer's identity and throws if it is unusable.
|
|
270
215
|
*/
|
|
271
216
|
function readIdentity(database, databasePath) {
|
|
272
217
|
const manifest = parseManifestRows(database.prepare("SELECT * FROM layer_manifest").all(), GZT_LAYER_NAME, `zoning reader: ${databasePath}`);
|
|
@@ -274,10 +219,8 @@ function readIdentity(database, databasePath) {
|
|
|
274
219
|
if (!spineKeys.h3) {
|
|
275
220
|
throw new Error(`zoning reader: ${databasePath} declares no h3 spine key`);
|
|
276
221
|
}
|
|
277
|
-
//
|
|
278
|
-
//
|
|
279
|
-
// basis reaching a caller would let an absent polygon be read as a designation of freedom to build over most of the
|
|
280
|
-
// map. The check itself is the contract's rather than this product's; the SENTENCE saying why is this product's.
|
|
222
|
+
// The Department publishes its coverage footprint only in a map viewer,
|
|
223
|
+
// so no coverage row may support a claim that a location is unrestricted.
|
|
281
224
|
assertCoverageLicensesNoExclusion(database.prepare("SELECT DISTINCT basis FROM layer_coverage").all().map((coverageRow) => coverageRow.basis), `zoning reader: ${databasePath}`, GZT_COVERAGE_LIMIT);
|
|
282
225
|
const extentRows = database.prepare("SELECT * FROM zoning_mapped_extent ORDER BY extent_id").all();
|
|
283
226
|
const cellResolutions = database.prepare("SELECT DISTINCT resolution FROM zoning_cell ORDER BY resolution").all().map((entry) => entry.resolution);
|
|
@@ -292,10 +235,10 @@ function readIdentity(database, databasePath) {
|
|
|
292
235
|
const crosswalkScheme = database
|
|
293
236
|
.prepare("SELECT DISTINCT crosswalk_scheme FROM zoning_area WHERE crosswalk_scheme IS NOT NULL")
|
|
294
237
|
.all().map((entry) => entry.crosswalk_scheme);
|
|
295
|
-
//
|
|
296
|
-
//
|
|
297
|
-
//
|
|
298
|
-
//
|
|
238
|
+
// The layer stores no coverage resolution.
|
|
239
|
+
// The code recovers it from the coverage cells.
|
|
240
|
+
// A short cell expands to a valid index at exactly one resolution.
|
|
241
|
+
// The helper throws on mixed resolutions.
|
|
299
242
|
const coverageResolution = recoverShortCellResolution(database.prepare("SELECT h3_cell FROM layer_coverage").all().map((coverageRow) => coverageRow.h3_cell), `zoning reader: ${databasePath}`);
|
|
300
243
|
return {
|
|
301
244
|
manifest,
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACN,iCAAiC,EACjC,2BAA2B,EAC3B,iBAAiB,GAGjB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,0BAA0B,EAC1B,cAAc,EAEd,mBAAmB,GACnB,MAA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
package/out/paths.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Where the zoning layer database and its download cache live under the data root's `db/` group.
|
|
7
|
+
*/
|
|
8
|
+
import type { PathBuilder, PathBuilderLike } from "path-ts";
|
|
9
|
+
/**
|
|
10
|
+
* `<dataRoot>/db/zoning`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function zoningDatabaseRoot(dataRoot: PathBuilderLike): PathBuilder;
|
|
13
|
+
/**
|
|
14
|
+
* `$MAILWOMAN_DATA_ROOT/db/zoning`, read when a path is requested.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link zoningDatabaseRoot} for another data root.
|
|
17
|
+
*/
|
|
18
|
+
export declare const zoningDatabasePath: PathBuilder;
|
|
19
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../lib/paths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE3D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,WAAW,CAEzE;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAgD,CAAA"}
|
package/out/paths.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Where the zoning layer database and its download cache live under the data root's `db/` group.
|
|
7
|
+
*/
|
|
8
|
+
import { databaseRootPath, dataRootPath } from "@mailwoman/core/data-root";
|
|
9
|
+
/**
|
|
10
|
+
* `<dataRoot>/db/zoning`.
|
|
11
|
+
*/
|
|
12
|
+
export function zoningDatabaseRoot(dataRoot) {
|
|
13
|
+
return databaseRootPath(dataRoot)("zoning");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `$MAILWOMAN_DATA_ROOT/db/zoning`, read when a path is requested.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link zoningDatabaseRoot} for another data root.
|
|
19
|
+
*/
|
|
20
|
+
export const zoningDatabasePath = zoningDatabaseRoot(dataRootPath());
|
|
21
|
+
//# sourceMappingURL=paths.js.map
|
package/out/paths.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../lib/paths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAG1E;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAyB;IAC3D,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAA;AAC5C,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAgB,kBAAkB,CAAC,YAAY,EAAE,CAAC,CAAA"}
|
package/out/ring-roles.d.ts
CHANGED
|
@@ -3,32 +3,8 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* THE SERVICE ENCODES HOLE ROLES BY ORIENTATION RATHER THAN BY NESTING, AND IT DOES IT ON MOST FEATURES.
|
|
10
|
-
* Measured over the whole national export (85,330 features, 93,483 rings): 89,967 rings are clockwise and
|
|
11
|
-
* 3,516 counter-clockwise; 84,021 features are wholly clockwise; and 1,309 features carry both windings.
|
|
12
|
-
* Of those, 1,210 nest their holes inside one polygon part the way RFC 7946 expects, and the rest put every
|
|
13
|
-
* ring in its own `MultiPolygon` part — the largest feature in the country, Meath's `RA - Rural Area`,
|
|
14
|
-
* arrives as 107 single-ring parts of which 5 are clockwise and 102 counter-clockwise. So the source uses
|
|
15
|
-
* BOTH encodings, the orientation is the only signal common to them, and a reader that took the nesting at
|
|
16
|
-
* face value would read 102 holes as 102 separate zoned areas.
|
|
17
|
-
*
|
|
18
|
-
* CLOCKWISE IS EXTERIOR, WHICH IS THE INVERSE OF RFC 7946, AND THE PUBLISHER'S OWN ARITHMETIC PROVES IT.
|
|
19
|
-
* Summing every ring's signed area over the export gives 5,444.492956 km²; the Department's own
|
|
20
|
-
* `Shape__Area` column sums to 5,444.492956 km². Summing the same rings' ABSOLUTE areas gives 5,666.569
|
|
21
|
-
* km². The signed reading matches the publisher to eight significant figures and the absolute one is 4.1%
|
|
22
|
-
* too large, so the counter-clockwise rings subtract under the publisher's own accounting: they are holes.
|
|
23
|
-
*
|
|
24
|
-
* THE HARMLESS HALF OF GETTING IT WRONG IS THE AREA. The harmful half is that a ray cast reading all 107 of
|
|
25
|
-
* Meath's rings as exteriors answers "inside `P5` rural zoning" for every location the plan carved out.
|
|
26
|
-
*
|
|
27
|
-
* AND GDAL CANNOT BE ASKED TO PRESERVE THIS. Its GeoJSON writer enforces the RFC 7946 winding
|
|
28
|
-
* unconditionally — `-lco RFC7946=NO` is not a GeoJSONSeq option and `--config OGR_ORGANIZE_POLYGONS SKIP`
|
|
29
|
-
* changes nothing — so a reprojected GeoJSON stream returns Meath as 107 counter-clockwise exteriors
|
|
30
|
-
* totalling 2,371.9 km² against the Department's 2,232.1 km². The same conversion written as WKT keeps the
|
|
31
|
-
* source's 5/102 split intact, which is why `sdk/ingest.ts` streams WKT.
|
|
6
|
+
* Clockwise is exterior — the inverse of RFC 7946 — because the service encodes hole roles by
|
|
7
|
+
* orientation rather than nesting.
|
|
32
8
|
*/
|
|
33
9
|
import { type MultiPolygonRings } from "@mailwoman/spatial";
|
|
34
10
|
/**
|
|
@@ -36,7 +12,8 @@ import { type MultiPolygonRings } from "@mailwoman/spatial";
|
|
|
36
12
|
*/
|
|
37
13
|
export interface ResolvedRingRoles {
|
|
38
14
|
/**
|
|
39
|
-
* `[exterior, ...holes]` per polygon
|
|
15
|
+
* `[exterior, ...holes]` per polygon.
|
|
16
|
+
* The shape the ring blob stores and the point test reads.
|
|
40
17
|
*/
|
|
41
18
|
polygons: MultiPolygonRings;
|
|
42
19
|
exteriorCount: number;
|
|
@@ -46,32 +23,23 @@ export interface ResolvedRingRoles {
|
|
|
46
23
|
*/
|
|
47
24
|
nestedHoles: number;
|
|
48
25
|
/**
|
|
49
|
-
* Holes
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* carried rather than dropped: the publisher's own area accounting subtracts them, so dropping one would add ground
|
|
53
|
-
* the plan carved out, and a feature with exactly one exterior — 8 of the 9 — has no ambiguity at all.
|
|
26
|
+
* Holes no exterior contains a majority of, placed under the smallest exterior
|
|
27
|
+
* of the same feature and counted here: they are retained rather than dropped,
|
|
28
|
+
* because dropping one would add ground the plan carved out.
|
|
54
29
|
*/
|
|
55
30
|
adjacentHoles: number;
|
|
56
31
|
/**
|
|
57
|
-
* `1` where the feature's exterior was chosen by
|
|
32
|
+
* `1` where the feature's exterior was chosen by magnitude because no ring read as one by orientation.
|
|
58
33
|
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* stated: the same ring reads clockwise in the source's own Irish Transverse Mercator metres and counter-clockwise
|
|
63
|
-
* after reprojection. Refusing it would fail the build on the publisher's own data; dropping it would invent an
|
|
64
|
-
* absence. So the largest ring by magnitude becomes the exterior, which is also the correct reading for a feature
|
|
65
|
-
* published wholly inverted, and the count rides on the receipt rather than being implied to be zero.
|
|
34
|
+
* The largest ring becomes the exterior.
|
|
35
|
+
* This also handles a feature published wholly inverted.
|
|
36
|
+
* The receipt reports the count explicitly.
|
|
66
37
|
*/
|
|
67
38
|
exteriorByMagnitude: number;
|
|
68
39
|
/**
|
|
69
|
-
* The signed ring sum over the source's rings
|
|
70
|
-
* clockwise-exterior convention.
|
|
71
|
-
*
|
|
72
|
-
* The ingest's own receipt, stored on the row. It is what the build compares against the Department's `Shape__Area`
|
|
73
|
-
* sum, and its SIGN is the record that the orientation was read: a source that started publishing counter-clockwise
|
|
74
|
-
* exteriors would flip it, which is a fact about the source rather than a rounding difference.
|
|
40
|
+
* The signed ring sum over the source's rings as published, in square meters,
|
|
41
|
+
* positive under this service's clockwise-exterior convention.
|
|
42
|
+
* Its sign is the record that the orientation was read.
|
|
75
43
|
*/
|
|
76
44
|
signedAreaM2: number;
|
|
77
45
|
ringCount: number;
|
|
@@ -79,10 +47,8 @@ export interface ResolvedRingRoles {
|
|
|
79
47
|
/**
|
|
80
48
|
* Resolve one feature's hole roles from ring orientation.
|
|
81
49
|
*
|
|
82
|
-
* @param featureID
|
|
83
|
-
* @throws {Error} When the feature
|
|
84
|
-
* nothing reads downstream as an absence of zoning, which is the one answer this layer must never invent. A feature
|
|
85
|
-
* whose rings all read as holes DOES have a reading — see {@link ResolvedRingRoles.exteriorByMagnitude}.
|
|
50
|
+
* @param featureID Included in every refusal, so a build log identifies which feature failed.
|
|
51
|
+
* @throws {Error} When the feature has no ring at all, the one case with no reading.
|
|
86
52
|
*/
|
|
87
53
|
export declare function resolveRingRoles(polygons: MultiPolygonRings, featureID: string): ResolvedRingRoles;
|
|
88
54
|
//# sourceMappingURL=ring-roles.d.ts.map
|
package/out/ring-roles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ring-roles.d.ts","sourceRoot":"","sources":["../lib/ring-roles.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ring-roles.d.ts","sourceRoot":"","sources":["../lib/ring-roles.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiC,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAW1F;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB;;;;;;OAMG;IACH,mBAAmB,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;CACjB;AAsCD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,CA2FlG"}
|
package/out/ring-roles.js
CHANGED
|
@@ -3,50 +3,21 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* THE SERVICE ENCODES HOLE ROLES BY ORIENTATION RATHER THAN BY NESTING, AND IT DOES IT ON MOST FEATURES.
|
|
10
|
-
* Measured over the whole national export (85,330 features, 93,483 rings): 89,967 rings are clockwise and
|
|
11
|
-
* 3,516 counter-clockwise; 84,021 features are wholly clockwise; and 1,309 features carry both windings.
|
|
12
|
-
* Of those, 1,210 nest their holes inside one polygon part the way RFC 7946 expects, and the rest put every
|
|
13
|
-
* ring in its own `MultiPolygon` part — the largest feature in the country, Meath's `RA - Rural Area`,
|
|
14
|
-
* arrives as 107 single-ring parts of which 5 are clockwise and 102 counter-clockwise. So the source uses
|
|
15
|
-
* BOTH encodings, the orientation is the only signal common to them, and a reader that took the nesting at
|
|
16
|
-
* face value would read 102 holes as 102 separate zoned areas.
|
|
17
|
-
*
|
|
18
|
-
* CLOCKWISE IS EXTERIOR, WHICH IS THE INVERSE OF RFC 7946, AND THE PUBLISHER'S OWN ARITHMETIC PROVES IT.
|
|
19
|
-
* Summing every ring's signed area over the export gives 5,444.492956 km²; the Department's own
|
|
20
|
-
* `Shape__Area` column sums to 5,444.492956 km². Summing the same rings' ABSOLUTE areas gives 5,666.569
|
|
21
|
-
* km². The signed reading matches the publisher to eight significant figures and the absolute one is 4.1%
|
|
22
|
-
* too large, so the counter-clockwise rings subtract under the publisher's own accounting: they are holes.
|
|
23
|
-
*
|
|
24
|
-
* THE HARMLESS HALF OF GETTING IT WRONG IS THE AREA. The harmful half is that a ray cast reading all 107 of
|
|
25
|
-
* Meath's rings as exteriors answers "inside `P5` rural zoning" for every location the plan carved out.
|
|
26
|
-
*
|
|
27
|
-
* AND GDAL CANNOT BE ASKED TO PRESERVE THIS. Its GeoJSON writer enforces the RFC 7946 winding
|
|
28
|
-
* unconditionally — `-lco RFC7946=NO` is not a GeoJSONSeq option and `--config OGR_ORGANIZE_POLYGONS SKIP`
|
|
29
|
-
* changes nothing — so a reprojected GeoJSON stream returns Meath as 107 counter-clockwise exteriors
|
|
30
|
-
* totalling 2,371.9 km² against the Department's 2,232.1 km². The same conversion written as WKT keeps the
|
|
31
|
-
* source's 5/102 split intact, which is why `sdk/ingest.ts` streams WKT.
|
|
6
|
+
* Clockwise is exterior — the inverse of RFC 7946 — because the service encodes hole roles by
|
|
7
|
+
* orientation rather than nesting.
|
|
32
8
|
*/
|
|
33
9
|
import { pointInRing, ringSignedAreaM2 } from "@mailwoman/spatial";
|
|
34
10
|
/**
|
|
35
11
|
* How many of a hole's vertices are tested against a candidate exterior.
|
|
36
12
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* is a degenerate sliver of between 0.0008 m² and 1.7 m², and the publisher's own area accounting subtracts all of
|
|
41
|
-
* them.
|
|
13
|
+
* A hole and its exterior share vertices.
|
|
14
|
+
* One vertex cannot distinguish them.
|
|
15
|
+
* A ray cast on an edge is implementation-defined.
|
|
42
16
|
*/
|
|
43
17
|
const HOLE_VERTEX_SAMPLES = 9;
|
|
44
18
|
/**
|
|
45
|
-
* Flatten a feature's rings,
|
|
46
|
-
*
|
|
47
|
-
* DELIBERATELY DISCARDS THE ARRIVING NESTING. Both encodings reach here — a properly nested polygon and a pile of
|
|
48
|
-
* single-ring parts — and the orientation is the only signal that means the same thing in both. Keeping the nesting for
|
|
49
|
-
* the features that have it and inferring it for the ones that do not would put two rules over one artifact.
|
|
19
|
+
* Flatten a feature's rings, discarding the arriving nesting because orientation is
|
|
20
|
+
* the only signal that means the same thing in both encodings.
|
|
50
21
|
*/
|
|
51
22
|
function flattenRings(polygons) {
|
|
52
23
|
const rings = [];
|
|
@@ -75,10 +46,8 @@ function containsMajority(ring, outer) {
|
|
|
75
46
|
/**
|
|
76
47
|
* Resolve one feature's hole roles from ring orientation.
|
|
77
48
|
*
|
|
78
|
-
* @param featureID
|
|
79
|
-
* @throws {Error} When the feature
|
|
80
|
-
* nothing reads downstream as an absence of zoning, which is the one answer this layer must never invent. A feature
|
|
81
|
-
* whose rings all read as holes DOES have a reading — see {@link ResolvedRingRoles.exteriorByMagnitude}.
|
|
49
|
+
* @param featureID Included in every refusal, so a build log identifies which feature failed.
|
|
50
|
+
* @throws {Error} When the feature has no ring at all, the one case with no reading.
|
|
82
51
|
*/
|
|
83
52
|
export function resolveRingRoles(polygons, featureID) {
|
|
84
53
|
const rings = flattenRings(polygons);
|
|
@@ -91,8 +60,10 @@ export function resolveRingRoles(polygons, featureID) {
|
|
|
91
60
|
for (const ring of rings) {
|
|
92
61
|
const signed = ringSignedAreaM2(ring);
|
|
93
62
|
signedAreaM2 += signed;
|
|
94
|
-
//
|
|
95
|
-
//
|
|
63
|
+
// `ringSignedAreaM2` signs clockwise positive.
|
|
64
|
+
// This service treats clockwise rings as exteriors.
|
|
65
|
+
// A zero-area ring is degenerate and stays a hole.
|
|
66
|
+
// It cannot enclose anything.
|
|
96
67
|
if (signed > 0) {
|
|
97
68
|
exteriors.push({ ring, area: signed, holes: [] });
|
|
98
69
|
}
|
|
@@ -101,10 +72,7 @@ export function resolveRingRoles(polygons, featureID) {
|
|
|
101
72
|
}
|
|
102
73
|
}
|
|
103
74
|
let exteriorByMagnitude = 0;
|
|
104
|
-
//
|
|
105
|
-
// the one that encloses the area, which is the correct reading both for a degenerate sliver whose winding is
|
|
106
|
-
// floating-point noise and for a feature published wholly inverted. Refusing here would fail the build on the
|
|
107
|
-
// publisher's own data, and skipping the feature would invent an absence.
|
|
75
|
+
// No ring read as an exterior, so magnitude decides: the largest ring is the one that encloses the area.
|
|
108
76
|
if (!exteriors.length) {
|
|
109
77
|
let largestIndex = 0;
|
|
110
78
|
let largestArea = Math.abs(ringSignedAreaM2(holes[0]));
|
|
@@ -119,8 +87,8 @@ export function resolveRingRoles(polygons, featureID) {
|
|
|
119
87
|
exteriors.push({ ring: largest, area: largestArea, holes: [] });
|
|
120
88
|
exteriorByMagnitude = 1;
|
|
121
89
|
}
|
|
122
|
-
//
|
|
123
|
-
//
|
|
90
|
+
// Smallest containing exterior, so a hole inside an island inside a hole lands on the island.
|
|
91
|
+
// One sort makes the choice deterministic on a tie.
|
|
124
92
|
const bySize = [...exteriors].toSorted((left, right) => left.area - right.area);
|
|
125
93
|
let nestedHoles = 0;
|
|
126
94
|
let adjacentHoles = 0;
|
|
@@ -131,9 +99,8 @@ export function resolveRingRoles(polygons, featureID) {
|
|
|
131
99
|
nestedHoles++;
|
|
132
100
|
continue;
|
|
133
101
|
}
|
|
134
|
-
// A hole no exterior contains a majority of sits
|
|
135
|
-
//
|
|
136
|
-
// 9, and is counted so a receipt can carry the number rather than imply it is zero.
|
|
102
|
+
// A hole no exterior contains a majority of sits on its parent's boundary and goes to the smallest
|
|
103
|
+
// exterior of the same feature, so a receipt can report the number rather than imply it is zero.
|
|
137
104
|
bySize[0].holes.push(hole);
|
|
138
105
|
adjacentHoles++;
|
|
139
106
|
}
|
package/out/ring-roles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ring-roles.js","sourceRoot":"","sources":["../lib/ring-roles.ts"],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AK,CAAC,CAAC;QACzE,aAAa,EAAE,SAAS,CAAC,MAAM;QAC/B,SAAS,EAAE,KAAK,CAAC,MAAM;QACvB,WAAW;QACX,aAAa;QACb,mBAAmB;QACnB,YAAY;QACZ,SAAS,EAAE,KAAK,CAAC,MAAM;KACvB,CAAA;AACF,CAAC"}
|
package/out/rings.d.ts
CHANGED
|
@@ -3,19 +3,8 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* `zoning_area.rings` — the blob layout and
|
|
7
|
-
*
|
|
8
|
-
* THE CODE ITSELF LIVES IN `@mailwoman/spatial`, re-exported here so this package's call sites and its
|
|
9
|
-
* `@mailwoman/zoning/rings` subpath keep reading the same. Nothing in it is zoning-specific: it is byte
|
|
10
|
-
* layout plus spherical geometry, and a second copy of the alignment arithmetic or of the signed-area
|
|
11
|
-
* reading is a second place for either to stop being right. Both failure modes are silent — a mis-read blob
|
|
12
|
-
* answers a containment question wrongly, and a hole-blind area reading answers "inside" for every point in
|
|
13
|
-
* a hole.
|
|
14
|
-
*
|
|
15
|
-
* WHAT IS NOT SHARED IS {@linkcode resolveRingRoles}, and the reason is that it is a fact about THIS
|
|
16
|
-
* PUBLISHER rather than about geometry: the service encodes hole roles by ring ORIENTATION, clockwise
|
|
17
|
-
* exterior, which is the inverse of RFC 7946's convention. `ring-roles.ts` carries it with the measurement
|
|
18
|
-
* that establishes it.
|
|
6
|
+
* `zoning_area.rings` — the blob layout and point test re-exported from `@mailwoman/spatial`;
|
|
7
|
+
* `resolveRingRoles` stays local because the clockwise-exterior role encoding belongs to this publisher rather than to geometry.
|
|
19
8
|
*/
|
|
20
9
|
export { resolveRingRoles, type ResolvedRingRoles } from "#ring-roles";
|
|
21
10
|
//# sourceMappingURL=rings.d.ts.map
|
package/out/rings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rings.d.ts","sourceRoot":"","sources":["../lib/rings.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"rings.d.ts","sourceRoot":"","sources":["../lib/rings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAA"}
|