@mailwoman/spatial 9.2.0 → 9.3.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/{bbox.ts → lib/bbox.ts} +4 -4
- package/{coordinate-bounds.ts → lib/coordinate-bounds.ts} +11 -0
- package/{coordinate-formats.ts → lib/coordinate-formats.ts} +3 -1
- package/lib/distance.ts +165 -0
- package/{feature.ts → lib/feature.ts} +1 -1
- package/{geometries → lib/geometries}/collection.ts +4 -4
- package/lib/geometries/index.ts +13 -0
- package/{geometries → lib/geometries}/line-string.ts +2 -2
- package/{geometries → lib/geometries}/point.ts +9 -9
- package/{geometries → lib/geometries}/polygon.ts +82 -158
- package/lib/geometries/ring-blob.ts +521 -0
- package/{google → lib/google}/index.ts +1 -1
- package/{h3 → lib/h3}/cell.ts +83 -1
- package/lib/h3/coverage.ts +45 -0
- package/{h3 → lib/h3}/index.ts +5 -3
- package/lib/h3/interior-cells.ts +138 -0
- package/lib/h3/polygon-cells.ts +462 -0
- package/lib/index.ts +21 -0
- package/{objects.ts → lib/objects.ts} +1 -1
- package/{open-location-code.ts → lib/open-location-code.ts} +1 -1
- package/{osgb36.ts → lib/osgb36.ts} +2 -2
- package/{polyline.ts → lib/polyline.ts} +1 -1
- package/{position.ts → lib/position.ts} +2 -2
- package/lib/projection-transform.ts +115 -0
- package/{regions → lib/regions}/codes.ts +1 -1
- package/{regions → lib/regions}/index.ts +2 -2
- package/lib/tools/ogr-stream.ts +99 -0
- package/lib/tools/ogr.ts +201 -0
- package/out/bbox.d.ts +2 -2
- package/out/bbox.d.ts.map +1 -1
- package/out/bbox.js +3 -3
- package/out/bbox.js.map +1 -1
- package/out/coordinate-bounds.d.ts +9 -0
- package/out/coordinate-bounds.d.ts.map +1 -1
- package/out/coordinate-bounds.js +9 -0
- package/out/coordinate-bounds.js.map +1 -1
- package/out/coordinate-formats.d.ts.map +1 -1
- package/out/coordinate-formats.js +2 -1
- package/out/coordinate-formats.js.map +1 -1
- package/out/distance.d.ts +39 -1
- package/out/distance.d.ts.map +1 -1
- package/out/distance.js +63 -1
- package/out/distance.js.map +1 -1
- package/out/feature.d.ts +1 -1
- package/out/feature.d.ts.map +1 -1
- package/out/feature.js.map +1 -1
- package/out/geometries/collection.d.ts +4 -4
- package/out/geometries/collection.d.ts.map +1 -1
- package/out/geometries/collection.js.map +1 -1
- package/out/geometries/index.d.ts +5 -4
- package/out/geometries/index.d.ts.map +1 -1
- package/out/geometries/index.js +5 -4
- package/out/geometries/index.js.map +1 -1
- package/out/geometries/line-string.d.ts +2 -2
- package/out/geometries/line-string.d.ts.map +1 -1
- package/out/geometries/line-string.js.map +1 -1
- package/out/geometries/point.d.ts +9 -9
- package/out/geometries/point.d.ts.map +1 -1
- package/out/geometries/point.js +9 -9
- package/out/geometries/point.js.map +1 -1
- package/out/geometries/polygon.d.ts +51 -100
- package/out/geometries/polygon.d.ts.map +1 -1
- package/out/geometries/polygon.js +60 -90
- package/out/geometries/polygon.js.map +1 -1
- package/out/geometries/ring-blob.d.ts +183 -0
- package/out/geometries/ring-blob.d.ts.map +1 -0
- package/out/geometries/ring-blob.js +376 -0
- package/out/geometries/ring-blob.js.map +1 -0
- package/out/google/index.d.ts +1 -1
- package/out/google/index.d.ts.map +1 -1
- package/out/google/index.js +1 -1
- package/out/google/index.js.map +1 -1
- package/out/google/place-id.d.ts.map +1 -1
- package/out/google/place-id.js.map +1 -1
- package/out/h3/cell.d.ts +32 -0
- package/out/h3/cell.d.ts.map +1 -1
- package/out/h3/cell.js +68 -1
- package/out/h3/cell.js.map +1 -1
- package/out/h3/coverage.d.ts +32 -0
- package/out/h3/coverage.d.ts.map +1 -0
- package/out/h3/coverage.js +27 -0
- package/out/h3/coverage.js.map +1 -0
- package/out/h3/index.d.ts +5 -3
- package/out/h3/index.d.ts.map +1 -1
- package/out/h3/index.js +5 -3
- package/out/h3/index.js.map +1 -1
- package/out/h3/interior-cells.d.ts +54 -0
- package/out/h3/interior-cells.d.ts.map +1 -0
- package/out/h3/interior-cells.js +111 -0
- package/out/h3/interior-cells.js.map +1 -0
- package/out/h3/polygon-cells.d.ts +182 -0
- package/out/h3/polygon-cells.d.ts.map +1 -0
- package/out/h3/polygon-cells.js +339 -0
- package/out/h3/polygon-cells.js.map +1 -0
- package/out/index.d.ts +15 -15
- package/out/index.d.ts.map +1 -1
- package/out/index.js +15 -15
- package/out/index.js.map +1 -1
- package/out/objects.d.ts +1 -1
- package/out/objects.d.ts.map +1 -1
- package/out/objects.js +1 -1
- package/out/objects.js.map +1 -1
- package/out/open-location-code.d.ts.map +1 -1
- package/out/open-location-code.js +1 -1
- package/out/open-location-code.js.map +1 -1
- package/out/osgb36.d.ts +2 -2
- package/out/osgb36.d.ts.map +1 -1
- package/out/osgb36.js +1 -1
- package/out/osgb36.js.map +1 -1
- package/out/polyline.d.ts.map +1 -1
- package/out/polyline.js +1 -1
- package/out/polyline.js.map +1 -1
- package/out/position.d.ts +1 -1
- package/out/position.d.ts.map +1 -1
- package/out/position.js +2 -2
- package/out/position.js.map +1 -1
- package/out/projection-transform.d.ts +67 -0
- package/out/projection-transform.d.ts.map +1 -0
- package/out/projection-transform.js +48 -0
- package/out/projection-transform.js.map +1 -0
- package/out/projection.d.ts.map +1 -1
- package/out/projection.js.map +1 -1
- package/out/regions/codes.d.ts.map +1 -1
- package/out/regions/codes.js.map +1 -1
- package/out/regions/index.d.ts +2 -2
- package/out/regions/index.d.ts.map +1 -1
- package/out/regions/index.js +2 -2
- package/out/regions/index.js.map +1 -1
- package/out/regions/names.d.ts.map +1 -1
- package/out/regions/names.js.map +1 -1
- package/out/tools/ogr-stream.d.ts +34 -0
- package/out/tools/ogr-stream.d.ts.map +1 -0
- package/out/tools/ogr-stream.js +74 -0
- package/out/tools/ogr-stream.js.map +1 -0
- package/out/tools/ogr.d.ts +87 -0
- package/out/tools/ogr.d.ts.map +1 -0
- package/out/tools/ogr.js +84 -0
- package/out/tools/ogr.js.map +1 -0
- package/out/tsconfig.test.tsbuildinfo +1 -1
- package/out/well-known-text.d.ts.map +1 -0
- package/out/well-known-text.js.map +1 -0
- package/package.json +94 -25
- package/distance.ts +0 -84
- package/geometries/index.ts +0 -12
- package/index.ts +0 -21
- package/out/sdk/index.d.ts +0 -7
- package/out/sdk/index.d.ts.map +0 -1
- package/out/sdk/index.js +0 -7
- package/out/sdk/index.js.map +0 -1
- package/out/sdk/well-known-text.d.ts.map +0 -1
- package/out/sdk/well-known-text.js.map +0 -1
- package/out/tsconfig.tsbuildinfo +0 -1
- package/sdk/index.ts +0 -7
- /package/{google → lib/google}/place-id.ts +0 -0
- /package/{projection.ts → lib/projection.ts} +0 -0
- /package/{regions → lib/regions}/names.ts +0 -0
- /package/{sdk → lib}/well-known-text.ts +0 -0
- /package/out/{sdk/well-known-text.d.ts → well-known-text.d.ts} +0 -0
- /package/out/{sdk/well-known-text.js → well-known-text.js} +0 -0
package/out/position.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../position.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AAIxE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../lib/position.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AAIxE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAYtE;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B;;;;;OAKG;IACH,SAAS,EAAE,MAAM;IACjB;;;;;OAKG;IACH,QAAQ,EAAE,MAAM;CAChB,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,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ographic positions.
|
|
7
7
|
*/
|
|
8
|
-
import { isValidLatitude, isValidLongitude } from "
|
|
9
|
-
export { isValidLatitude, isValidLongitude } from "
|
|
8
|
+
import { isValidLatitude, isValidLongitude } from "#coordinate-bounds";
|
|
9
|
+
export { isValidLatitude, isValidLongitude } from "#coordinate-bounds";
|
|
10
10
|
/**
|
|
11
11
|
* Arity of a `[lon, lat]` coordinate tuple.
|
|
12
12
|
*/
|
package/out/position.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.js","sourceRoot":"","sources":["../position.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"position.js","sourceRoot":"","sources":["../lib/position.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAEtE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAEtE;;GAEG;AACH,MAAM,iBAAiB,GAAG,CAAC,CAAA;AAE3B;;GAEG;AACH,MAAM,mBAAmB,GAAG,CAAC,CAAA;AA6B7B;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAmB;IAC9E,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;AAC7B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAgB;IAC3E,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;AAC7B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,CAAC,MAAM,EAAE,MAAM,CAAmB;IACxE,MAAM,cAAc,GAAG,gBAAgB,CAAC,MAAM,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,CAAA;IAC1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AyB,CAAC,KAAc;IACvD,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAErD,IAAI,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAEjC,IAAI,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAEjC,OAAO,OAAO,KAAK,CAAC,CAAC,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,CAAC,KAAK,QAAQ,CAAA;AAClE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC9C,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAA;AACvD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAA;AAC1C,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Ask PROJ which datum transformation it would choose, and refuse a ballpark one.
|
|
7
|
+
*
|
|
8
|
+
* PROJ SUBSTITUTES A BALLPARK DATUM SHIFT WHEN THE ACCURATE GRID IS NOT ON DISK, AND IT DOES SO SILENTLY.
|
|
9
|
+
* Measured on the EA flood product: with the OSGB36→WGS84 grid missing, ogr2ogr placed the first
|
|
10
|
+
* feature's first vertex at `1.698151293, 52.648130027`; with `uk_os_OSTN15_NTv2_OSGBtoETRS.tif` present
|
|
11
|
+
* it placed it at `1.698174628, 52.648157259` — 3.4 m apart. Both look like perfectly ordinary WGS84
|
|
12
|
+
* coordinates, both pass a bounding-box check, and the whole layer is offset. It surfaced as eight
|
|
13
|
+
* disagreements out of 59 against the authority's own OGC service, every one a point that fell into a
|
|
14
|
+
* NEIGHBOURING sliver.
|
|
15
|
+
*
|
|
16
|
+
* `--config PROJ_NETWORK ON` does not reach PROJ through GDAL 3.8, and `PROJ_ONLY_BEST=ON` was observed
|
|
17
|
+
* not to refuse, so neither is a usable guard. What is usable is asking PROJ what it would do: `projinfo`
|
|
18
|
+
* names the best candidate operation and says when a grid is missing.
|
|
19
|
+
*
|
|
20
|
+
* IT IS RUN EVEN WHERE NO TRANSFORMATION IS NEEDED, AND THAT IS THE POINT. A source already in EPSG:4326
|
|
21
|
+
* gets `Null geographic offset from WGS 84 to WGS 84, 0 m, World.` — trivially usable, and the check costs
|
|
22
|
+
* one process. Skipping it on the reasoning that a source needs no shift makes the guard fire on the day
|
|
23
|
+
* a source arrives that does, which is the day nobody is looking.
|
|
24
|
+
*
|
|
25
|
+
* SHARED BY EVERY VECTOR INGEST, because the failure is a property of PROJ rather than of any product. The
|
|
26
|
+
* parse is split from the spawn so it can be pinned against captured output: the two states it
|
|
27
|
+
* distinguishes were observed from the same command on the same machine, before and after the grid was
|
|
28
|
+
* installed, and they are the difference between a metre-accurate layer and a 3 m-offset one.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* What PROJ would do, and whether it can actually do it.
|
|
32
|
+
*/
|
|
33
|
+
export interface DatumTransformationVerdict {
|
|
34
|
+
/**
|
|
35
|
+
* The candidate operation line PROJ named, verbatim. Absent when it named none.
|
|
36
|
+
*/
|
|
37
|
+
best?: string;
|
|
38
|
+
usable: boolean;
|
|
39
|
+
reason: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Read `projinfo --summary` output: which operation PROJ would choose, and whether it can actually run.
|
|
43
|
+
*/
|
|
44
|
+
export declare function assessDatumTransformation(summary: string): DatumTransformationVerdict;
|
|
45
|
+
/**
|
|
46
|
+
* The target every layer ingest reprojects to — H3 takes WGS84 latitude and longitude.
|
|
47
|
+
*/
|
|
48
|
+
export declare const WGS84_EPSG = 4326;
|
|
49
|
+
export interface AssertDatumTransformationOptions {
|
|
50
|
+
/**
|
|
51
|
+
* Names the caller in the refusal, so a build log says which ingest stopped.
|
|
52
|
+
*/
|
|
53
|
+
context: string;
|
|
54
|
+
targetEPSG?: number;
|
|
55
|
+
/**
|
|
56
|
+
* The area-of-use to name in the `projsync` remedy the message prints.
|
|
57
|
+
*/
|
|
58
|
+
areaOfUse?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Refuse an ingest whose best available datum transformation is a ballpark one, or is missing its grid.
|
|
62
|
+
*
|
|
63
|
+
* @throws {Error} When PROJ names no candidate, would use a ballpark offset, or would use an operation whose grid is
|
|
64
|
+
* not installed.
|
|
65
|
+
*/
|
|
66
|
+
export declare function assertDatumTransformationAvailable(sourceEPSG: number, options: AssertDatumTransformationOptions): Promise<DatumTransformationVerdict>;
|
|
67
|
+
//# sourceMappingURL=projection-transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection-transform.d.ts","sourceRoot":"","sources":["../lib/projection-transform.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,0BAA0B,CAqBrF;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,OAAO,CAAA;AAE9B,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,kCAAkC,CACvD,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,gCAAgC,GACvC,OAAO,CAAC,0BAA0B,CAAC,CAkBrC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { runFile } from "@mailwoman/core/process";
|
|
2
|
+
/**
|
|
3
|
+
* Read `projinfo --summary` output: which operation PROJ would choose, and whether it can actually run.
|
|
4
|
+
*/
|
|
5
|
+
export function assessDatumTransformation(summary) {
|
|
6
|
+
// The first line naming a candidate operation is the one PROJ will choose. Everything before it is a header, and the
|
|
7
|
+
// `Note:` line about `--spatial-test` is not a candidate.
|
|
8
|
+
//
|
|
9
|
+
// `projinfo --summary` prints a header plus one line per candidate operation: two to nine lines, bounded by PROJ's own
|
|
10
|
+
// candidate enumeration rather than by input size. Reaching for a streaming reader would put a `spliterator` dependency
|
|
11
|
+
// on this package for a fixed handful of lines.
|
|
12
|
+
// oxlint-disable-next-line mailwoman/prefer-spliterator -- bounded output, see above
|
|
13
|
+
const lines = summary.split("\n");
|
|
14
|
+
const best = lines
|
|
15
|
+
.map((line) => line.trim())
|
|
16
|
+
.find((line) => line.includes(", ") && !line.startsWith("Note:") && !line.startsWith("Candidate operations"));
|
|
17
|
+
if (!best)
|
|
18
|
+
return { usable: false, reason: "projinfo named no candidate operation" };
|
|
19
|
+
if (best.includes("grid missing"))
|
|
20
|
+
return { best, usable: false, reason: "its grid is not installed" };
|
|
21
|
+
if (best.toLowerCase().includes("ballpark"))
|
|
22
|
+
return { best, usable: false, reason: "it is a ballpark offset" };
|
|
23
|
+
return { best, usable: true, reason: "the best operation is available" };
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The target every layer ingest reprojects to — H3 takes WGS84 latitude and longitude.
|
|
27
|
+
*/
|
|
28
|
+
export const WGS84_EPSG = 4326;
|
|
29
|
+
/**
|
|
30
|
+
* Refuse an ingest whose best available datum transformation is a ballpark one, or is missing its grid.
|
|
31
|
+
*
|
|
32
|
+
* @throws {Error} When PROJ names no candidate, would use a ballpark offset, or would use an operation whose grid is
|
|
33
|
+
* not installed.
|
|
34
|
+
*/
|
|
35
|
+
export async function assertDatumTransformationAvailable(sourceEPSG, options) {
|
|
36
|
+
const targetEPSG = options.targetEPSG ?? WGS84_EPSG;
|
|
37
|
+
const { stdout } = await runFile("projinfo", ["-s", `EPSG:${sourceEPSG}`, "-t", `EPSG:${targetEPSG}`, "--summary"]);
|
|
38
|
+
const verdict = assessDatumTransformation(stdout);
|
|
39
|
+
if (verdict.usable)
|
|
40
|
+
return verdict;
|
|
41
|
+
const remedy = options.areaOfUse
|
|
42
|
+
? `Install the grid with \`projsync --area-of-use "${options.areaOfUse}"\` and re-run.`
|
|
43
|
+
: "Install the grid with `projsync` for the source's area of use and re-run.";
|
|
44
|
+
throw new Error(`${options.context}: the best EPSG:${sourceEPSG} → EPSG:${targetEPSG} transformation is unusable — ${verdict.reason} ` +
|
|
45
|
+
`(${verdict.best ?? "projinfo named no candidate"}). PROJ falls back to a ballpark datum shift, which is metres ` +
|
|
46
|
+
`wrong and looks exactly like a correct answer. ${remedy}`);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=projection-transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection-transform.js","sourceRoot":"","sources":["../lib/projection-transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AA4CjD;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAe;IACxD,qHAAqH;IACrH,0DAA0D;IAC1D,EAAE;IACF,uHAAuH;IACvH,wHAAwH;IACxH,gDAAgD;IAChD,qFAAqF;IACrF,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAEjC,MAAM,IAAI,GAAG,KAAK;SAChB,GAAG,CAAC,CAAC,IAAI,EAAE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MAAM,GAAG,OAAO,CAAC,SAAS;QAC/B,CAAC,CAAC,mDAAmD,OAAO,CAAC,SAAS,iBAAiB;QACvF,CAAC,CAAC,2EAA2E,CAAA;IAE9E,MAAM,IAAI,KAAK,CACd,GAAG,OAAO,CAAC,OAAO,mBAAmB,UAAU,WAAW,UAAU,iCAAiC,OAAO,CAAC,MAAM,GAAG;QACrH,IAAI,OAAO,CAAC,IAAI,IAAI,6BAA6B,gEAAgE;QACjH,kDAAkD,MAAM,EAAE,CAC3D,CAAA;AACF,CAAC"}
|
package/out/projection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../projection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;IAChC;;;;OAIG;;IAEH;;OAEG;;CAEM,CAAA;AAEV,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../lib/projection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;IAChC;;;;OAIG;;IAEH;;OAEG;;CAEM,CAAA;AAEV,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAA"}
|
package/out/projection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../projection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC;;;;OAIG;IACH,KAAK,EAAE,MAAM;IACb;;OAEG;IACH,KAAK,EAAE,MAAM;CACJ,CAAA"}
|
|
1
|
+
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../lib/projection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC;;;;OAIG;IACH,KAAK,EAAE,MAAM;IACb;;OAEG;IACH,KAAK,EAAE,MAAM;CACJ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../regions/codes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,eAAO,MAAM,WAAW,qDASc,CAAA;AAEtC;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;AAErD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;CAQgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../lib/regions/codes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,eAAO,MAAM,WAAW,qDASc,CAAA;AAEtC;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;AAErD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;CAQgB,CAAA"}
|
package/out/regions/codes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codes.js","sourceRoot":"","sources":["../../regions/codes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACiC,CAAA;AAStC;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,eAAe;IACnB,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,eAAe;CAC+B,CAAA"}
|
|
1
|
+
{"version":3,"file":"codes.js","sourceRoot":"","sources":["../../lib/regions/codes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACiC,CAAA;AAStC;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,eAAe;IACnB,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,eAAe;CAC+B,CAAA"}
|
package/out/regions/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../regions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/regions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA"}
|
package/out/regions/index.js
CHANGED
package/out/regions/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../regions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/regions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../regions/names.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,eAAO,MAAM,WAAW,kGAQc,CAAA;AAEtC;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../lib/regions/names.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,eAAO,MAAM,WAAW,kGAQc,CAAA;AAEtC;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA"}
|
package/out/regions/names.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"names.js","sourceRoot":"","sources":["../../regions/names.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,eAAe;IACf,SAAS;IACT,eAAe;CACsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"names.js","sourceRoot":"","sources":["../../lib/regions/names.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,eAAe;IACf,SAAS;IACT,eAAe;CACsB,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file One ogr2ogr harness for every streaming extraction.
|
|
6
|
+
*/
|
|
7
|
+
export interface OGRProcess {
|
|
8
|
+
stdout: NodeJS.ReadableStream;
|
|
9
|
+
/**
|
|
10
|
+
* Resolves on a clean exit; rejects with the exit code and the stderr tail otherwise. A truncated stream reads as a
|
|
11
|
+
* short but well-formed feature list, which is exactly the partial result that must throw rather than be reported as
|
|
12
|
+
* a smaller extract — so consume the stream fully, then await this.
|
|
13
|
+
*/
|
|
14
|
+
settled: Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Stop the child if it is still running — the `finally` companion for a consumer that throws mid-stream.
|
|
17
|
+
*/
|
|
18
|
+
kill: () => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Spawn `ogr2ogr` with stderr accumulated for the failure message. The caller owns the stdout format (GeoJSONSeq, CSV,
|
|
22
|
+
* …) and its parsing; {@link ogr2ogrGeoJSONSeq} is the GeoJSONSeq reading over this.
|
|
23
|
+
*/
|
|
24
|
+
export declare function spawnOGR2OGR(args: readonly string[], context: string): OGRProcess;
|
|
25
|
+
/**
|
|
26
|
+
* Stream a GeoJSONSeq extraction as parsed features.
|
|
27
|
+
*
|
|
28
|
+
* Strips the RFC-8142 record separator (U+001E) GDAL MAY prefix records with — `.trim()` does not remove it (not
|
|
29
|
+
* whitespace), so an RS-framed record would fail to parse and be silently skipped, all of them, and an empty extract
|
|
30
|
+
* would read as a real absence. A malformed record is tolerated (skipped) rather than thrown; a non-zero exit throws
|
|
31
|
+
* after the stream drains.
|
|
32
|
+
*/
|
|
33
|
+
export declare function ogr2ogrGeoJSONSeq<T>(args: readonly string[], context: string): AsyncGenerator<T>;
|
|
34
|
+
//# sourceMappingURL=ogr-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ogr-stream.d.ts","sourceRoot":"","sources":["../../lib/tools/ogr-stream.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,CAAC,cAAc,CAAA;IAC7B;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAA;CAChB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,CAoCjF;AAED;;;;;;;GAOG;AACH,wBAAuB,iBAAiB,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,CAoBvG"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file One ogr2ogr harness for every streaming extraction.
|
|
6
|
+
*/
|
|
7
|
+
import { tryParsingJSON } from "@mailwoman/core/json";
|
|
8
|
+
import { spawnProcess } from "@mailwoman/core/process";
|
|
9
|
+
import { TextSpliterator } from "spliterator";
|
|
10
|
+
const RECORD_SEPARATOR = 0x1e;
|
|
11
|
+
const STDERR_TAIL_CHARS = 800;
|
|
12
|
+
/**
|
|
13
|
+
* Spawn `ogr2ogr` with stderr accumulated for the failure message. The caller owns the stdout format (GeoJSONSeq, CSV,
|
|
14
|
+
* …) and its parsing; {@link ogr2ogrGeoJSONSeq} is the GeoJSONSeq reading over this.
|
|
15
|
+
*/
|
|
16
|
+
export function spawnOGR2OGR(args, context) {
|
|
17
|
+
const child = spawnProcess("ogr2ogr", [...args], { stdio: ["ignore", "pipe", "pipe"] });
|
|
18
|
+
let stderr = "";
|
|
19
|
+
child.stderr.setEncoding("utf8");
|
|
20
|
+
child.stderr.on("data", (chunk) => {
|
|
21
|
+
stderr += chunk;
|
|
22
|
+
});
|
|
23
|
+
const settled = new Promise((resolve, reject) => {
|
|
24
|
+
child.on("error", reject);
|
|
25
|
+
child.on("close", (code) => {
|
|
26
|
+
if (code === 0) {
|
|
27
|
+
resolve();
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
reject(new Error(`${context}: ogr2ogr exited ${code}: ${stderr.slice(-STDERR_TAIL_CHARS)}`));
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
// A failed spawn rejects `settled` BEFORE any consumer awaits it — the consumer is still draining the stream on a
|
|
35
|
+
// later tick, and a consumer that abandons the stream never awaits it at all — so an unobserved rejection would trip
|
|
36
|
+
// the process's unhandled-rejection hook. Observed at birth instead; every consumer still awaits the real verdict.
|
|
37
|
+
settled.catch(() => undefined);
|
|
38
|
+
return {
|
|
39
|
+
stdout: child.stdout,
|
|
40
|
+
settled,
|
|
41
|
+
kill: () => {
|
|
42
|
+
if (child.exitCode === null && child.signalCode === null) {
|
|
43
|
+
child.kill();
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Stream a GeoJSONSeq extraction as parsed features.
|
|
50
|
+
*
|
|
51
|
+
* Strips the RFC-8142 record separator (U+001E) GDAL MAY prefix records with — `.trim()` does not remove it (not
|
|
52
|
+
* whitespace), so an RS-framed record would fail to parse and be silently skipped, all of them, and an empty extract
|
|
53
|
+
* would read as a real absence. A malformed record is tolerated (skipped) rather than thrown; a non-zero exit throws
|
|
54
|
+
* after the stream drains.
|
|
55
|
+
*/
|
|
56
|
+
export async function* ogr2ogrGeoJSONSeq(args, context) {
|
|
57
|
+
const proc = spawnOGR2OGR(args, context);
|
|
58
|
+
try {
|
|
59
|
+
for await (const raw of TextSpliterator.fromAsync(proc.stdout)) {
|
|
60
|
+
const line = (raw.charCodeAt(0) === RECORD_SEPARATOR ? raw.slice(1) : raw).trim();
|
|
61
|
+
if (!line)
|
|
62
|
+
continue;
|
|
63
|
+
const feature = tryParsingJSON(line);
|
|
64
|
+
if (feature !== null) {
|
|
65
|
+
yield feature;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
proc.kill();
|
|
71
|
+
}
|
|
72
|
+
await proc.settled;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=ogr-stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ogr-stream.js","sourceRoot":"","sources":["../../lib/tools/ogr-stream.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C,MAAM,gBAAgB,GAAG,IAAI,CAAA;AAC7B,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAgB7B;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,IAAuB,EAAE,OAAe;IACpE,MAAM,KAAK,GAAG,YAAY,CAAC,SAAS,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;IACvF,IAAI,MAAM,GAAG,EAAE,CAAA;IAEf,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IAEhC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE;QACzC,MAAM,IAAI,KAAK,CAAA;IAChB,CAAC,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrD,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAEzB,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YAC1B,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBAChB,OAAO,EAAE,CAAA;YACV,CAAC;iBAAM,CAAC;gBACP,MAAM,CAA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IAAI,CAAC,IAAI,EAAE,CAAA;IACZ,CAAC;IAED,MAAM,IAAI,CAAC,OAAO,CAAA;AACnB,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software.
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* What an OGR-readable source declares about itself, read before any feature is — the identity check every
|
|
7
|
+
* polygon-layer ingest opens with.
|
|
8
|
+
*
|
|
9
|
+
* OGR IS BUILD TOOLING, NEVER A SERVE DEPENDENCY (SCOPE invariant 6). The check refuses a source whose
|
|
10
|
+
* declared authority code is not the one the ingest was written for, because reading one projection's
|
|
11
|
+
* coordinates as another's is silent — and it runs the datum-transformation guard even where no shift is
|
|
12
|
+
* needed, because skipping it on the reasoning that a source needs no shift makes the guard fire on the day
|
|
13
|
+
* a source arrives that does.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* What one layer declares about itself.
|
|
17
|
+
*/
|
|
18
|
+
export interface OGRLayerIdentity {
|
|
19
|
+
epsg: number;
|
|
20
|
+
featureCount: number;
|
|
21
|
+
layer: string;
|
|
22
|
+
/**
|
|
23
|
+
* The layer's own attribute field names — empty when the source reports none.
|
|
24
|
+
*/
|
|
25
|
+
fields: ReadonlySet<string>;
|
|
26
|
+
/**
|
|
27
|
+
* The layer's own declared extent, `[minLon, minLat, maxLon, maxLat]`, where the source declares one.
|
|
28
|
+
*/
|
|
29
|
+
extent?: readonly [number, number, number, number];
|
|
30
|
+
}
|
|
31
|
+
export interface ReadOGRLayerIdentityOptions {
|
|
32
|
+
/**
|
|
33
|
+
* The dataset `ogrinfo` opens — a geodatabase directory, a shapefile, a GeoJSON export.
|
|
34
|
+
*/
|
|
35
|
+
path: string;
|
|
36
|
+
/**
|
|
37
|
+
* Layer inside it, asserted against what the source answers. Omitted, the source's first layer answers and only its
|
|
38
|
+
* presence is checked.
|
|
39
|
+
*/
|
|
40
|
+
layer?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The EPSG code the source must declare. A source declaring anything else is a product change, not a variation to
|
|
43
|
+
* absorb.
|
|
44
|
+
*/
|
|
45
|
+
expectEPSG: number;
|
|
46
|
+
/**
|
|
47
|
+
* Names the calling ingest in every refusal, e.g. `flood ingest`.
|
|
48
|
+
*/
|
|
49
|
+
context: string;
|
|
50
|
+
/**
|
|
51
|
+
* Forwarded to the datum-transformation guard.
|
|
52
|
+
*/
|
|
53
|
+
areaOfUse?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Refuse a layer that declares no extent.
|
|
56
|
+
*/
|
|
57
|
+
requireExtent?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Refuse a layer that reports no attribute fields.
|
|
60
|
+
*/
|
|
61
|
+
requireFields?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* A product's own message tails, where they diverge from the defaults.
|
|
64
|
+
*/
|
|
65
|
+
messages?: {
|
|
66
|
+
/**
|
|
67
|
+
* After `declares no EPSG authority code — `.
|
|
68
|
+
*/
|
|
69
|
+
noAuthorityCode?: string;
|
|
70
|
+
/**
|
|
71
|
+
* After `expected EPSG:<code> — `.
|
|
72
|
+
*/
|
|
73
|
+
epsgMismatch?: string;
|
|
74
|
+
/**
|
|
75
|
+
* After `reports no attribute fields — `.
|
|
76
|
+
*/
|
|
77
|
+
emptyFields?: string;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Read what the source declares about itself, and refuse a projection the calling ingest was not written for.
|
|
82
|
+
*
|
|
83
|
+
* @throws {Error} When the layer is missing, declares no EPSG authority code, declares one other than `expectEPSG`,
|
|
84
|
+
* reports no feature count, or fails a `requireExtent`/`requireFields` condition.
|
|
85
|
+
*/
|
|
86
|
+
export declare function readOGRLayerIdentity(options: ReadOGRLayerIdentityOptions): Promise<OGRLayerIdentity>;
|
|
87
|
+
//# sourceMappingURL=ogr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ogr.d.ts","sourceRoot":"","sources":["../../lib/tools/ogr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CAClD;AAED,MAAM,WAAW,2BAA2B;IAC3C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE;QACV;;WAEG;QACH,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;CACD;AAaD;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAgG1G"}
|
package/out/tools/ogr.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software.
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* What an OGR-readable source declares about itself, read before any feature is — the identity check every
|
|
7
|
+
* polygon-layer ingest opens with.
|
|
8
|
+
*
|
|
9
|
+
* OGR IS BUILD TOOLING, NEVER A SERVE DEPENDENCY (SCOPE invariant 6). The check refuses a source whose
|
|
10
|
+
* declared authority code is not the one the ingest was written for, because reading one projection's
|
|
11
|
+
* coordinates as another's is silent — and it runs the datum-transformation guard even where no shift is
|
|
12
|
+
* needed, because skipping it on the reasoning that a source needs no shift makes the guard fire on the day
|
|
13
|
+
* a source arrives that does.
|
|
14
|
+
*/
|
|
15
|
+
import { parseJSONStrict } from "@mailwoman/core/json";
|
|
16
|
+
import { runFile } from "@mailwoman/core/process";
|
|
17
|
+
import { assertDatumTransformationAvailable } from "#projection-transform";
|
|
18
|
+
/**
|
|
19
|
+
* A summary is small; the ceiling only guards against a pathological driver.
|
|
20
|
+
*/
|
|
21
|
+
const OGRINFO_MAX_BUFFER = 32 * 1024 * 1024;
|
|
22
|
+
/**
|
|
23
|
+
* Ordinates in a 2D extent: `minLon, minLat, maxLon, maxLat`. A shorter array is a 3D or degenerate extent this reader
|
|
24
|
+
* does not understand, not a 2D one with something missing.
|
|
25
|
+
*/
|
|
26
|
+
const EXTENT_ORDINATES = 4;
|
|
27
|
+
/**
|
|
28
|
+
* Read what the source declares about itself, and refuse a projection the calling ingest was not written for.
|
|
29
|
+
*
|
|
30
|
+
* @throws {Error} When the layer is missing, declares no EPSG authority code, declares one other than `expectEPSG`,
|
|
31
|
+
* reports no feature count, or fails a `requireExtent`/`requireFields` condition.
|
|
32
|
+
*/
|
|
33
|
+
export async function readOGRLayerIdentity(options) {
|
|
34
|
+
const { stdout } = await runFile("ogrinfo", ["-json", "-so", options.path, ...(options.layer === undefined ? [] : [options.layer])], { maxBuffer: OGRINFO_MAX_BUFFER });
|
|
35
|
+
const info = parseJSONStrict(stdout);
|
|
36
|
+
const described = info.layers?.[0];
|
|
37
|
+
if (!described?.name) {
|
|
38
|
+
throw new Error(options.layer === undefined
|
|
39
|
+
? `${options.context}: ${options.path} carries no readable layer`
|
|
40
|
+
: `${options.context}: ${options.path} does not carry a layer named ${JSON.stringify(options.layer)}`);
|
|
41
|
+
}
|
|
42
|
+
if (options.layer !== undefined && described.name !== options.layer) {
|
|
43
|
+
throw new Error(`${options.context}: ${options.path} does not carry a layer named ${JSON.stringify(options.layer)}`);
|
|
44
|
+
}
|
|
45
|
+
// The subject a refusal names: the layer where one was asked for, the dataset itself where the source's own first
|
|
46
|
+
// layer answered.
|
|
47
|
+
const subject = options.layer ?? options.path;
|
|
48
|
+
const geometry = described.geometryFields?.[0];
|
|
49
|
+
const code = geometry?.coordinateSystem?.projjson?.id?.code;
|
|
50
|
+
if (typeof code !== "number") {
|
|
51
|
+
throw new TypeError(`${options.context}: ${subject} declares no EPSG authority code — ${options.messages?.noAuthorityCode ??
|
|
52
|
+
"the projection cannot be checked, and reading its metres as degrees is silent"}`);
|
|
53
|
+
}
|
|
54
|
+
if (code !== options.expectEPSG) {
|
|
55
|
+
throw new Error(`${options.context}: ${subject} declares EPSG:${code}, expected EPSG:${options.expectEPSG} — ${options.messages?.epsgMismatch ??
|
|
56
|
+
"the source's projection changed, which is a product change rather than a variation to absorb"}`);
|
|
57
|
+
}
|
|
58
|
+
if (typeof described.featureCount !== "number") {
|
|
59
|
+
throw new TypeError(`${options.context}: ${subject} reports no feature count`);
|
|
60
|
+
}
|
|
61
|
+
let extent;
|
|
62
|
+
if (geometry?.extent && geometry.extent.length >= EXTENT_ORDINATES) {
|
|
63
|
+
extent = [geometry.extent[0], geometry.extent[1], geometry.extent[2], geometry.extent[3]];
|
|
64
|
+
}
|
|
65
|
+
if (options.requireExtent && !extent) {
|
|
66
|
+
throw new TypeError(`${options.context}: ${subject} declares no extent, so a reprojected vertex could not be checked`);
|
|
67
|
+
}
|
|
68
|
+
await assertDatumTransformationAvailable(code, {
|
|
69
|
+
context: options.context,
|
|
70
|
+
...(options.areaOfUse === undefined ? {} : { areaOfUse: options.areaOfUse }),
|
|
71
|
+
});
|
|
72
|
+
const fields = new Set((described.fields ?? []).map((field) => field.name).filter((name) => name !== undefined));
|
|
73
|
+
if (options.requireFields && !fields.size) {
|
|
74
|
+
throw new TypeError(`${options.context}: ${subject} reports no attribute fields — ${options.messages?.emptyFields ?? "an empty field list would make every optional column read as absent"}`);
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
epsg: code,
|
|
78
|
+
featureCount: described.featureCount,
|
|
79
|
+
layer: described.name,
|
|
80
|
+
fields,
|
|
81
|
+
...(extent === undefined ? {} : { extent }),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=ogr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ogr.js","sourceRoot":"","sources":["../../lib/tools/ogr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD,OAAO,EAAE,kCAAkC,EAAE,MAAM,uBAAuB,CAAA;AAqE1E;;GAEG;AACH,MAAM,kBAAkB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA;AAE3C;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,CAAA;AAE1B;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAAoC;IAC9E,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,OAAO,CAC/B,SAAS,EACT,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EACvF,EAAE,SAAS,EAAE,kBAAkB,EAAE,CACjC,CAAA;IAED,MAAM,IAAI,GAAG,eAAe,CAU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,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAA;IAEhH,IAAI,OAAO,CAAC,aAAa,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QAC3C,MAAM,IAAI,SAAS,CAClB,GAAG,OAAO,CAAC,OAAO,KAAK,OAAO,kCAC7B,OAAO,CAAC,QAAQ,EAAE,WAAW,IAAI,qEAClC,EAAE,CACF,CAAA;IACF,CAAC;IAED,OAAO;QACN,IAAI,EAAE,IAAI;QACV,YAAY,EAAE,SAAS,CAAC,YAAY;QACpC,KAAK,EAAE,SAAS,CAAC,IAAI;QACrB,MAAM;QACN,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;KAC3C,CAAA;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../test/unit/bbox.test.ts","../test/unit/coordinate-formats.test.ts","../test/unit/open-location-code.test.ts","../test/unit/osgb36.test.ts","../test/unit/position.test.ts","../test/unit/geometries/point.test.ts","../test/unit/geometries/polygon.test.ts","../test/unit/google/place-id.test.ts","../test/unit/h3/cell.test.ts","../test/unit/
|
|
1
|
+
{"root":["../test/unit/bbox.test.ts","../test/unit/coordinate-formats.test.ts","../test/unit/open-location-code.test.ts","../test/unit/osgb36.test.ts","../test/unit/position.test.ts","../test/unit/well-known-text.test.ts","../test/unit/geometries/point.test.ts","../test/unit/geometries/polygon.test.ts","../test/unit/google/place-id.test.ts","../test/unit/h3/cell.test.ts","../test/unit/h3/expand-short-cell-int.test.ts"],"version":"6.0.3"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"well-known-text.d.ts","sourceRoot":"","sources":["../lib/well-known-text.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAEjE;;;;GAIG;AACH,wB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