@loaders.gl/gis 4.2.0-alpha.4 → 4.2.0-alpha.6
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 +35 -92
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +12 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/lib/binary-features/binary-to-geojson.js +175 -171
- package/dist/lib/binary-features/extract-geometry-info.js +88 -80
- package/dist/lib/binary-features/flat-geojson-to-binary-types.js +0 -1
- package/dist/lib/binary-features/flat-geojson-to-binary.d.ts +1 -1
- package/dist/lib/binary-features/flat-geojson-to-binary.d.ts.map +1 -1
- package/dist/lib/binary-features/flat-geojson-to-binary.js +346 -281
- package/dist/lib/binary-features/geojson-to-binary.js +17 -20
- package/dist/lib/binary-features/geojson-to-flat-geojson.js +111 -84
- package/dist/lib/binary-features/transform.js +44 -30
- package/dist/lib/geo/geoarrow-metadata.js +61 -34
- package/dist/lib/geo/geoparquet-metadata-schema.js +64 -71
- package/dist/lib/geo/geoparquet-metadata.d.ts.map +1 -1
- package/dist/lib/geo/geoparquet-metadata.js +97 -77
- package/dist/lib/tables/convert-table-to-geojson.js +38 -42
- package/package.json +7 -4
- package/src/lib/geo/geoparquet-metadata.ts +2 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/binary-features/binary-to-geojson.js.map +0 -1
- package/dist/lib/binary-features/extract-geometry-info.js.map +0 -1
- package/dist/lib/binary-features/flat-geojson-to-binary-types.js.map +0 -1
- package/dist/lib/binary-features/flat-geojson-to-binary.js.map +0 -1
- package/dist/lib/binary-features/geojson-to-binary.js.map +0 -1
- package/dist/lib/binary-features/geojson-to-flat-geojson.js.map +0 -1
- package/dist/lib/binary-features/transform.js.map +0 -1
- package/dist/lib/geo/geoarrow-metadata.js.map +0 -1
- package/dist/lib/geo/geoparquet-metadata-schema.js.map +0 -1
- package/dist/lib/geo/geoparquet-metadata-schema.json +0 -60
- package/dist/lib/geo/geoparquet-metadata.js.map +0 -1
- package/dist/lib/tables/convert-table-to-geojson.js.map +0 -1
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
import { extractGeometryInfo } from "./extract-geometry-info.js";
|
|
2
2
|
import { geojsonToFlatGeojson } from "./geojson-to-flat-geojson.js";
|
|
3
3
|
import { flatGeojsonToBinary } from "./flat-geojson-to-binary.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
coordLength,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
triangulate: options.triangulate
|
|
22
|
-
});
|
|
4
|
+
/**
|
|
5
|
+
* Convert GeoJSON features to flat binary arrays
|
|
6
|
+
*
|
|
7
|
+
* @param features
|
|
8
|
+
* @param options
|
|
9
|
+
* @returns features in binary format, grouped by geometry type
|
|
10
|
+
*/
|
|
11
|
+
export function geojsonToBinary(features, options = { fixRingWinding: true, triangulate: true }) {
|
|
12
|
+
const geometryInfo = extractGeometryInfo(features);
|
|
13
|
+
const coordLength = geometryInfo.coordLength;
|
|
14
|
+
const { fixRingWinding } = options;
|
|
15
|
+
const flatFeatures = geojsonToFlatGeojson(features, { coordLength, fixRingWinding });
|
|
16
|
+
return flatGeojsonToBinary(flatFeatures, geometryInfo, {
|
|
17
|
+
numericPropKeys: options.numericPropKeys,
|
|
18
|
+
PositionDataType: options.PositionDataType || Float32Array,
|
|
19
|
+
triangulate: options.triangulate
|
|
20
|
+
});
|
|
23
21
|
}
|
|
24
|
-
//# sourceMappingURL=geojson-to-binary.js.map
|
|
@@ -1,97 +1,124 @@
|
|
|
1
1
|
import { getPolygonSignedArea } from '@math.gl/polygon';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Convert GeoJSON features to Flat GeoJSON features
|
|
4
|
+
*
|
|
5
|
+
* @param features
|
|
6
|
+
* @param options
|
|
7
|
+
* @returns an Array of Flat GeoJSON features
|
|
8
|
+
*/
|
|
9
|
+
export function geojsonToFlatGeojson(features, options = { coordLength: 2, fixRingWinding: true }) {
|
|
10
|
+
return features.map((feature) => flattenFeature(feature, options));
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Helper function to copy Point values from `coordinates` into `data` & `indices`
|
|
14
|
+
*
|
|
15
|
+
* @param coordinates
|
|
16
|
+
* @param data
|
|
17
|
+
* @param indices
|
|
18
|
+
* @param options
|
|
19
|
+
*/
|
|
9
20
|
function flattenPoint(coordinates, data, indices, options) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
indices.push(data.length);
|
|
22
|
+
data.push(...coordinates);
|
|
23
|
+
// Pad up to coordLength
|
|
24
|
+
for (let i = coordinates.length; i < options.coordLength; i++) {
|
|
25
|
+
data.push(0);
|
|
26
|
+
}
|
|
15
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Helper function to copy LineString values from `coordinates` into `data` & `indices`
|
|
30
|
+
*
|
|
31
|
+
* @param coordinates
|
|
32
|
+
* @param data
|
|
33
|
+
* @param indices
|
|
34
|
+
* @param options
|
|
35
|
+
*/
|
|
16
36
|
function flattenLineString(coordinates, data, indices, options) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
37
|
+
indices.push(data.length);
|
|
38
|
+
for (const c of coordinates) {
|
|
39
|
+
data.push(...c);
|
|
40
|
+
// Pad up to coordLength
|
|
41
|
+
for (let i = c.length; i < options.coordLength; i++) {
|
|
42
|
+
data.push(0);
|
|
43
|
+
}
|
|
22
44
|
}
|
|
23
|
-
}
|
|
24
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Helper function to copy Polygon values from `coordinates` into `data` & `indices` & `areas`
|
|
48
|
+
*
|
|
49
|
+
* @param coordinates
|
|
50
|
+
* @param data
|
|
51
|
+
* @param indices
|
|
52
|
+
* @param areas
|
|
53
|
+
* @param options
|
|
54
|
+
*/
|
|
25
55
|
function flattenPolygon(coordinates, data, indices, areas, options) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
56
|
+
let count = 0;
|
|
57
|
+
const ringAreas = [];
|
|
58
|
+
const polygons = [];
|
|
59
|
+
for (const lineString of coordinates) {
|
|
60
|
+
const lineString2d = lineString.map((p) => p.slice(0, 2));
|
|
61
|
+
let area = getPolygonSignedArea(lineString2d.flat());
|
|
62
|
+
const ccw = area < 0;
|
|
63
|
+
// Exterior ring must be CCW and interior rings CW
|
|
64
|
+
if (options.fixRingWinding && ((count === 0 && !ccw) || (count > 0 && ccw))) {
|
|
65
|
+
lineString.reverse();
|
|
66
|
+
area = -area;
|
|
67
|
+
}
|
|
68
|
+
ringAreas.push(area);
|
|
69
|
+
flattenLineString(lineString, data, polygons, options);
|
|
70
|
+
count++;
|
|
71
|
+
}
|
|
72
|
+
if (count > 0) {
|
|
73
|
+
areas.push(ringAreas);
|
|
74
|
+
indices.push(polygons);
|
|
36
75
|
}
|
|
37
|
-
ringAreas.push(area);
|
|
38
|
-
flattenLineString(lineString, data, polygons, options);
|
|
39
|
-
count++;
|
|
40
|
-
}
|
|
41
|
-
if (count > 0) {
|
|
42
|
-
areas.push(ringAreas);
|
|
43
|
-
indices.push(polygons);
|
|
44
|
-
}
|
|
45
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Flatten single GeoJSON feature into Flat GeoJSON
|
|
79
|
+
*
|
|
80
|
+
* @param feature
|
|
81
|
+
* @param options
|
|
82
|
+
* @returns A Flat GeoJSON feature
|
|
83
|
+
*/
|
|
46
84
|
function flattenFeature(feature, options) {
|
|
47
|
-
|
|
48
|
-
geometry
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
default:
|
|
85
|
-
throw new Error(`Unknown type: ${type}`);
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
...feature,
|
|
89
|
-
geometry: {
|
|
90
|
-
type,
|
|
91
|
-
indices,
|
|
92
|
-
data,
|
|
93
|
-
areas
|
|
85
|
+
const { geometry } = feature;
|
|
86
|
+
if (geometry.type === 'GeometryCollection') {
|
|
87
|
+
throw new Error('GeometryCollection type not supported');
|
|
88
|
+
}
|
|
89
|
+
const data = [];
|
|
90
|
+
const indices = [];
|
|
91
|
+
let areas;
|
|
92
|
+
let type;
|
|
93
|
+
switch (geometry.type) {
|
|
94
|
+
case 'Point':
|
|
95
|
+
type = 'Point';
|
|
96
|
+
flattenPoint(geometry.coordinates, data, indices, options);
|
|
97
|
+
break;
|
|
98
|
+
case 'MultiPoint':
|
|
99
|
+
type = 'Point';
|
|
100
|
+
geometry.coordinates.map((c) => flattenPoint(c, data, indices, options));
|
|
101
|
+
break;
|
|
102
|
+
case 'LineString':
|
|
103
|
+
type = 'LineString';
|
|
104
|
+
flattenLineString(geometry.coordinates, data, indices, options);
|
|
105
|
+
break;
|
|
106
|
+
case 'MultiLineString':
|
|
107
|
+
type = 'LineString';
|
|
108
|
+
geometry.coordinates.map((c) => flattenLineString(c, data, indices, options));
|
|
109
|
+
break;
|
|
110
|
+
case 'Polygon':
|
|
111
|
+
type = 'Polygon';
|
|
112
|
+
areas = [];
|
|
113
|
+
flattenPolygon(geometry.coordinates, data, indices, areas, options);
|
|
114
|
+
break;
|
|
115
|
+
case 'MultiPolygon':
|
|
116
|
+
type = 'Polygon';
|
|
117
|
+
areas = [];
|
|
118
|
+
geometry.coordinates.map((c) => flattenPolygon(c, data, indices, areas, options));
|
|
119
|
+
break;
|
|
120
|
+
default:
|
|
121
|
+
throw new Error(`Unknown type: ${type}`);
|
|
94
122
|
}
|
|
95
|
-
|
|
123
|
+
return { ...feature, geometry: { type, indices, data, areas } };
|
|
96
124
|
}
|
|
97
|
-
//# sourceMappingURL=geojson-to-flat-geojson.js.map
|
|
@@ -1,40 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply transformation to every coordinate of binary features
|
|
3
|
+
* @param binaryFeatures binary features
|
|
4
|
+
* @param transformCoordinate Function to call on each coordinate
|
|
5
|
+
* @return Transformed binary features
|
|
6
|
+
*/
|
|
1
7
|
export function transformBinaryCoords(binaryFeatures, transformCoordinate) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
if (binaryFeatures.points) {
|
|
9
|
+
transformBinaryGeometryPositions(binaryFeatures.points, transformCoordinate);
|
|
10
|
+
}
|
|
11
|
+
if (binaryFeatures.lines) {
|
|
12
|
+
transformBinaryGeometryPositions(binaryFeatures.lines, transformCoordinate);
|
|
13
|
+
}
|
|
14
|
+
if (binaryFeatures.polygons) {
|
|
15
|
+
transformBinaryGeometryPositions(binaryFeatures.polygons, transformCoordinate);
|
|
16
|
+
}
|
|
17
|
+
return binaryFeatures;
|
|
12
18
|
}
|
|
19
|
+
/** Transform one binary geometry */
|
|
13
20
|
function transformBinaryGeometryPositions(binaryGeometry, fn) {
|
|
14
|
-
|
|
15
|
-
positions
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
const { positions } = binaryGeometry;
|
|
22
|
+
for (let i = 0; i < positions.value.length; i += positions.size) {
|
|
23
|
+
// @ts-ignore inclusion of bigint causes problems
|
|
24
|
+
const coord = Array.from(positions.value.subarray(i, i + positions.size));
|
|
25
|
+
const transformedCoord = fn(coord);
|
|
26
|
+
// @ts-ignore typescript typing for .set seems to require bigint?
|
|
27
|
+
positions.value.set(transformedCoord, i);
|
|
28
|
+
}
|
|
22
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Apply transformation to every coordinate of GeoJSON features
|
|
32
|
+
*
|
|
33
|
+
* @param features Array of GeoJSON features
|
|
34
|
+
* @param fn Function to call on each coordinate
|
|
35
|
+
* @return Transformed GeoJSON features
|
|
36
|
+
*/
|
|
23
37
|
export function transformGeoJsonCoords(features, fn) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
38
|
+
for (const feature of features) {
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
feature.geometry.coordinates = coordMap(feature.geometry.coordinates, fn);
|
|
41
|
+
}
|
|
42
|
+
return features;
|
|
28
43
|
}
|
|
29
44
|
function coordMap(array, fn) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
if (isCoord(array)) {
|
|
46
|
+
return fn(array);
|
|
47
|
+
}
|
|
48
|
+
return array.map((item) => {
|
|
49
|
+
return coordMap(item, fn);
|
|
50
|
+
});
|
|
36
51
|
}
|
|
37
52
|
function isCoord(array) {
|
|
38
|
-
|
|
53
|
+
return Array.isArray(array) && Number.isFinite(array[0]) && Number.isFinite(array[1]);
|
|
39
54
|
}
|
|
40
|
-
//# sourceMappingURL=transform.js.map
|
|
@@ -1,43 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
/** Array containing all encodings */
|
|
5
|
+
const GEOARROW_ENCODINGS = [
|
|
6
|
+
'geoarrow.multipolygon',
|
|
7
|
+
'geoarrow.polygon',
|
|
8
|
+
'geoarrow.multilinestring',
|
|
9
|
+
'geoarrow.linestring',
|
|
10
|
+
'geoarrow.multipoint',
|
|
11
|
+
'geoarrow.point',
|
|
12
|
+
'geoarrow.wkb',
|
|
13
|
+
'geoarrow.wkt'
|
|
14
|
+
];
|
|
2
15
|
const GEOARROW_COLUMN_METADATA_ENCODING = 'ARROW:extension:name';
|
|
3
16
|
const GEOARROW_COLUMN_METADATA_METADATA = 'ARROW:extension:metadata';
|
|
17
|
+
/**
|
|
18
|
+
* get geometry columns from arrow table
|
|
19
|
+
*/
|
|
4
20
|
export function getGeometryColumnsFromSchema(schema) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
const geometryColumns = {};
|
|
22
|
+
for (const field of schema.fields) {
|
|
23
|
+
const metadata = getGeometryMetadataForField(field);
|
|
24
|
+
if (metadata) {
|
|
25
|
+
geometryColumns[field.name] = metadata;
|
|
26
|
+
}
|
|
10
27
|
}
|
|
11
|
-
|
|
12
|
-
return geometryColumns;
|
|
28
|
+
return geometryColumns;
|
|
13
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Extracts GeoArrow metadata from a field
|
|
32
|
+
* @param field
|
|
33
|
+
* @returns
|
|
34
|
+
* @see https://github.com/geoarrow/geoarrow/blob/d2f56704414d9ae71e8a5170a8671343ed15eefe/extension-types.md
|
|
35
|
+
*/
|
|
14
36
|
export function getGeometryMetadataForField(field) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
37
|
+
let metadata = null;
|
|
38
|
+
// Check for GeoArrow column encoding
|
|
39
|
+
let geoEncoding = field.metadata?.[GEOARROW_COLUMN_METADATA_ENCODING];
|
|
40
|
+
if (geoEncoding) {
|
|
41
|
+
geoEncoding = geoEncoding.toLowerCase();
|
|
42
|
+
// at time of testing, ogr2ogr uses WKB/WKT for encoding.
|
|
43
|
+
if (geoEncoding === 'wkb') {
|
|
44
|
+
geoEncoding = 'geoarrow.wkb';
|
|
45
|
+
}
|
|
46
|
+
if (geoEncoding === 'wkt') {
|
|
47
|
+
geoEncoding = 'geoarrow.wkt';
|
|
48
|
+
}
|
|
49
|
+
if (!GEOARROW_ENCODINGS.includes(geoEncoding)) {
|
|
50
|
+
// eslint-disable-next-line no-console
|
|
51
|
+
console.warn(`Invalid GeoArrow encoding: ${geoEncoding}`);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
metadata = metadata || {};
|
|
55
|
+
metadata.encoding = geoEncoding;
|
|
56
|
+
}
|
|
22
57
|
}
|
|
23
|
-
|
|
24
|
-
|
|
58
|
+
// Check for GeoArrow metadata
|
|
59
|
+
const columnMetadata = field.metadata?.[GEOARROW_COLUMN_METADATA_METADATA];
|
|
60
|
+
if (columnMetadata) {
|
|
61
|
+
try {
|
|
62
|
+
metadata = JSON.parse(columnMetadata);
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
// eslint-disable-next-line no-console
|
|
66
|
+
console.warn('Failed to parse GeoArrow metadata', error);
|
|
67
|
+
}
|
|
25
68
|
}
|
|
26
|
-
|
|
27
|
-
console.warn(`Invalid GeoArrow encoding: ${geoEncoding}`);
|
|
28
|
-
} else {
|
|
29
|
-
metadata = metadata || {};
|
|
30
|
-
metadata.encoding = geoEncoding;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const columnMetadata = (_field$metadata2 = field.metadata) === null || _field$metadata2 === void 0 ? void 0 : _field$metadata2[GEOARROW_COLUMN_METADATA_METADATA];
|
|
34
|
-
if (columnMetadata) {
|
|
35
|
-
try {
|
|
36
|
-
metadata = JSON.parse(columnMetadata);
|
|
37
|
-
} catch (error) {
|
|
38
|
-
console.warn('Failed to parse GeoArrow metadata', error);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return metadata || null;
|
|
69
|
+
return metadata || null;
|
|
42
70
|
}
|
|
43
|
-
//# sourceMappingURL=geoarrow-metadata.js.map
|
|
@@ -1,76 +1,69 @@
|
|
|
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
|
+
*/
|
|
1
10
|
export const GEOPARQUET_METADATA_JSON_SCHEMA = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
+
}
|
|
27
65
|
},
|
|
28
|
-
|
|
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
|
-
$ref: 'https://proj.org/schemas/v0.5/projjson.schema.json'
|
|
39
|
-
}, {
|
|
40
|
-
type: 'null'
|
|
41
|
-
}]
|
|
42
|
-
},
|
|
43
|
-
edges: {
|
|
44
|
-
type: 'string',
|
|
45
|
-
enum: ['planar', 'spherical']
|
|
46
|
-
},
|
|
47
|
-
orientation: {
|
|
48
|
-
type: 'string',
|
|
49
|
-
const: 'counterclockwise'
|
|
50
|
-
},
|
|
51
|
-
bbox: {
|
|
52
|
-
type: 'array',
|
|
53
|
-
items: {
|
|
54
|
-
type: 'number'
|
|
55
|
-
},
|
|
56
|
-
oneOf: [{
|
|
57
|
-
description: '2D bbox consisting of (xmin, ymin, xmax, ymax)',
|
|
58
|
-
minItems: 4,
|
|
59
|
-
maxItems: 4
|
|
60
|
-
}, {
|
|
61
|
-
description: '3D bbox consisting of (xmin, ymin, zmin, xmax, ymax, zmax)',
|
|
62
|
-
minItems: 6,
|
|
63
|
-
maxItems: 6
|
|
64
|
-
}]
|
|
65
|
-
},
|
|
66
|
-
epoch: {
|
|
67
|
-
type: 'number'
|
|
68
|
-
}
|
|
69
|
-
}
|
|
66
|
+
additionalProperties: false
|
|
70
67
|
}
|
|
71
|
-
},
|
|
72
|
-
additionalProperties: false
|
|
73
68
|
}
|
|
74
|
-
}
|
|
75
69
|
};
|
|
76
|
-
//# sourceMappingURL=geoparquet-metadata-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
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,CAA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