@loaders.gl/schema 4.0.0-alpha.20 → 4.0.0-alpha.22

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.
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=binary-geometries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-geometries.js","names":[],"sources":["../../../src/types/binary-geometries.ts"],"sourcesContent":["// GIS\nimport type {TypedArray} from './types';\n\n// BINARY FORMAT GEOMETRY\n\nexport type BinaryAttribute = {value: TypedArray; size: number};\nexport type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';\n\ntype NumericProps = {[key: string]: BinaryAttribute};\ntype Properties = object[];\n\n/**\n * Represent a single Geometry, similar to a GeoJSON Geometry\n */\nexport type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;\n\n/** Binary point geometry: an array of positions */\nexport type BinaryPointGeometry = {\n type: 'Point';\n positions: BinaryAttribute;\n};\n\n/** Binary line geometry, array of positions and indices to the start of each line */\nexport type BinaryLineGeometry = {\n type: 'LineString';\n positions: BinaryAttribute;\n pathIndices: BinaryAttribute;\n};\n\n/** Binary polygon geometry, an array of positions to each primitite polygon and polygon */\nexport type BinaryPolygonGeometry = {\n type: 'Polygon';\n positions: BinaryAttribute;\n polygonIndices: BinaryAttribute;\n primitivePolygonIndices: BinaryAttribute;\n triangles?: BinaryAttribute;\n};\n\n/** Common properties for binary geometries */\nexport type BinaryProperties = {\n featureIds: BinaryAttribute;\n globalFeatureIds: BinaryAttribute;\n numericProps: NumericProps;\n properties: Properties;\n fields?: Properties;\n};\n\nexport type BinaryPointFeatures = BinaryPointGeometry & BinaryProperties;\nexport type BinaryLineFeatures = BinaryLineGeometry & BinaryProperties;\nexport type BinaryPolygonFeatures = BinaryPolygonGeometry & BinaryProperties;\n\n/**\n * Represent a collection of Features, similar to a GeoJSON FeatureCollection\n */\nexport type BinaryFeatures = {\n points?: BinaryPointFeatures;\n lines?: BinaryLineFeatures;\n polygons?: BinaryPolygonFeatures;\n};\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"category-gis.js","names":[],"sources":["../../../src/types/category-gis.ts"],"sourcesContent":["// GIS\nimport type {TypedArray} from './types';\nimport type {Feature, Geometry, Point, LineString, Polygon} from 'geojson';\n\n// GEOJSON FORMAT GEOMETRY\n\n// eslint-disable-next-line import/no-unresolved\nexport type {\n GeoJSON,\n Feature,\n FeatureCollection,\n Geometry,\n Position,\n GeoJsonProperties\n} from 'geojson';\n// eslint-disable-next-line import/no-unresolved\nexport type {\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n Polygon,\n MultiPolygon,\n GeometryCollection\n} from 'geojson';\n\n// Aggregate information for converting GeoJSON into other formats\nexport type GeojsonGeometryInfo = {\n coordLength: number;\n pointPositionsCount: number;\n pointFeaturesCount: number;\n linePositionsCount: number;\n linePathsCount: number;\n lineFeaturesCount: number;\n polygonPositionsCount: number;\n polygonObjectsCount: number;\n polygonRingsCount: number;\n polygonFeaturesCount: number;\n};\n\n// FLAT GEOJSON FORMAT GEOMETRY\nexport type FlatGeometryType = 'Point' | 'LineString' | 'Polygon';\ntype RemoveCoordinatesField<Type> = {\n [Property in keyof Type as Exclude<Property, 'coordinates'>]: Type[Property];\n};\n\n/**\n * Generic flat geometry data storage type\n */\nexport type FlatIndexedGeometry = {\n data: number[];\n indices: number[];\n};\n\n/**\n * GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices`\n */\nexport type FlatPoint = RemoveCoordinatesField<Point> & FlatIndexedGeometry;\n\n/**\n * GeoJSON (Multi)LineString geometry with coordinate data flattened into `data` array and indexed by `indices`\n */\nexport type FlatLineString = RemoveCoordinatesField<LineString> & FlatIndexedGeometry;\n\n/**\n * GeoJSON (Multi)Polygon geometry with coordinate data flattened into `data` array and indexed by 2D `indices`\n */\nexport type FlatPolygon = RemoveCoordinatesField<Polygon> & {\n data: number[];\n indices: number[][];\n areas: number[][];\n};\n\nexport type FlatGeometry = FlatPoint | FlatLineString | FlatPolygon;\n\ntype FlattenGeometry<Type> = {\n [Property in keyof Type]: Type[Property] extends Geometry ? FlatGeometry : Type[Property];\n};\n\n/**\n * GeoJSON Feature with Geometry replaced by FlatGeometry\n */\nexport type FlatFeature = FlattenGeometry<Feature>;\n\n// BINARY FORMAT GEOMETRY\n\nexport type BinaryAttribute = {value: TypedArray; size: number};\nexport type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';\n\ntype NumericProps = {[key: string]: BinaryAttribute};\ntype Properties = object[];\n\n/**\n * Represent a single Geometry, similar to a GeoJSON Geometry\n */\nexport type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;\n\nexport type BinaryPointGeometry = {\n type: 'Point';\n positions: BinaryAttribute;\n};\n\nexport type BinaryLineGeometry = {\n type: 'LineString';\n positions: BinaryAttribute;\n pathIndices: BinaryAttribute;\n};\n\nexport type BinaryPolygonGeometry = {\n type: 'Polygon';\n positions: BinaryAttribute;\n polygonIndices: BinaryAttribute;\n primitivePolygonIndices: BinaryAttribute;\n triangles?: BinaryAttribute;\n};\n\nexport type BinaryProperties = {\n featureIds: BinaryAttribute;\n globalFeatureIds: BinaryAttribute;\n numericProps: NumericProps;\n properties: Properties;\n fields?: Properties;\n};\n\nexport type BinaryPointFeatures = BinaryPointGeometry & BinaryProperties;\nexport type BinaryLineFeatures = BinaryLineGeometry & BinaryProperties;\nexport type BinaryPolygonFeatures = BinaryPolygonGeometry & BinaryProperties;\n\n/**\n * Represent a collection of Features, similar to a GeoJSON FeatureCollection\n */\nexport type BinaryFeatures = {\n points?: BinaryPointFeatures;\n lines?: BinaryLineFeatures;\n polygons?: BinaryPolygonFeatures;\n};\n"],"mappings":""}
1
+ {"version":3,"file":"category-gis.js","names":[],"sources":["../../../src/types/category-gis.ts"],"sourcesContent":["// GIS\n\n// NORMAL GEOJSON FORMAT GEOMETRY\nexport type {\n GeoJSON,\n Feature,\n FeatureCollection,\n Geometry,\n Position,\n GeoJsonProperties\n} from 'geojson';\n\nexport type {\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n Polygon,\n MultiPolygon,\n GeometryCollection\n} from 'geojson';\n\n// FLAT GEOJSON FORMAT GEOMETRY\nexport type {\n FlatGeometryType,\n FlatIndexedGeometry,\n FlatPoint,\n FlatLineString,\n FlatPolygon,\n FlatGeometry,\n FlatFeature\n} from './flat-geometries';\n\n// BINARY FORMAT GEOMETRY\nexport type {\n BinaryAttribute,\n BinaryGeometryType,\n BinaryGeometry,\n BinaryPointGeometry,\n BinaryLineGeometry,\n BinaryPolygonGeometry,\n BinaryProperties,\n BinaryFeatures,\n BinaryPointFeatures,\n BinaryLineFeatures,\n BinaryPolygonFeatures\n} from './binary-geometries';\n\n/** Aggregate information for converting GeoJSON into other formats */\nexport type GeojsonGeometryInfo = {\n coordLength: number;\n pointPositionsCount: number;\n pointFeaturesCount: number;\n linePositionsCount: number;\n linePathsCount: number;\n lineFeaturesCount: number;\n polygonPositionsCount: number;\n polygonObjectsCount: number;\n polygonRingsCount: number;\n polygonFeaturesCount: number;\n};\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=flat-geometries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flat-geometries.js","names":[],"sources":["../../../src/types/flat-geometries.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// FLAT GEOJSON FORMAT GEOMETRY\nimport type {Feature, Geometry, Point, LineString, Polygon} from 'geojson';\n\n/** Flat geometry type */\nexport type FlatGeometryType = 'Point' | 'LineString' | 'Polygon';\n\ntype RemoveCoordinatesField<Type> = {\n [Property in keyof Type as Exclude<Property, 'coordinates'>]: Type[Property];\n};\n\n/** Generic flat geometry data storage type */\nexport type FlatIndexedGeometry = {\n data: number[];\n indices: number[];\n};\n\n/** GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices` */\nexport type FlatPoint = RemoveCoordinatesField<Point> & FlatIndexedGeometry;\n\n/** GeoJSON (Multi)LineString geometry with coordinate data flattened into `data` array and indexed by `indices` */\nexport type FlatLineString = RemoveCoordinatesField<LineString> & FlatIndexedGeometry;\n\n/** GeoJSON (Multi)Polygon geometry with coordinate data flattened into `data` array and indexed by 2D `indices` */\nexport type FlatPolygon = RemoveCoordinatesField<Polygon> & {\n data: number[];\n indices: number[][];\n areas: number[][];\n};\n\n/** GeoJSON geometry with coordinate data flattened into `data` array and indexed by 2D `indices` */\nexport type FlatGeometry = FlatPoint | FlatLineString | FlatPolygon;\n\ntype FlattenGeometry<Type> = {\n [Property in keyof Type]: Type[Property] extends Geometry ? FlatGeometry : Type[Property];\n};\n\n/** GeoJSON Feature with Geometry replaced by FlatGeometry */\nexport type FlatFeature = FlattenGeometry<Feature>;\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=binary-geometries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-geometries.js","names":[],"sources":["../../../src/types/binary-geometries.ts"],"sourcesContent":["// GIS\nimport type {TypedArray} from './types';\n\n// BINARY FORMAT GEOMETRY\n\nexport type BinaryAttribute = {value: TypedArray; size: number};\nexport type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';\n\ntype NumericProps = {[key: string]: BinaryAttribute};\ntype Properties = object[];\n\n/**\n * Represent a single Geometry, similar to a GeoJSON Geometry\n */\nexport type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;\n\n/** Binary point geometry: an array of positions */\nexport type BinaryPointGeometry = {\n type: 'Point';\n positions: BinaryAttribute;\n};\n\n/** Binary line geometry, array of positions and indices to the start of each line */\nexport type BinaryLineGeometry = {\n type: 'LineString';\n positions: BinaryAttribute;\n pathIndices: BinaryAttribute;\n};\n\n/** Binary polygon geometry, an array of positions to each primitite polygon and polygon */\nexport type BinaryPolygonGeometry = {\n type: 'Polygon';\n positions: BinaryAttribute;\n polygonIndices: BinaryAttribute;\n primitivePolygonIndices: BinaryAttribute;\n triangles?: BinaryAttribute;\n};\n\n/** Common properties for binary geometries */\nexport type BinaryProperties = {\n featureIds: BinaryAttribute;\n globalFeatureIds: BinaryAttribute;\n numericProps: NumericProps;\n properties: Properties;\n fields?: Properties;\n};\n\nexport type BinaryPointFeatures = BinaryPointGeometry & BinaryProperties;\nexport type BinaryLineFeatures = BinaryLineGeometry & BinaryProperties;\nexport type BinaryPolygonFeatures = BinaryPolygonGeometry & BinaryProperties;\n\n/**\n * Represent a collection of Features, similar to a GeoJSON FeatureCollection\n */\nexport type BinaryFeatures = {\n points?: BinaryPointFeatures;\n lines?: BinaryLineFeatures;\n polygons?: BinaryPolygonFeatures;\n};\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"category-gis.js","names":[],"sources":["../../../src/types/category-gis.ts"],"sourcesContent":["// GIS\nimport type {TypedArray} from './types';\nimport type {Feature, Geometry, Point, LineString, Polygon} from 'geojson';\n\n// GEOJSON FORMAT GEOMETRY\n\n// eslint-disable-next-line import/no-unresolved\nexport type {\n GeoJSON,\n Feature,\n FeatureCollection,\n Geometry,\n Position,\n GeoJsonProperties\n} from 'geojson';\n// eslint-disable-next-line import/no-unresolved\nexport type {\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n Polygon,\n MultiPolygon,\n GeometryCollection\n} from 'geojson';\n\n// Aggregate information for converting GeoJSON into other formats\nexport type GeojsonGeometryInfo = {\n coordLength: number;\n pointPositionsCount: number;\n pointFeaturesCount: number;\n linePositionsCount: number;\n linePathsCount: number;\n lineFeaturesCount: number;\n polygonPositionsCount: number;\n polygonObjectsCount: number;\n polygonRingsCount: number;\n polygonFeaturesCount: number;\n};\n\n// FLAT GEOJSON FORMAT GEOMETRY\nexport type FlatGeometryType = 'Point' | 'LineString' | 'Polygon';\ntype RemoveCoordinatesField<Type> = {\n [Property in keyof Type as Exclude<Property, 'coordinates'>]: Type[Property];\n};\n\n/**\n * Generic flat geometry data storage type\n */\nexport type FlatIndexedGeometry = {\n data: number[];\n indices: number[];\n};\n\n/**\n * GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices`\n */\nexport type FlatPoint = RemoveCoordinatesField<Point> & FlatIndexedGeometry;\n\n/**\n * GeoJSON (Multi)LineString geometry with coordinate data flattened into `data` array and indexed by `indices`\n */\nexport type FlatLineString = RemoveCoordinatesField<LineString> & FlatIndexedGeometry;\n\n/**\n * GeoJSON (Multi)Polygon geometry with coordinate data flattened into `data` array and indexed by 2D `indices`\n */\nexport type FlatPolygon = RemoveCoordinatesField<Polygon> & {\n data: number[];\n indices: number[][];\n areas: number[][];\n};\n\nexport type FlatGeometry = FlatPoint | FlatLineString | FlatPolygon;\n\ntype FlattenGeometry<Type> = {\n [Property in keyof Type]: Type[Property] extends Geometry ? FlatGeometry : Type[Property];\n};\n\n/**\n * GeoJSON Feature with Geometry replaced by FlatGeometry\n */\nexport type FlatFeature = FlattenGeometry<Feature>;\n\n// BINARY FORMAT GEOMETRY\n\nexport type BinaryAttribute = {value: TypedArray; size: number};\nexport type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';\n\ntype NumericProps = {[key: string]: BinaryAttribute};\ntype Properties = object[];\n\n/**\n * Represent a single Geometry, similar to a GeoJSON Geometry\n */\nexport type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;\n\nexport type BinaryPointGeometry = {\n type: 'Point';\n positions: BinaryAttribute;\n};\n\nexport type BinaryLineGeometry = {\n type: 'LineString';\n positions: BinaryAttribute;\n pathIndices: BinaryAttribute;\n};\n\nexport type BinaryPolygonGeometry = {\n type: 'Polygon';\n positions: BinaryAttribute;\n polygonIndices: BinaryAttribute;\n primitivePolygonIndices: BinaryAttribute;\n triangles?: BinaryAttribute;\n};\n\nexport type BinaryProperties = {\n featureIds: BinaryAttribute;\n globalFeatureIds: BinaryAttribute;\n numericProps: NumericProps;\n properties: Properties;\n fields?: Properties;\n};\n\nexport type BinaryPointFeatures = BinaryPointGeometry & BinaryProperties;\nexport type BinaryLineFeatures = BinaryLineGeometry & BinaryProperties;\nexport type BinaryPolygonFeatures = BinaryPolygonGeometry & BinaryProperties;\n\n/**\n * Represent a collection of Features, similar to a GeoJSON FeatureCollection\n */\nexport type BinaryFeatures = {\n points?: BinaryPointFeatures;\n lines?: BinaryLineFeatures;\n polygons?: BinaryPolygonFeatures;\n};\n"],"mappings":""}
1
+ {"version":3,"file":"category-gis.js","names":[],"sources":["../../../src/types/category-gis.ts"],"sourcesContent":["// GIS\n\n// NORMAL GEOJSON FORMAT GEOMETRY\nexport type {\n GeoJSON,\n Feature,\n FeatureCollection,\n Geometry,\n Position,\n GeoJsonProperties\n} from 'geojson';\n\nexport type {\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n Polygon,\n MultiPolygon,\n GeometryCollection\n} from 'geojson';\n\n// FLAT GEOJSON FORMAT GEOMETRY\nexport type {\n FlatGeometryType,\n FlatIndexedGeometry,\n FlatPoint,\n FlatLineString,\n FlatPolygon,\n FlatGeometry,\n FlatFeature\n} from './flat-geometries';\n\n// BINARY FORMAT GEOMETRY\nexport type {\n BinaryAttribute,\n BinaryGeometryType,\n BinaryGeometry,\n BinaryPointGeometry,\n BinaryLineGeometry,\n BinaryPolygonGeometry,\n BinaryProperties,\n BinaryFeatures,\n BinaryPointFeatures,\n BinaryLineFeatures,\n BinaryPolygonFeatures\n} from './binary-geometries';\n\n/** Aggregate information for converting GeoJSON into other formats */\nexport type GeojsonGeometryInfo = {\n coordLength: number;\n pointPositionsCount: number;\n pointFeaturesCount: number;\n linePositionsCount: number;\n linePathsCount: number;\n lineFeaturesCount: number;\n polygonPositionsCount: number;\n polygonObjectsCount: number;\n polygonRingsCount: number;\n polygonFeaturesCount: number;\n};\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=flat-geometries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flat-geometries.js","names":[],"sources":["../../../src/types/flat-geometries.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// FLAT GEOJSON FORMAT GEOMETRY\nimport type {Feature, Geometry, Point, LineString, Polygon} from 'geojson';\n\n/** Flat geometry type */\nexport type FlatGeometryType = 'Point' | 'LineString' | 'Polygon';\n\ntype RemoveCoordinatesField<Type> = {\n [Property in keyof Type as Exclude<Property, 'coordinates'>]: Type[Property];\n};\n\n/** Generic flat geometry data storage type */\nexport type FlatIndexedGeometry = {\n data: number[];\n indices: number[];\n};\n\n/** GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices` */\nexport type FlatPoint = RemoveCoordinatesField<Point> & FlatIndexedGeometry;\n\n/** GeoJSON (Multi)LineString geometry with coordinate data flattened into `data` array and indexed by `indices` */\nexport type FlatLineString = RemoveCoordinatesField<LineString> & FlatIndexedGeometry;\n\n/** GeoJSON (Multi)Polygon geometry with coordinate data flattened into `data` array and indexed by 2D `indices` */\nexport type FlatPolygon = RemoveCoordinatesField<Polygon> & {\n data: number[];\n indices: number[][];\n areas: number[][];\n};\n\n/** GeoJSON geometry with coordinate data flattened into `data` array and indexed by 2D `indices` */\nexport type FlatGeometry = FlatPoint | FlatLineString | FlatPolygon;\n\ntype FlattenGeometry<Type> = {\n [Property in keyof Type]: Type[Property] extends Geometry ? FlatGeometry : Type[Property];\n};\n\n/** GeoJSON Feature with Geometry replaced by FlatGeometry */\nexport type FlatFeature = FlattenGeometry<Feature>;\n"],"mappings":""}
@@ -0,0 +1,54 @@
1
+ import type { TypedArray } from './types';
2
+ export type BinaryAttribute = {
3
+ value: TypedArray;
4
+ size: number;
5
+ };
6
+ export type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';
7
+ type NumericProps = {
8
+ [key: string]: BinaryAttribute;
9
+ };
10
+ type Properties = object[];
11
+ /**
12
+ * Represent a single Geometry, similar to a GeoJSON Geometry
13
+ */
14
+ export type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;
15
+ /** Binary point geometry: an array of positions */
16
+ export type BinaryPointGeometry = {
17
+ type: 'Point';
18
+ positions: BinaryAttribute;
19
+ };
20
+ /** Binary line geometry, array of positions and indices to the start of each line */
21
+ export type BinaryLineGeometry = {
22
+ type: 'LineString';
23
+ positions: BinaryAttribute;
24
+ pathIndices: BinaryAttribute;
25
+ };
26
+ /** Binary polygon geometry, an array of positions to each primitite polygon and polygon */
27
+ export type BinaryPolygonGeometry = {
28
+ type: 'Polygon';
29
+ positions: BinaryAttribute;
30
+ polygonIndices: BinaryAttribute;
31
+ primitivePolygonIndices: BinaryAttribute;
32
+ triangles?: BinaryAttribute;
33
+ };
34
+ /** Common properties for binary geometries */
35
+ export type BinaryProperties = {
36
+ featureIds: BinaryAttribute;
37
+ globalFeatureIds: BinaryAttribute;
38
+ numericProps: NumericProps;
39
+ properties: Properties;
40
+ fields?: Properties;
41
+ };
42
+ export type BinaryPointFeatures = BinaryPointGeometry & BinaryProperties;
43
+ export type BinaryLineFeatures = BinaryLineGeometry & BinaryProperties;
44
+ export type BinaryPolygonFeatures = BinaryPolygonGeometry & BinaryProperties;
45
+ /**
46
+ * Represent a collection of Features, similar to a GeoJSON FeatureCollection
47
+ */
48
+ export type BinaryFeatures = {
49
+ points?: BinaryPointFeatures;
50
+ lines?: BinaryLineFeatures;
51
+ polygons?: BinaryPolygonFeatures;
52
+ };
53
+ export {};
54
+ //# sourceMappingURL=binary-geometries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-geometries.d.ts","sourceRoot":"","sources":["../../src/types/binary-geometries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAIxC,MAAM,MAAM,eAAe,GAAG;IAAC,KAAK,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC;AAEpE,KAAK,YAAY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,CAAC,EAAE,qBAAqB,CAAC;CAClC,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,8 @@
1
- import type { TypedArray } from './types';
2
- import type { Feature, Geometry, Point, LineString, Polygon } from 'geojson';
3
1
  export type { GeoJSON, Feature, FeatureCollection, Geometry, Position, GeoJsonProperties } from 'geojson';
4
2
  export type { Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection } from 'geojson';
3
+ export type { FlatGeometryType, FlatIndexedGeometry, FlatPoint, FlatLineString, FlatPolygon, FlatGeometry, FlatFeature } from './flat-geometries';
4
+ export type { BinaryAttribute, BinaryGeometryType, BinaryGeometry, BinaryPointGeometry, BinaryLineGeometry, BinaryPolygonGeometry, BinaryProperties, BinaryFeatures, BinaryPointFeatures, BinaryLineFeatures, BinaryPolygonFeatures } from './binary-geometries';
5
+ /** Aggregate information for converting GeoJSON into other formats */
5
6
  export type GeojsonGeometryInfo = {
6
7
  coordLength: number;
7
8
  pointPositionsCount: number;
@@ -14,86 +15,4 @@ export type GeojsonGeometryInfo = {
14
15
  polygonRingsCount: number;
15
16
  polygonFeaturesCount: number;
16
17
  };
17
- export type FlatGeometryType = 'Point' | 'LineString' | 'Polygon';
18
- type RemoveCoordinatesField<Type> = {
19
- [Property in keyof Type as Exclude<Property, 'coordinates'>]: Type[Property];
20
- };
21
- /**
22
- * Generic flat geometry data storage type
23
- */
24
- export type FlatIndexedGeometry = {
25
- data: number[];
26
- indices: number[];
27
- };
28
- /**
29
- * GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices`
30
- */
31
- export type FlatPoint = RemoveCoordinatesField<Point> & FlatIndexedGeometry;
32
- /**
33
- * GeoJSON (Multi)LineString geometry with coordinate data flattened into `data` array and indexed by `indices`
34
- */
35
- export type FlatLineString = RemoveCoordinatesField<LineString> & FlatIndexedGeometry;
36
- /**
37
- * GeoJSON (Multi)Polygon geometry with coordinate data flattened into `data` array and indexed by 2D `indices`
38
- */
39
- export type FlatPolygon = RemoveCoordinatesField<Polygon> & {
40
- data: number[];
41
- indices: number[][];
42
- areas: number[][];
43
- };
44
- export type FlatGeometry = FlatPoint | FlatLineString | FlatPolygon;
45
- type FlattenGeometry<Type> = {
46
- [Property in keyof Type]: Type[Property] extends Geometry ? FlatGeometry : Type[Property];
47
- };
48
- /**
49
- * GeoJSON Feature with Geometry replaced by FlatGeometry
50
- */
51
- export type FlatFeature = FlattenGeometry<Feature>;
52
- export type BinaryAttribute = {
53
- value: TypedArray;
54
- size: number;
55
- };
56
- export type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';
57
- type NumericProps = {
58
- [key: string]: BinaryAttribute;
59
- };
60
- type Properties = object[];
61
- /**
62
- * Represent a single Geometry, similar to a GeoJSON Geometry
63
- */
64
- export type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;
65
- export type BinaryPointGeometry = {
66
- type: 'Point';
67
- positions: BinaryAttribute;
68
- };
69
- export type BinaryLineGeometry = {
70
- type: 'LineString';
71
- positions: BinaryAttribute;
72
- pathIndices: BinaryAttribute;
73
- };
74
- export type BinaryPolygonGeometry = {
75
- type: 'Polygon';
76
- positions: BinaryAttribute;
77
- polygonIndices: BinaryAttribute;
78
- primitivePolygonIndices: BinaryAttribute;
79
- triangles?: BinaryAttribute;
80
- };
81
- export type BinaryProperties = {
82
- featureIds: BinaryAttribute;
83
- globalFeatureIds: BinaryAttribute;
84
- numericProps: NumericProps;
85
- properties: Properties;
86
- fields?: Properties;
87
- };
88
- export type BinaryPointFeatures = BinaryPointGeometry & BinaryProperties;
89
- export type BinaryLineFeatures = BinaryLineGeometry & BinaryProperties;
90
- export type BinaryPolygonFeatures = BinaryPolygonGeometry & BinaryProperties;
91
- /**
92
- * Represent a collection of Features, similar to a GeoJSON FeatureCollection
93
- */
94
- export type BinaryFeatures = {
95
- points?: BinaryPointFeatures;
96
- lines?: BinaryLineFeatures;
97
- polygons?: BinaryPolygonFeatures;
98
- };
99
18
  //# sourceMappingURL=category-gis.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"category-gis.d.ts","sourceRoot":"","sources":["../../src/types/category-gis.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,SAAS,CAAC;AAK3E,YAAY,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,KAAK,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,OAAO,EACP,YAAY,EACZ,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAGjB,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAGF,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC;AAClE,KAAK,sBAAsB,CAAC,IAAI,IAAI;KACjC,QAAQ,IAAI,MAAM,IAAI,IAAI,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;CAC7E,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,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BAAgB,EAChB,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAE7B,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC"}
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
+ // GIS
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,30 @@
1
+ import type { Feature, Geometry, Point, LineString, Polygon } from 'geojson';
2
+ /** Flat geometry type */
3
+ export type FlatGeometryType = 'Point' | 'LineString' | 'Polygon';
4
+ type RemoveCoordinatesField<Type> = {
5
+ [Property in keyof Type as Exclude<Property, 'coordinates'>]: Type[Property];
6
+ };
7
+ /** Generic flat geometry data storage type */
8
+ export type FlatIndexedGeometry = {
9
+ data: number[];
10
+ indices: number[];
11
+ };
12
+ /** GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices` */
13
+ export type FlatPoint = RemoveCoordinatesField<Point> & FlatIndexedGeometry;
14
+ /** GeoJSON (Multi)LineString geometry with coordinate data flattened into `data` array and indexed by `indices` */
15
+ export type FlatLineString = RemoveCoordinatesField<LineString> & FlatIndexedGeometry;
16
+ /** GeoJSON (Multi)Polygon geometry with coordinate data flattened into `data` array and indexed by 2D `indices` */
17
+ export type FlatPolygon = RemoveCoordinatesField<Polygon> & {
18
+ data: number[];
19
+ indices: number[][];
20
+ areas: number[][];
21
+ };
22
+ /** GeoJSON geometry with coordinate data flattened into `data` array and indexed by 2D `indices` */
23
+ export type FlatGeometry = FlatPoint | FlatLineString | FlatPolygon;
24
+ type FlattenGeometry<Type> = {
25
+ [Property in keyof Type]: Type[Property] extends Geometry ? FlatGeometry : Type[Property];
26
+ };
27
+ /** GeoJSON Feature with Geometry replaced by FlatGeometry */
28
+ export type FlatFeature = FlattenGeometry<Feature>;
29
+ export {};
30
+ //# sourceMappingURL=flat-geometries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flat-geometries.d.ts","sourceRoot":"","sources":["../../src/types/flat-geometries.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,SAAS,CAAC;AAE3E,yBAAyB;AACzB,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC;AAElE,KAAK,sBAAsB,CAAC,IAAI,IAAI;KACjC,QAAQ,IAAI,MAAM,IAAI,IAAI,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;CAC7E,CAAC;AAEF,8CAA8C;AAC9C,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,8GAA8G;AAC9G,MAAM,MAAM,SAAS,GAAG,sBAAsB,CAAC,KAAK,CAAC,GAAG,mBAAmB,CAAC;AAE5E,mHAAmH;AACnH,MAAM,MAAM,cAAc,GAAG,sBAAsB,CAAC,UAAU,CAAC,GAAG,mBAAmB,CAAC;AAEtF,mHAAmH;AACnH,MAAM,MAAM,WAAW,GAAG,sBAAsB,CAAC,OAAO,CAAC,GAAG;IAC1D,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC;CACnB,CAAC;AAEF,oGAAoG;AACpG,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,cAAc,GAAG,WAAW,CAAC;AAEpE,KAAK,eAAe,CAAC,IAAI,IAAI;KAC1B,QAAQ,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;CAC1F,CAAC;AAEF,6DAA6D;AAC7D,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // loaders.gl, MIT license
3
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/schema",
3
- "version": "4.0.0-alpha.20",
3
+ "version": "4.0.0-alpha.22",
4
4
  "description": "Table format APIs for JSON, CSV, etc...",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -34,5 +34,5 @@
34
34
  "dependencies": {
35
35
  "@types/geojson": "^7946.0.7"
36
36
  },
37
- "gitHead": "ac122e83102657c38207d59c631a5ce4e7aa46bd"
37
+ "gitHead": "0da838c506d1275383f2fd3d244d9c72b25397d2"
38
38
  }
@@ -0,0 +1,59 @@
1
+ // GIS
2
+ import type {TypedArray} from './types';
3
+
4
+ // BINARY FORMAT GEOMETRY
5
+
6
+ export type BinaryAttribute = {value: TypedArray; size: number};
7
+ export type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';
8
+
9
+ type NumericProps = {[key: string]: BinaryAttribute};
10
+ type Properties = object[];
11
+
12
+ /**
13
+ * Represent a single Geometry, similar to a GeoJSON Geometry
14
+ */
15
+ export type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;
16
+
17
+ /** Binary point geometry: an array of positions */
18
+ export type BinaryPointGeometry = {
19
+ type: 'Point';
20
+ positions: BinaryAttribute;
21
+ };
22
+
23
+ /** Binary line geometry, array of positions and indices to the start of each line */
24
+ export type BinaryLineGeometry = {
25
+ type: 'LineString';
26
+ positions: BinaryAttribute;
27
+ pathIndices: BinaryAttribute;
28
+ };
29
+
30
+ /** Binary polygon geometry, an array of positions to each primitite polygon and polygon */
31
+ export type BinaryPolygonGeometry = {
32
+ type: 'Polygon';
33
+ positions: BinaryAttribute;
34
+ polygonIndices: BinaryAttribute;
35
+ primitivePolygonIndices: BinaryAttribute;
36
+ triangles?: BinaryAttribute;
37
+ };
38
+
39
+ /** Common properties for binary geometries */
40
+ export type BinaryProperties = {
41
+ featureIds: BinaryAttribute;
42
+ globalFeatureIds: BinaryAttribute;
43
+ numericProps: NumericProps;
44
+ properties: Properties;
45
+ fields?: Properties;
46
+ };
47
+
48
+ export type BinaryPointFeatures = BinaryPointGeometry & BinaryProperties;
49
+ export type BinaryLineFeatures = BinaryLineGeometry & BinaryProperties;
50
+ export type BinaryPolygonFeatures = BinaryPolygonGeometry & BinaryProperties;
51
+
52
+ /**
53
+ * Represent a collection of Features, similar to a GeoJSON FeatureCollection
54
+ */
55
+ export type BinaryFeatures = {
56
+ points?: BinaryPointFeatures;
57
+ lines?: BinaryLineFeatures;
58
+ polygons?: BinaryPolygonFeatures;
59
+ };
@@ -1,10 +1,6 @@
1
1
  // GIS
2
- import type {TypedArray} from './types';
3
- import type {Feature, Geometry, Point, LineString, Polygon} from 'geojson';
4
2
 
5
- // GEOJSON FORMAT GEOMETRY
6
-
7
- // eslint-disable-next-line import/no-unresolved
3
+ // NORMAL GEOJSON FORMAT GEOMETRY
8
4
  export type {
9
5
  GeoJSON,
10
6
  Feature,
@@ -13,7 +9,7 @@ export type {
13
9
  Position,
14
10
  GeoJsonProperties
15
11
  } from 'geojson';
16
- // eslint-disable-next-line import/no-unresolved
12
+
17
13
  export type {
18
14
  Point,
19
15
  MultiPoint,
@@ -24,7 +20,33 @@ export type {
24
20
  GeometryCollection
25
21
  } from 'geojson';
26
22
 
27
- // Aggregate information for converting GeoJSON into other formats
23
+ // FLAT GEOJSON FORMAT GEOMETRY
24
+ export type {
25
+ FlatGeometryType,
26
+ FlatIndexedGeometry,
27
+ FlatPoint,
28
+ FlatLineString,
29
+ FlatPolygon,
30
+ FlatGeometry,
31
+ FlatFeature
32
+ } from './flat-geometries';
33
+
34
+ // BINARY FORMAT GEOMETRY
35
+ export type {
36
+ BinaryAttribute,
37
+ BinaryGeometryType,
38
+ BinaryGeometry,
39
+ BinaryPointGeometry,
40
+ BinaryLineGeometry,
41
+ BinaryPolygonGeometry,
42
+ BinaryProperties,
43
+ BinaryFeatures,
44
+ BinaryPointFeatures,
45
+ BinaryLineFeatures,
46
+ BinaryPolygonFeatures
47
+ } from './binary-geometries';
48
+
49
+ /** Aggregate information for converting GeoJSON into other formats */
28
50
  export type GeojsonGeometryInfo = {
29
51
  coordLength: number;
30
52
  pointPositionsCount: number;
@@ -37,100 +59,3 @@ export type GeojsonGeometryInfo = {
37
59
  polygonRingsCount: number;
38
60
  polygonFeaturesCount: number;
39
61
  };
40
-
41
- // FLAT GEOJSON FORMAT GEOMETRY
42
- export type FlatGeometryType = 'Point' | 'LineString' | 'Polygon';
43
- type RemoveCoordinatesField<Type> = {
44
- [Property in keyof Type as Exclude<Property, 'coordinates'>]: Type[Property];
45
- };
46
-
47
- /**
48
- * Generic flat geometry data storage type
49
- */
50
- export type FlatIndexedGeometry = {
51
- data: number[];
52
- indices: number[];
53
- };
54
-
55
- /**
56
- * GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices`
57
- */
58
- export type FlatPoint = RemoveCoordinatesField<Point> & FlatIndexedGeometry;
59
-
60
- /**
61
- * GeoJSON (Multi)LineString geometry with coordinate data flattened into `data` array and indexed by `indices`
62
- */
63
- export type FlatLineString = RemoveCoordinatesField<LineString> & FlatIndexedGeometry;
64
-
65
- /**
66
- * GeoJSON (Multi)Polygon geometry with coordinate data flattened into `data` array and indexed by 2D `indices`
67
- */
68
- export type FlatPolygon = RemoveCoordinatesField<Polygon> & {
69
- data: number[];
70
- indices: number[][];
71
- areas: number[][];
72
- };
73
-
74
- export type FlatGeometry = FlatPoint | FlatLineString | FlatPolygon;
75
-
76
- type FlattenGeometry<Type> = {
77
- [Property in keyof Type]: Type[Property] extends Geometry ? FlatGeometry : Type[Property];
78
- };
79
-
80
- /**
81
- * GeoJSON Feature with Geometry replaced by FlatGeometry
82
- */
83
- export type FlatFeature = FlattenGeometry<Feature>;
84
-
85
- // BINARY FORMAT GEOMETRY
86
-
87
- export type BinaryAttribute = {value: TypedArray; size: number};
88
- export type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';
89
-
90
- type NumericProps = {[key: string]: BinaryAttribute};
91
- type Properties = object[];
92
-
93
- /**
94
- * Represent a single Geometry, similar to a GeoJSON Geometry
95
- */
96
- export type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;
97
-
98
- export type BinaryPointGeometry = {
99
- type: 'Point';
100
- positions: BinaryAttribute;
101
- };
102
-
103
- export type BinaryLineGeometry = {
104
- type: 'LineString';
105
- positions: BinaryAttribute;
106
- pathIndices: BinaryAttribute;
107
- };
108
-
109
- export type BinaryPolygonGeometry = {
110
- type: 'Polygon';
111
- positions: BinaryAttribute;
112
- polygonIndices: BinaryAttribute;
113
- primitivePolygonIndices: BinaryAttribute;
114
- triangles?: BinaryAttribute;
115
- };
116
-
117
- export type BinaryProperties = {
118
- featureIds: BinaryAttribute;
119
- globalFeatureIds: BinaryAttribute;
120
- numericProps: NumericProps;
121
- properties: Properties;
122
- fields?: Properties;
123
- };
124
-
125
- export type BinaryPointFeatures = BinaryPointGeometry & BinaryProperties;
126
- export type BinaryLineFeatures = BinaryLineGeometry & BinaryProperties;
127
- export type BinaryPolygonFeatures = BinaryPolygonGeometry & BinaryProperties;
128
-
129
- /**
130
- * Represent a collection of Features, similar to a GeoJSON FeatureCollection
131
- */
132
- export type BinaryFeatures = {
133
- points?: BinaryPointFeatures;
134
- lines?: BinaryLineFeatures;
135
- polygons?: BinaryPolygonFeatures;
136
- };
@@ -0,0 +1,40 @@
1
+ // loaders.gl, MIT license
2
+
3
+ // FLAT GEOJSON FORMAT GEOMETRY
4
+ import type {Feature, Geometry, Point, LineString, Polygon} from 'geojson';
5
+
6
+ /** Flat geometry type */
7
+ export type FlatGeometryType = 'Point' | 'LineString' | 'Polygon';
8
+
9
+ type RemoveCoordinatesField<Type> = {
10
+ [Property in keyof Type as Exclude<Property, 'coordinates'>]: Type[Property];
11
+ };
12
+
13
+ /** Generic flat geometry data storage type */
14
+ export type FlatIndexedGeometry = {
15
+ data: number[];
16
+ indices: number[];
17
+ };
18
+
19
+ /** GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices` */
20
+ export type FlatPoint = RemoveCoordinatesField<Point> & FlatIndexedGeometry;
21
+
22
+ /** GeoJSON (Multi)LineString geometry with coordinate data flattened into `data` array and indexed by `indices` */
23
+ export type FlatLineString = RemoveCoordinatesField<LineString> & FlatIndexedGeometry;
24
+
25
+ /** GeoJSON (Multi)Polygon geometry with coordinate data flattened into `data` array and indexed by 2D `indices` */
26
+ export type FlatPolygon = RemoveCoordinatesField<Polygon> & {
27
+ data: number[];
28
+ indices: number[][];
29
+ areas: number[][];
30
+ };
31
+
32
+ /** GeoJSON geometry with coordinate data flattened into `data` array and indexed by 2D `indices` */
33
+ export type FlatGeometry = FlatPoint | FlatLineString | FlatPolygon;
34
+
35
+ type FlattenGeometry<Type> = {
36
+ [Property in keyof Type]: Type[Property] extends Geometry ? FlatGeometry : Type[Property];
37
+ };
38
+
39
+ /** GeoJSON Feature with Geometry replaced by FlatGeometry */
40
+ export type FlatFeature = FlattenGeometry<Feature>;