@loaders.gl/gis 4.3.4 → 4.4.0-alpha.10
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/dist/index.cjs +2411 -469
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +31 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -15
- package/dist/index.js.map +1 -0
- package/dist/lib/binary-geometry-api/binary-geometry-info.d.ts +21 -0
- package/dist/lib/binary-geometry-api/binary-geometry-info.d.ts.map +1 -0
- package/dist/lib/binary-geometry-api/binary-geometry-info.js +49 -0
- package/dist/lib/binary-geometry-api/binary-geometry-info.js.map +1 -0
- package/dist/lib/binary-geometry-api/concat-binary-geometry.d.ts +5 -0
- package/dist/lib/binary-geometry-api/concat-binary-geometry.d.ts.map +1 -0
- package/dist/lib/binary-geometry-api/concat-binary-geometry.js +51 -0
- package/dist/lib/binary-geometry-api/concat-binary-geometry.js.map +1 -0
- package/dist/lib/{binary-features/transform.d.ts → binary-geometry-api/transform-coordinates.d.ts} +1 -2
- package/dist/lib/binary-geometry-api/transform-coordinates.d.ts.map +1 -0
- package/dist/lib/{binary-features/transform.js → binary-geometry-api/transform-coordinates.js} +1 -1
- package/dist/lib/binary-geometry-api/transform-coordinates.js.map +1 -0
- package/dist/lib/feature-collection-converters/convert-binary-features-to-geojson.d.ts +16 -0
- package/dist/lib/feature-collection-converters/convert-binary-features-to-geojson.d.ts.map +1 -0
- package/dist/lib/{binary-features/binary-to-geojson.js → feature-collection-converters/convert-binary-features-to-geojson.js} +4 -90
- package/dist/lib/feature-collection-converters/convert-binary-features-to-geojson.js.map +1 -0
- package/dist/lib/{binary-features/flat-geojson-to-binary.d.ts → feature-collection-converters/convert-flat-geojson-to-binary-features.d.ts} +6 -9
- package/dist/lib/feature-collection-converters/convert-flat-geojson-to-binary-features.d.ts.map +1 -0
- package/dist/lib/{binary-features/flat-geojson-to-binary.js → feature-collection-converters/convert-flat-geojson-to-binary-features.js} +6 -5
- package/dist/lib/feature-collection-converters/convert-flat-geojson-to-binary-features.js.map +1 -0
- package/dist/lib/feature-collection-converters/convert-geoarrow-to-binary-features.d.ts +74 -0
- package/dist/lib/feature-collection-converters/convert-geoarrow-to-binary-features.d.ts.map +1 -0
- package/dist/lib/feature-collection-converters/convert-geoarrow-to-binary-features.js +378 -0
- package/dist/lib/feature-collection-converters/convert-geoarrow-to-binary-features.js.map +1 -0
- package/dist/lib/{binary-features/geojson-to-binary.d.ts → feature-collection-converters/convert-geojson-to-binary-features.d.ts} +2 -2
- package/dist/lib/feature-collection-converters/convert-geojson-to-binary-features.d.ts.map +1 -0
- package/dist/lib/feature-collection-converters/convert-geojson-to-binary-features.js +25 -0
- package/dist/lib/feature-collection-converters/convert-geojson-to-binary-features.js.map +1 -0
- package/dist/lib/{binary-features/geojson-to-flat-geojson.d.ts → feature-collection-converters/convert-geojson-to-flat-geojson.d.ts} +2 -2
- package/dist/lib/feature-collection-converters/convert-geojson-to-flat-geojson.d.ts.map +1 -0
- package/dist/lib/{binary-features/geojson-to-flat-geojson.js → feature-collection-converters/convert-geojson-to-flat-geojson.js} +5 -1
- package/dist/lib/feature-collection-converters/convert-geojson-to-flat-geojson.js.map +1 -0
- package/dist/lib/feature-collection-converters/helpers/flat-geojson-to-binary-types.d.ts.map +1 -0
- package/dist/lib/feature-collection-converters/helpers/flat-geojson-to-binary-types.js +5 -0
- package/dist/lib/feature-collection-converters/helpers/flat-geojson-to-binary-types.js.map +1 -0
- package/dist/lib/geometry-api/geometry-info.d.ts +21 -0
- package/dist/lib/geometry-api/geometry-info.d.ts.map +1 -0
- package/dist/lib/{binary-features/extract-geometry-info.js → geometry-api/geometry-info.js} +5 -1
- package/dist/lib/geometry-api/geometry-info.js.map +1 -0
- package/dist/lib/geometry-converters/convert-binary-geometry-to-geojson.d.ts +4 -0
- package/dist/lib/geometry-converters/convert-binary-geometry-to-geojson.d.ts.map +1 -0
- package/dist/lib/geometry-converters/convert-binary-geometry-to-geojson.js +92 -0
- package/dist/lib/geometry-converters/convert-binary-geometry-to-geojson.js.map +1 -0
- package/dist/lib/geometry-converters/convert-geoarrow-to-geojson.d.ts +13 -0
- package/dist/lib/geometry-converters/convert-geoarrow-to-geojson.d.ts.map +1 -0
- package/dist/lib/geometry-converters/convert-geoarrow-to-geojson.js +165 -0
- package/dist/lib/geometry-converters/convert-geoarrow-to-geojson.js.map +1 -0
- package/dist/lib/geometry-converters/convert-to-geojson.d.ts +6 -0
- package/dist/lib/geometry-converters/convert-to-geojson.d.ts.map +1 -0
- package/dist/lib/geometry-converters/convert-to-geojson.js +40 -0
- package/dist/lib/geometry-converters/convert-to-geojson.js.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-geometry-to-twkb.d.ts +6 -0
- package/dist/lib/geometry-converters/wkb/convert-geometry-to-twkb.d.ts.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-geometry-to-twkb.js +196 -0
- package/dist/lib/geometry-converters/wkb/convert-geometry-to-twkb.js.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-geometry-to-wkb.d.ts +9 -0
- package/dist/lib/geometry-converters/wkb/convert-geometry-to-wkb.d.ts.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-geometry-to-wkb.js +274 -0
- package/dist/lib/geometry-converters/wkb/convert-geometry-to-wkb.js.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-geometry-to-wkt.d.ts +8 -0
- package/dist/lib/geometry-converters/wkb/convert-geometry-to-wkt.d.ts.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-geometry-to-wkt.js +45 -0
- package/dist/lib/geometry-converters/wkb/convert-geometry-to-wkt.js.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-twkb-to-geometry.d.ts +10 -0
- package/dist/lib/geometry-converters/wkb/convert-twkb-to-geometry.d.ts.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-twkb-to-geometry.js +255 -0
- package/dist/lib/geometry-converters/wkb/convert-twkb-to-geometry.js.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.d.ts +3 -0
- package/dist/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.d.ts.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js +165 -0
- package/dist/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-wkb-to-geometry.d.ts +11 -0
- package/dist/lib/geometry-converters/wkb/convert-wkb-to-geometry.d.ts.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-wkb-to-geometry.js +10 -0
- package/dist/lib/geometry-converters/wkb/convert-wkb-to-geometry.js.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-wkt-to-geometry.d.ts +16 -0
- package/dist/lib/geometry-converters/wkb/convert-wkt-to-geometry.d.ts.map +1 -0
- package/dist/lib/geometry-converters/wkb/convert-wkt-to-geometry.js +259 -0
- package/dist/lib/geometry-converters/wkb/convert-wkt-to-geometry.js.map +1 -0
- package/dist/lib/geometry-converters/wkb/helpers/parse-wkb-header.d.ts +43 -0
- package/dist/lib/geometry-converters/wkb/helpers/parse-wkb-header.d.ts.map +1 -0
- package/dist/lib/geometry-converters/wkb/helpers/parse-wkb-header.js +175 -0
- package/dist/lib/geometry-converters/wkb/helpers/parse-wkb-header.js.map +1 -0
- package/dist/lib/geometry-converters/wkb/helpers/wkb-types.d.ts +64 -0
- package/dist/lib/geometry-converters/wkb/helpers/wkb-types.d.ts.map +1 -0
- package/dist/lib/geometry-converters/wkb/helpers/wkb-types.js +47 -0
- package/dist/lib/geometry-converters/wkb/helpers/wkb-types.js.map +1 -0
- package/dist/lib/geometry-converters/wkb/helpers/wkb-utils.d.ts +21 -0
- package/dist/lib/geometry-converters/wkb/helpers/wkb-utils.d.ts.map +1 -0
- package/dist/lib/geometry-converters/wkb/helpers/wkb-utils.js +65 -0
- package/dist/lib/geometry-converters/wkb/helpers/wkb-utils.js.map +1 -0
- package/dist/lib/geometry-converters/wkb/helpers/write-wkb-header.d.ts +8 -0
- package/dist/lib/geometry-converters/wkb/helpers/write-wkb-header.d.ts.map +1 -0
- package/dist/lib/geometry-converters/wkb/helpers/write-wkb-header.js +34 -0
- package/dist/lib/geometry-converters/wkb/helpers/write-wkb-header.js.map +1 -0
- package/dist/lib/table-converters/convert-geoarrow-table.d.ts +27 -0
- package/dist/lib/table-converters/convert-geoarrow-table.d.ts.map +1 -0
- package/dist/lib/table-converters/convert-geoarrow-table.js +155 -0
- package/dist/lib/table-converters/convert-geoarrow-table.js.map +1 -0
- package/dist/lib/table-converters/convert-wkb-table-to-geojson.d.ts +4 -0
- package/dist/lib/table-converters/convert-wkb-table-to-geojson.d.ts.map +1 -0
- package/dist/lib/{tables/convert-table-to-geojson.js → table-converters/convert-wkb-table-to-geojson.js} +11 -16
- package/dist/lib/table-converters/convert-wkb-table-to-geojson.js.map +1 -0
- package/dist/lib/table-converters/make-arrow-batch-iterator.d.ts +6 -0
- package/dist/lib/table-converters/make-arrow-batch-iterator.d.ts.map +1 -0
- package/dist/lib/table-converters/make-arrow-batch-iterator.js +36 -0
- package/dist/lib/table-converters/make-arrow-batch-iterator.js.map +1 -0
- package/dist/lib/utils/base64-encoder.d.ts +5 -0
- package/dist/lib/utils/base64-encoder.d.ts.map +1 -0
- package/dist/lib/utils/base64-encoder.js +154 -0
- package/dist/lib/utils/base64-encoder.js.map +1 -0
- package/dist/lib/utils/binary-reader.d.ts +18 -0
- package/dist/lib/utils/binary-reader.d.ts.map +1 -0
- package/dist/lib/utils/binary-reader.js +70 -0
- package/dist/lib/utils/binary-reader.js.map +1 -0
- package/dist/lib/utils/binary-writer.d.ts +30 -0
- package/dist/lib/utils/binary-writer.d.ts.map +1 -0
- package/dist/lib/utils/binary-writer.js +128 -0
- package/dist/lib/utils/binary-writer.js.map +1 -0
- package/dist/lib/utils/concat-typed-arrays.d.ts +3 -0
- package/dist/lib/utils/concat-typed-arrays.d.ts.map +1 -0
- package/dist/lib/utils/concat-typed-arrays.js +19 -0
- package/dist/lib/utils/concat-typed-arrays.js.map +1 -0
- package/dist/lib/utils/hex-encoder.d.ts +15 -0
- package/dist/lib/utils/hex-encoder.d.ts.map +1 -0
- package/dist/lib/utils/hex-encoder.js +55 -0
- package/dist/lib/utils/hex-encoder.js.map +1 -0
- package/dist/lib/utils/hex-transcoder.d.ts +15 -0
- package/dist/lib/utils/hex-transcoder.d.ts.map +1 -0
- package/dist/lib/utils/hex-transcoder.js +51 -0
- package/dist/lib/utils/hex-transcoder.js.map +1 -0
- package/dist/lib/wkt-crs/encode-wkt-crs.d.ts +10 -0
- package/dist/lib/wkt-crs/encode-wkt-crs.d.ts.map +1 -0
- package/dist/lib/wkt-crs/encode-wkt-crs.js +36 -0
- package/dist/lib/wkt-crs/encode-wkt-crs.js.map +1 -0
- package/dist/lib/wkt-crs/parse-wkt-crs.d.ts +15 -0
- package/dist/lib/wkt-crs/parse-wkt-crs.d.ts.map +1 -0
- package/dist/lib/wkt-crs/parse-wkt-crs.js +121 -0
- package/dist/lib/wkt-crs/parse-wkt-crs.js.map +1 -0
- package/package.json +7 -5
- package/src/index.ts +87 -14
- package/src/lib/binary-geometry-api/binary-geometry-info.ts +75 -0
- package/src/lib/binary-geometry-api/concat-binary-geometry.ts +78 -0
- package/src/lib/{binary-features/transform.ts → binary-geometry-api/transform-coordinates.ts} +0 -1
- package/src/lib/{binary-features/binary-to-geojson.ts → feature-collection-converters/convert-binary-features-to-geojson.ts} +5 -142
- package/src/lib/{binary-features/flat-geojson-to-binary.ts → feature-collection-converters/convert-flat-geojson-to-binary-features.ts} +14 -9
- package/src/lib/feature-collection-converters/convert-geoarrow-to-binary-features.ts +496 -0
- package/src/lib/{binary-features/geojson-to-binary.ts → feature-collection-converters/convert-geojson-to-binary-features.ts} +11 -7
- package/src/lib/{binary-features/geojson-to-flat-geojson.ts → feature-collection-converters/convert-geojson-to-flat-geojson.ts} +5 -1
- package/src/lib/{binary-features → feature-collection-converters/helpers}/flat-geojson-to-binary-types.ts +4 -0
- package/src/lib/{binary-features/extract-geometry-info.ts → geometry-api/geometry-info.ts} +20 -2
- package/src/lib/geometry-converters/convert-binary-geometry-to-geojson.ts +148 -0
- package/src/lib/geometry-converters/convert-geoarrow-to-geojson.ts +193 -0
- package/src/lib/geometry-converters/convert-to-geojson.ts +52 -0
- package/src/lib/geometry-converters/wkb/convert-geometry-to-twkb.ts +308 -0
- package/src/lib/geometry-converters/wkb/convert-geometry-to-wkb.ts +365 -0
- package/src/lib/geometry-converters/wkb/convert-geometry-to-wkt.ts +54 -0
- package/src/lib/geometry-converters/wkb/convert-twkb-to-geometry.ts +366 -0
- package/src/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.ts +238 -0
- package/src/lib/geometry-converters/wkb/convert-wkb-to-geometry.ts +23 -0
- package/src/lib/geometry-converters/wkb/convert-wkt-to-geometry.ts +294 -0
- package/src/lib/geometry-converters/wkb/helpers/parse-wkb-header.ts +213 -0
- package/src/lib/geometry-converters/wkb/helpers/wkb-types.ts +82 -0
- package/src/lib/geometry-converters/wkb/helpers/wkb-utils.ts +85 -0
- package/src/lib/geometry-converters/wkb/helpers/write-wkb-header.ts +41 -0
- package/src/lib/table-converters/convert-geoarrow-table.ts +218 -0
- package/src/lib/{tables/convert-table-to-geojson.ts → table-converters/convert-wkb-table-to-geojson.ts} +10 -23
- package/src/lib/table-converters/make-arrow-batch-iterator.ts +53 -0
- package/src/lib/utils/base64-encoder.ts +157 -0
- package/src/lib/utils/binary-reader.ts +76 -0
- package/src/lib/utils/binary-writer.ts +136 -0
- package/src/lib/utils/concat-typed-arrays.ts +24 -0
- package/src/lib/utils/hex-encoder.ts +60 -0
- package/src/lib/utils/hex-transcoder.ts +54 -0
- package/src/lib/wkt-crs/encode-wkt-crs.ts +41 -0
- package/src/lib/wkt-crs/parse-wkt-crs.ts +149 -0
- package/dist/lib/binary-features/binary-to-geojson.d.ts +0 -18
- package/dist/lib/binary-features/binary-to-geojson.d.ts.map +0 -1
- package/dist/lib/binary-features/extract-geometry-info.d.ts +0 -8
- package/dist/lib/binary-features/extract-geometry-info.d.ts.map +0 -1
- package/dist/lib/binary-features/flat-geojson-to-binary-types.d.ts.map +0 -1
- package/dist/lib/binary-features/flat-geojson-to-binary-types.js +0 -1
- package/dist/lib/binary-features/flat-geojson-to-binary.d.ts.map +0 -1
- package/dist/lib/binary-features/geojson-to-binary.d.ts.map +0 -1
- package/dist/lib/binary-features/geojson-to-binary.js +0 -21
- package/dist/lib/binary-features/geojson-to-flat-geojson.d.ts.map +0 -1
- package/dist/lib/binary-features/transform.d.ts.map +0 -1
- package/dist/lib/geo/geoarrow-metadata.d.ts +0 -27
- package/dist/lib/geo/geoarrow-metadata.d.ts.map +0 -1
- package/dist/lib/geo/geoarrow-metadata.js +0 -70
- package/dist/lib/geo/geoparquet-metadata-schema.d.ts +0 -79
- package/dist/lib/geo/geoparquet-metadata-schema.d.ts.map +0 -1
- package/dist/lib/geo/geoparquet-metadata-schema.js +0 -69
- package/dist/lib/geo/geoparquet-metadata.d.ts +0 -45
- package/dist/lib/geo/geoparquet-metadata.d.ts.map +0 -1
- package/dist/lib/geo/geoparquet-metadata.js +0 -117
- package/dist/lib/tables/convert-table-to-geojson.d.ts +0 -5
- package/dist/lib/tables/convert-table-to-geojson.d.ts.map +0 -1
- package/src/lib/geo/geoarrow-metadata.ts +0 -100
- package/src/lib/geo/geoparquet-metadata-schema.json +0 -60
- package/src/lib/geo/geoparquet-metadata-schema.ts +0 -71
- package/src/lib/geo/geoparquet-metadata.ts +0 -191
- /package/dist/lib/{binary-features → feature-collection-converters/helpers}/flat-geojson-to-binary-types.d.ts +0 -0
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Geoparquet JSON schema for geo metadata
|
|
3
|
-
* @see https://github.com/geoarrow/geoarrow/blob/main/metadata.md
|
|
4
|
-
* @see https://github.com/opengeospatial/geoparquet/blob/main/format-specs/geoparquet.md
|
|
5
|
-
*/
|
|
6
|
-
export declare const GEOPARQUET_METADATA_JSON_SCHEMA: {
|
|
7
|
-
$schema: string;
|
|
8
|
-
title: string;
|
|
9
|
-
description: string;
|
|
10
|
-
type: string;
|
|
11
|
-
required: string[];
|
|
12
|
-
properties: {
|
|
13
|
-
version: {
|
|
14
|
-
type: string;
|
|
15
|
-
const: string;
|
|
16
|
-
};
|
|
17
|
-
primary_column: {
|
|
18
|
-
type: string;
|
|
19
|
-
minLength: number;
|
|
20
|
-
};
|
|
21
|
-
columns: {
|
|
22
|
-
type: string;
|
|
23
|
-
minProperties: number;
|
|
24
|
-
patternProperties: {
|
|
25
|
-
'.+': {
|
|
26
|
-
type: string;
|
|
27
|
-
required: string[];
|
|
28
|
-
properties: {
|
|
29
|
-
encoding: {
|
|
30
|
-
type: string;
|
|
31
|
-
const: string;
|
|
32
|
-
};
|
|
33
|
-
geometry_types: {
|
|
34
|
-
type: string;
|
|
35
|
-
uniqueItems: boolean;
|
|
36
|
-
items: {
|
|
37
|
-
type: string;
|
|
38
|
-
pattern: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
crs: {
|
|
42
|
-
oneOf: ({
|
|
43
|
-
$ref: string;
|
|
44
|
-
type?: undefined;
|
|
45
|
-
} | {
|
|
46
|
-
type: string;
|
|
47
|
-
$ref?: undefined;
|
|
48
|
-
})[];
|
|
49
|
-
};
|
|
50
|
-
edges: {
|
|
51
|
-
type: string;
|
|
52
|
-
enum: string[];
|
|
53
|
-
};
|
|
54
|
-
orientation: {
|
|
55
|
-
type: string;
|
|
56
|
-
const: string;
|
|
57
|
-
};
|
|
58
|
-
bbox: {
|
|
59
|
-
type: string;
|
|
60
|
-
items: {
|
|
61
|
-
type: string;
|
|
62
|
-
};
|
|
63
|
-
oneOf: {
|
|
64
|
-
description: string;
|
|
65
|
-
minItems: number;
|
|
66
|
-
maxItems: number;
|
|
67
|
-
}[];
|
|
68
|
-
};
|
|
69
|
-
epoch: {
|
|
70
|
-
type: string;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
additionalProperties: boolean;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
//# sourceMappingURL=geoparquet-metadata-schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"geoparquet-metadata-schema.d.ts","sourceRoot":"","sources":["../../../src/lib/geo/geoparquet-metadata-schema.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2D3C,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
/* eslint-disable camelcase */
|
|
5
|
-
/**
|
|
6
|
-
* Geoparquet JSON schema for geo metadata
|
|
7
|
-
* @see https://github.com/geoarrow/geoarrow/blob/main/metadata.md
|
|
8
|
-
* @see https://github.com/opengeospatial/geoparquet/blob/main/format-specs/geoparquet.md
|
|
9
|
-
*/
|
|
10
|
-
export const GEOPARQUET_METADATA_JSON_SCHEMA = {
|
|
11
|
-
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
12
|
-
title: 'GeoParquet',
|
|
13
|
-
description: 'Parquet metadata included in the geo field.',
|
|
14
|
-
type: 'object',
|
|
15
|
-
required: ['version', 'primary_column', 'columns'],
|
|
16
|
-
properties: {
|
|
17
|
-
version: { type: 'string', const: '1.0.0-beta.1' },
|
|
18
|
-
primary_column: { type: 'string', minLength: 1 },
|
|
19
|
-
columns: {
|
|
20
|
-
type: 'object',
|
|
21
|
-
minProperties: 1,
|
|
22
|
-
patternProperties: {
|
|
23
|
-
'.+': {
|
|
24
|
-
type: 'object',
|
|
25
|
-
required: ['encoding', 'geometry_types'],
|
|
26
|
-
properties: {
|
|
27
|
-
encoding: { type: 'string', const: 'WKB' },
|
|
28
|
-
geometry_types: {
|
|
29
|
-
type: 'array',
|
|
30
|
-
uniqueItems: true,
|
|
31
|
-
items: {
|
|
32
|
-
type: 'string',
|
|
33
|
-
pattern: '^(GeometryCollection|(Multi)?(Point|LineString|Polygon))( Z)?$'
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
crs: {
|
|
37
|
-
oneOf: [
|
|
38
|
-
{
|
|
39
|
-
$ref: 'https://proj.org/schemas/v0.5/projjson.schema.json'
|
|
40
|
-
},
|
|
41
|
-
{ type: 'null' }
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
edges: { type: 'string', enum: ['planar', 'spherical'] },
|
|
45
|
-
orientation: { type: 'string', const: 'counterclockwise' },
|
|
46
|
-
bbox: {
|
|
47
|
-
type: 'array',
|
|
48
|
-
items: { type: 'number' },
|
|
49
|
-
oneOf: [
|
|
50
|
-
{
|
|
51
|
-
description: '2D bbox consisting of (xmin, ymin, xmax, ymax)',
|
|
52
|
-
minItems: 4,
|
|
53
|
-
maxItems: 4
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
description: '3D bbox consisting of (xmin, ymin, zmin, xmax, ymax, zmax)',
|
|
57
|
-
minItems: 6,
|
|
58
|
-
maxItems: 6
|
|
59
|
-
}
|
|
60
|
-
]
|
|
61
|
-
},
|
|
62
|
-
epoch: { type: 'number' }
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
additionalProperties: false
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Schema } from '@loaders.gl/schema';
|
|
2
|
-
/**
|
|
3
|
-
* A geoarrow / geoparquet geo metadata object
|
|
4
|
-
* (stored in stringified form in the top level metadata 'geo' key)
|
|
5
|
-
* @see https://github.com/opengeospatial/geoparquet/blob/main/format-specs/geoparquet.md
|
|
6
|
-
* @see https://github.com/geoarrow/geoarrow
|
|
7
|
-
* */
|
|
8
|
-
export type GeoMetadata = {
|
|
9
|
-
version?: string;
|
|
10
|
-
primary_column?: string;
|
|
11
|
-
columns: Record<string, GeoColumnMetadata>;
|
|
12
|
-
[key: string]: unknown;
|
|
13
|
-
};
|
|
14
|
-
/** A geoarrow / geoparquet geo metadata for one geometry column */
|
|
15
|
-
export type GeoColumnMetadata = {
|
|
16
|
-
encoding: 'wkb' | 'wkt';
|
|
17
|
-
geometry_types: GeoParquetGeometryType[];
|
|
18
|
-
crs?: object | null;
|
|
19
|
-
orientation?: 'counterclockwise';
|
|
20
|
-
bbox?: [number, number, number, number] | [number, number, number, number, number, number];
|
|
21
|
-
edges?: 'planar' | 'spherical';
|
|
22
|
-
epoch?: number;
|
|
23
|
-
[key: string]: unknown;
|
|
24
|
-
};
|
|
25
|
-
/** A GeoParquet metadata geometry type */
|
|
26
|
-
export type GeoParquetGeometryType = 'Point' | 'LineString' | 'Polygon' | 'MultiPoint' | 'MultiLineString' | 'MultiPolygon' | 'GeometryCollection' | 'Point Z' | 'LineString Z' | 'Polygon Z' | 'MultiPoint Z' | 'MultiLineString Z' | 'MultiPolygon Z' | 'GeometryCollection Z';
|
|
27
|
-
/**
|
|
28
|
-
* Reads the GeoMetadata object from the metadata
|
|
29
|
-
* @note geoarrow / parquet schema is stringified into a single key-value pair in the parquet metadata
|
|
30
|
-
*/
|
|
31
|
-
export declare function getGeoMetadata(schema: Schema): GeoMetadata | null;
|
|
32
|
-
/**
|
|
33
|
-
* Stores a geoarrow / geoparquet geo metadata object in the schema
|
|
34
|
-
* @note geoarrow / geoparquet geo metadata is a single stringified JSON field
|
|
35
|
-
*/
|
|
36
|
-
export declare function setGeoMetadata(schema: Schema, geoMetadata: GeoMetadata): void;
|
|
37
|
-
/**
|
|
38
|
-
* Unpacks geo metadata into separate metadata fields (parses the long JSON string)
|
|
39
|
-
* @note geoarrow / parquet schema is stringified into a single key-value pair in the parquet metadata
|
|
40
|
-
*/
|
|
41
|
-
export declare function unpackGeoMetadata(schema: Schema): void;
|
|
42
|
-
/** Parse a key with stringified arrow metadata */
|
|
43
|
-
export declare function parseJSONStringMetadata(schema: Schema, metadataKey: string): Record<string, unknown> | null;
|
|
44
|
-
export declare function unpackJSONStringMetadata(schema: Schema, metadataKey: string): void;
|
|
45
|
-
//# sourceMappingURL=geoparquet-metadata.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"geoparquet-metadata.d.ts","sourceRoot":"","sources":["../../../src/lib/geo/geoparquet-metadata.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,MAAM,EAAQ,MAAM,oBAAoB,CAAC;AAIjD;;;;;KAKK;AACL,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC3C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,oEAAoE;AACpE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC;IACxB,cAAc,EAAE,sBAAsB,EAAE,CAAC;IACzC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3F,KAAK,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,0CAA0C;AAC1C,MAAM,MAAM,sBAAsB,GAC9B,OAAO,GACP,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,oBAAoB,GACpB,SAAS,GACT,cAAc,GACd,WAAW,GACX,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,sBAAsB,CAAC;AAI3B;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAWjE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,CAG7E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA6BtD;AAqDD,kDAAkD;AAClD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAehC;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAMlF"}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
// GEO METADATA
|
|
2
|
-
/**
|
|
3
|
-
* Reads the GeoMetadata object from the metadata
|
|
4
|
-
* @note geoarrow / parquet schema is stringified into a single key-value pair in the parquet metadata
|
|
5
|
-
*/
|
|
6
|
-
export function getGeoMetadata(schema) {
|
|
7
|
-
const geoMetadata = parseJSONStringMetadata(schema, 'geo');
|
|
8
|
-
if (!geoMetadata) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
for (const column of Object.values(geoMetadata.columns || {})) {
|
|
12
|
-
if (column.encoding) {
|
|
13
|
-
column.encoding = column.encoding.toLowerCase();
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return geoMetadata;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Stores a geoarrow / geoparquet geo metadata object in the schema
|
|
20
|
-
* @note geoarrow / geoparquet geo metadata is a single stringified JSON field
|
|
21
|
-
*/
|
|
22
|
-
export function setGeoMetadata(schema, geoMetadata) {
|
|
23
|
-
const stringifiedGeoMetadata = JSON.stringify(geoMetadata);
|
|
24
|
-
schema.metadata.geo = stringifiedGeoMetadata;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Unpacks geo metadata into separate metadata fields (parses the long JSON string)
|
|
28
|
-
* @note geoarrow / parquet schema is stringified into a single key-value pair in the parquet metadata
|
|
29
|
-
*/
|
|
30
|
-
export function unpackGeoMetadata(schema) {
|
|
31
|
-
const geoMetadata = getGeoMetadata(schema);
|
|
32
|
-
if (!geoMetadata) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
// Store Parquet Schema Level Metadata
|
|
36
|
-
const { version, primary_column, columns } = geoMetadata;
|
|
37
|
-
if (version) {
|
|
38
|
-
schema.metadata['geo.version'] = version;
|
|
39
|
-
}
|
|
40
|
-
if (primary_column) {
|
|
41
|
-
schema.metadata['geo.primary_column'] = primary_column;
|
|
42
|
-
}
|
|
43
|
-
// store column names as comma separated list
|
|
44
|
-
schema.metadata['geo.columns'] = Object.keys(columns || {}).join('');
|
|
45
|
-
for (const [columnName, columnMetadata] of Object.entries(columns || {})) {
|
|
46
|
-
const field = schema.fields.find((field) => field.name === columnName);
|
|
47
|
-
if (field) {
|
|
48
|
-
if (field.name === primary_column) {
|
|
49
|
-
setFieldMetadata(field, 'geo.primary_field', 'true');
|
|
50
|
-
}
|
|
51
|
-
unpackGeoFieldMetadata(field, columnMetadata);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// eslint-disable-next-line complexity
|
|
56
|
-
function unpackGeoFieldMetadata(field, columnMetadata) {
|
|
57
|
-
for (const [key, value] of Object.entries(columnMetadata || {})) {
|
|
58
|
-
switch (key) {
|
|
59
|
-
case 'geometry_types':
|
|
60
|
-
setFieldMetadata(field, `geo.${key}`, value.join(','));
|
|
61
|
-
break;
|
|
62
|
-
case 'bbox':
|
|
63
|
-
setFieldMetadata(field, `geo.crs.${key}`, JSON.stringify(value));
|
|
64
|
-
break;
|
|
65
|
-
case 'crs':
|
|
66
|
-
// @ts-ignore
|
|
67
|
-
for (const [crsKey, crsValue] of Object.entries(value || {})) {
|
|
68
|
-
switch (crsKey) {
|
|
69
|
-
case 'id':
|
|
70
|
-
// prettier-ignore
|
|
71
|
-
const crsId = typeof crsValue === 'object'
|
|
72
|
-
? // @ts-ignore
|
|
73
|
-
`${crsValue?.authority}:${crsValue?.code}`
|
|
74
|
-
: JSON.stringify(crsValue);
|
|
75
|
-
setFieldMetadata(field, `geo.crs.${crsKey}`, crsId);
|
|
76
|
-
break;
|
|
77
|
-
default:
|
|
78
|
-
setFieldMetadata(field, `geo.crs.${crsKey}`, typeof crsValue === 'string' ? crsValue : JSON.stringify(crsValue));
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
break;
|
|
83
|
-
case 'edges':
|
|
84
|
-
default:
|
|
85
|
-
setFieldMetadata(field, `geo.${key}`, typeof value === 'string' ? value : JSON.stringify(value));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function setFieldMetadata(field, key, value) {
|
|
90
|
-
field.metadata = field.metadata || {};
|
|
91
|
-
field.metadata[key] = value;
|
|
92
|
-
}
|
|
93
|
-
// HELPERS
|
|
94
|
-
/** Parse a key with stringified arrow metadata */
|
|
95
|
-
export function parseJSONStringMetadata(schema, metadataKey) {
|
|
96
|
-
const stringifiedMetadata = schema.metadata[metadataKey];
|
|
97
|
-
if (!stringifiedMetadata) {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
try {
|
|
101
|
-
const metadata = JSON.parse(stringifiedMetadata);
|
|
102
|
-
if (!metadata || typeof metadata !== 'object') {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
return metadata;
|
|
106
|
-
}
|
|
107
|
-
catch {
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
export function unpackJSONStringMetadata(schema, metadataKey) {
|
|
112
|
-
const json = parseJSONStringMetadata(schema, metadataKey);
|
|
113
|
-
for (const [key, value] of Object.entries(json || {})) {
|
|
114
|
-
schema.metadata[`${metadataKey}.${key}`] =
|
|
115
|
-
typeof value === 'string' ? value : JSON.stringify(value);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { LoaderWithParser } from '@loaders.gl/loader-utils';
|
|
2
|
-
import type { ArrayRowTable, GeoJSONTable, ObjectRowTable, Schema } from '@loaders.gl/schema';
|
|
3
|
-
/** TODO - move to loaders.gl/gis? */
|
|
4
|
-
export declare function convertWKBTableToGeoJSON(table: ArrayRowTable | ObjectRowTable, schema: Schema, loaders: LoaderWithParser[]): GeoJSONTable;
|
|
5
|
-
//# sourceMappingURL=convert-table-to-geojson.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-table-to-geojson.d.ts","sourceRoot":"","sources":["../../../src/lib/tables/convert-table-to-geojson.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EACd,MAAM,EAGP,MAAM,oBAAoB,CAAC;AAK5B,qCAAqC;AACrC,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,aAAa,GAAG,cAAc,EACrC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,gBAAgB,EAAE,GAC1B,YAAY,CAoBd"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
|
|
5
|
-
import {Schema, Field} from '@loaders.gl/schema';
|
|
6
|
-
|
|
7
|
-
export type GeoArrowEncoding =
|
|
8
|
-
| 'geoarrow.multipolygon'
|
|
9
|
-
| 'geoarrow.polygon'
|
|
10
|
-
| 'geoarrow.multilinestring'
|
|
11
|
-
| 'geoarrow.linestring'
|
|
12
|
-
| 'geoarrow.multipoint'
|
|
13
|
-
| 'geoarrow.point'
|
|
14
|
-
| 'geoarrow.wkb'
|
|
15
|
-
| 'geoarrow.wkt';
|
|
16
|
-
|
|
17
|
-
/** Array containing all encodings */
|
|
18
|
-
const GEOARROW_ENCODINGS = [
|
|
19
|
-
'geoarrow.multipolygon',
|
|
20
|
-
'geoarrow.polygon',
|
|
21
|
-
'geoarrow.multilinestring',
|
|
22
|
-
'geoarrow.linestring',
|
|
23
|
-
'geoarrow.multipoint',
|
|
24
|
-
'geoarrow.point',
|
|
25
|
-
'geoarrow.wkb',
|
|
26
|
-
'geoarrow.wkt'
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
const GEOARROW_COLUMN_METADATA_ENCODING = 'ARROW:extension:name';
|
|
30
|
-
const GEOARROW_COLUMN_METADATA_METADATA = 'ARROW:extension:metadata';
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Geospatial metadata for one column, extracted from Apache Arrow metadata
|
|
34
|
-
* @see https://github.com/geoarrow/geoarrow/blob/main/extension-types.md
|
|
35
|
-
*/
|
|
36
|
-
export type GeoArrowMetadata = {
|
|
37
|
-
/** Encoding of geometry in this column */
|
|
38
|
-
encoding?: GeoArrowEncoding;
|
|
39
|
-
/** CRS in [PROJJSON](https://proj.org/specifications/projjson.html). Omitted if producer has no information about CRS */
|
|
40
|
-
crs?: Record<string, unknown>;
|
|
41
|
-
/** Edges are either spherical or omitted */
|
|
42
|
-
edges?: 'spherical';
|
|
43
|
-
[key: string]: unknown;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* get geometry columns from arrow table
|
|
48
|
-
*/
|
|
49
|
-
export function getGeometryColumnsFromSchema(schema: Schema): Record<string, GeoArrowMetadata> {
|
|
50
|
-
const geometryColumns: Record<string, GeoArrowMetadata> = {};
|
|
51
|
-
for (const field of schema.fields) {
|
|
52
|
-
const metadata = getGeometryMetadataForField(field);
|
|
53
|
-
if (metadata) {
|
|
54
|
-
geometryColumns[field.name] = metadata;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return geometryColumns;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Extracts GeoArrow metadata from a field
|
|
61
|
-
* @param field
|
|
62
|
-
* @returns
|
|
63
|
-
* @see https://github.com/geoarrow/geoarrow/blob/d2f56704414d9ae71e8a5170a8671343ed15eefe/extension-types.md
|
|
64
|
-
*/
|
|
65
|
-
export function getGeometryMetadataForField(field: Field): GeoArrowMetadata | null {
|
|
66
|
-
let metadata: GeoArrowMetadata | null = null;
|
|
67
|
-
|
|
68
|
-
// Check for GeoArrow column encoding
|
|
69
|
-
let geoEncoding = field.metadata?.[GEOARROW_COLUMN_METADATA_ENCODING];
|
|
70
|
-
if (geoEncoding) {
|
|
71
|
-
geoEncoding = geoEncoding.toLowerCase();
|
|
72
|
-
// at time of testing, ogr2ogr uses WKB/WKT for encoding.
|
|
73
|
-
if (geoEncoding === 'wkb') {
|
|
74
|
-
geoEncoding = 'geoarrow.wkb';
|
|
75
|
-
}
|
|
76
|
-
if (geoEncoding === 'wkt') {
|
|
77
|
-
geoEncoding = 'geoarrow.wkt';
|
|
78
|
-
}
|
|
79
|
-
if (!GEOARROW_ENCODINGS.includes(geoEncoding)) {
|
|
80
|
-
// eslint-disable-next-line no-console
|
|
81
|
-
console.warn(`Invalid GeoArrow encoding: ${geoEncoding}`);
|
|
82
|
-
} else {
|
|
83
|
-
metadata = metadata || ({} as GeoArrowMetadata);
|
|
84
|
-
metadata.encoding = geoEncoding as GeoArrowEncoding;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Check for GeoArrow metadata
|
|
89
|
-
const columnMetadata = field.metadata?.[GEOARROW_COLUMN_METADATA_METADATA];
|
|
90
|
-
if (columnMetadata) {
|
|
91
|
-
try {
|
|
92
|
-
metadata = JSON.parse(columnMetadata);
|
|
93
|
-
} catch (error) {
|
|
94
|
-
// eslint-disable-next-line no-console
|
|
95
|
-
console.warn('Failed to parse GeoArrow metadata', error);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return metadata || null;
|
|
100
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "GeoParquet",
|
|
4
|
-
"description": "Parquet metadata included in the geo field.",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"required": ["version", "primary_column", "columns"],
|
|
7
|
-
"properties": {
|
|
8
|
-
"version": {"type": "string", "const": "1.0.0-beta.1"},
|
|
9
|
-
"primary_column": {"type": "string", "minLength": 1},
|
|
10
|
-
"columns": {
|
|
11
|
-
"type": "object",
|
|
12
|
-
"minProperties": 1,
|
|
13
|
-
"patternProperties": {
|
|
14
|
-
".+": {
|
|
15
|
-
"type": "object",
|
|
16
|
-
"required": ["encoding", "geometry_types"],
|
|
17
|
-
"properties": {
|
|
18
|
-
"encoding": {"type": "string", "const": "WKB"},
|
|
19
|
-
"geometry_types": {
|
|
20
|
-
"type": "array",
|
|
21
|
-
"uniqueItems": true,
|
|
22
|
-
"items": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"pattern": "^(GeometryCollection|(Multi)?(Point|LineString|Polygon))( Z)?$"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"crs": {
|
|
28
|
-
"oneOf": [
|
|
29
|
-
{
|
|
30
|
-
"$ref": "https://proj.org/schemas/v0.5/projjson.schema.json"
|
|
31
|
-
},
|
|
32
|
-
{"type": "null"}
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
"edges": {"type": "string", "enum": ["planar", "spherical"]},
|
|
36
|
-
"orientation": {"type": "string", "const": "counterclockwise"},
|
|
37
|
-
"bbox": {
|
|
38
|
-
"type": "array",
|
|
39
|
-
"items": {"type": "number"},
|
|
40
|
-
"oneOf": [
|
|
41
|
-
{
|
|
42
|
-
"description": "2D bbox consisting of (xmin, ymin, xmax, ymax)",
|
|
43
|
-
"minItems": 4,
|
|
44
|
-
"maxItems": 4
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"description": "3D bbox consisting of (xmin, ymin, zmin, xmax, ymax, zmax)",
|
|
48
|
-
"minItems": 6,
|
|
49
|
-
"maxItems": 6
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
"epoch": {"type": "number"}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"additionalProperties": false
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
|
|
5
|
-
/* eslint-disable camelcase */
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Geoparquet JSON schema for geo metadata
|
|
9
|
-
* @see https://github.com/geoarrow/geoarrow/blob/main/metadata.md
|
|
10
|
-
* @see https://github.com/opengeospatial/geoparquet/blob/main/format-specs/geoparquet.md
|
|
11
|
-
*/
|
|
12
|
-
export const GEOPARQUET_METADATA_JSON_SCHEMA = {
|
|
13
|
-
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
14
|
-
title: 'GeoParquet',
|
|
15
|
-
description: 'Parquet metadata included in the geo field.',
|
|
16
|
-
type: 'object',
|
|
17
|
-
required: ['version', 'primary_column', 'columns'],
|
|
18
|
-
properties: {
|
|
19
|
-
version: {type: 'string', const: '1.0.0-beta.1'},
|
|
20
|
-
primary_column: {type: 'string', minLength: 1},
|
|
21
|
-
columns: {
|
|
22
|
-
type: 'object',
|
|
23
|
-
minProperties: 1,
|
|
24
|
-
patternProperties: {
|
|
25
|
-
'.+': {
|
|
26
|
-
type: 'object',
|
|
27
|
-
required: ['encoding', 'geometry_types'],
|
|
28
|
-
properties: {
|
|
29
|
-
encoding: {type: 'string', const: 'WKB'},
|
|
30
|
-
geometry_types: {
|
|
31
|
-
type: 'array',
|
|
32
|
-
uniqueItems: true,
|
|
33
|
-
items: {
|
|
34
|
-
type: 'string',
|
|
35
|
-
pattern: '^(GeometryCollection|(Multi)?(Point|LineString|Polygon))( Z)?$'
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
crs: {
|
|
39
|
-
oneOf: [
|
|
40
|
-
{
|
|
41
|
-
$ref: 'https://proj.org/schemas/v0.5/projjson.schema.json'
|
|
42
|
-
},
|
|
43
|
-
{type: 'null'}
|
|
44
|
-
]
|
|
45
|
-
},
|
|
46
|
-
edges: {type: 'string', enum: ['planar', 'spherical']},
|
|
47
|
-
orientation: {type: 'string', const: 'counterclockwise'},
|
|
48
|
-
bbox: {
|
|
49
|
-
type: 'array',
|
|
50
|
-
items: {type: 'number'},
|
|
51
|
-
oneOf: [
|
|
52
|
-
{
|
|
53
|
-
description: '2D bbox consisting of (xmin, ymin, xmax, ymax)',
|
|
54
|
-
minItems: 4,
|
|
55
|
-
maxItems: 4
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
description: '3D bbox consisting of (xmin, ymin, zmin, xmax, ymax, zmax)',
|
|
59
|
-
minItems: 6,
|
|
60
|
-
maxItems: 6
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
},
|
|
64
|
-
epoch: {type: 'number'}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
additionalProperties: false
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|