@loaders.gl/schema 4.0.0-alpha.21 → 4.0.0-alpha.23
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/es5/types/binary-geometries.js +2 -0
- package/dist/es5/types/binary-geometries.js.map +1 -0
- package/dist/es5/types/category-gis.js.map +1 -1
- package/dist/es5/types/category-table.js.map +1 -1
- package/dist/es5/types/flat-geometries.js +2 -0
- package/dist/es5/types/flat-geometries.js.map +1 -0
- package/dist/esm/types/binary-geometries.js +2 -0
- package/dist/esm/types/binary-geometries.js.map +1 -0
- package/dist/esm/types/category-gis.js.map +1 -1
- package/dist/esm/types/category-table.js.map +1 -1
- package/dist/esm/types/flat-geometries.js +2 -0
- package/dist/esm/types/flat-geometries.js.map +1 -0
- package/dist/types/binary-geometries.d.ts +54 -0
- package/dist/types/binary-geometries.d.ts.map +1 -0
- package/dist/types/binary-geometries.js +2 -0
- package/dist/types/category-gis.d.ts +3 -84
- package/dist/types/category-gis.d.ts.map +1 -1
- package/dist/types/category-gis.js +1 -0
- package/dist/types/category-table.d.ts +21 -11
- package/dist/types/category-table.d.ts.map +1 -1
- package/dist/types/flat-geometries.d.ts +30 -0
- package/dist/types/flat-geometries.d.ts.map +1 -0
- package/dist/types/flat-geometries.js +3 -0
- package/package.json +2 -2
- package/src/types/binary-geometries.ts +59 -0
- package/src/types/category-gis.ts +29 -104
- package/src/types/category-table.ts +26 -11
- package/src/types/flat-geometries.ts +40 -0
|
@@ -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\
|
|
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":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-table.js","names":[],"sources":["../../../src/types/category-table.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Table as ApacheArrowTable, RecordBatch} from 'apache-arrow';\nimport type {Batch, Schema} from './schema';\nimport type {Feature} from './category-gis';\n\n// Idea was to just import types, but it seems\n// Seems this triggers more bundling and build issues than it is worth...\n// import type {Table as ApacheArrowTable, RecordBatch} from 'apache-arrow';\n// type ApacheArrowTable = any;\n// type RecordBatch = any;\n\n/** A general table */\nexport type Table =\n | RowTable\n | ArrayRowTable\n | ObjectRowTable\n | GeoJSONRowTable\n | ColumnarTable\n | ArrowTable;\n\n/** A table organized as an array of rows */\nexport type RowTable = ArrayRowTable | ObjectRowTable | GeoJSONRowTable;\n\n/** A table organized as an array of rows, each row is an array of values */\nexport type ArrayRowTable = {\n shape: 'array-row-table';\n schema?: Schema;\n data: any[][];\n};\n\n/** A table organized as an array of rows, each row is an object mapping columns to values */\nexport type ObjectRowTable = {\n shape: 'object-row-table';\n schema?: Schema;\n data: {[columnName: string]: any}[];\n};\n\n/** A table organized as an array of rows, each row is a GeoJSON Feature */\nexport type GeoJSONRowTable = {\n shape: 'geojson-row-table';\n schema?: Schema;\n data: Feature[];\n};\n\n/** A table organized as a map of columns, each column is an array of value */\nexport type ColumnarTable = {\n shape: 'columnar-table';\n schema?: Schema;\n data: {[columnName: string]: ArrayLike<unknown>};\n};\n\n/** A table organized as an Apache Arrow table */\nexport type ArrowTable = {\n shape: 'arrow-table';\n schema?: Schema;\n data: ApacheArrowTable;\n};\n\n/** A collection of tables */\nexport type Tables<TableType = Table> = {\n shape: 'tables';\n tables: {name: string; table: TableType}[];\n};\n\n// Batches\n\n/** Batch for a general table */\nexport type TableBatch
|
|
1
|
+
{"version":3,"file":"category-table.js","names":[],"sources":["../../../src/types/category-table.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Table as ApacheArrowTable, RecordBatch} from 'apache-arrow';\nimport type {Batch, Schema} from './schema';\nimport type {Feature} from './category-gis';\n\n// Idea was to just import types, but it seems\n// Seems this triggers more bundling and build issues than it is worth...\n// import type {Table as ApacheArrowTable, RecordBatch} from 'apache-arrow';\n// type ApacheArrowTable = any;\n// type RecordBatch = any;\n\n/** A general table */\nexport type Table =\n | RowTable\n | ArrayRowTable\n | ObjectRowTable\n | GeoJSONRowTable\n | ColumnarTable\n | ArrowTable;\n\n/** A table organized as an array of rows */\nexport type RowTable = ArrayRowTable | ObjectRowTable | GeoJSONRowTable;\n\n/** A table organized as an array of rows, each row is an array of values */\nexport type ArrayRowTable = {\n shape: 'array-row-table';\n schema?: Schema;\n data: any[][];\n};\n\n/** A table organized as an array of rows, each row is an object mapping columns to values */\nexport type ObjectRowTable = {\n shape: 'object-row-table';\n schema?: Schema;\n data: {[columnName: string]: any}[];\n};\n\n/** A table organized as an array of rows, each row is a GeoJSON Feature */\nexport type GeoJSONRowTable = {\n shape: 'geojson-row-table';\n schema?: Schema;\n data: Feature[];\n};\n\n/** A table organized as a map of columns, each column is an array of value */\nexport type ColumnarTable = {\n shape: 'columnar-table';\n schema?: Schema;\n data: {[columnName: string]: ArrayLike<unknown>};\n};\n\n/** A table organized as an Apache Arrow table */\nexport type ArrowTable = {\n shape: 'arrow-table';\n schema?: Schema;\n data: ApacheArrowTable;\n};\n\n/** A collection of tables */\nexport type Tables<TableType = Table> = {\n shape: 'tables';\n tables: {name: string; table: TableType}[];\n};\n\n// Batches\n\n/** Batch for a general table */\nexport type TableBatch =\n | ArrayRowTableBatch\n | ObjectRowTableBatch\n | GeoJSONRowTableBatch\n | ColumnarTableBatch\n | ArrowTableBatch;\n\n/** Batch for a table organized as an array of rows, each row is an array of values */\nexport type ArrayRowTableBatch = Batch & {\n shape: 'array-row-table';\n schema?: Schema;\n schemaType?: 'explicit' | 'deduced';\n data: any[][];\n length: number;\n};\n\n/** Batch for a table organized as an array of rows, each row is an object mapping columns to values */\nexport type ObjectRowTableBatch = Batch & {\n shape: 'object-row-table';\n schema?: Schema;\n schemaType?: 'explicit' | 'deduced';\n data: {[columnName: string]: any}[];\n length: number;\n};\n\n/** Batch for a table organized as an array of rows, each row is an array of values */\nexport type GeoJSONRowTableBatch = Batch & {\n shape: 'geojson-row-table';\n schema?: Schema;\n schemaType?: 'explicit' | 'deduced';\n data: Feature[];\n length: number;\n};\n\n/** Batch for a table organized as a map of columns, each column is an array of value */\nexport type ColumnarTableBatch = Batch & {\n shape: 'columnar-table';\n schemaType?: 'explicit' | 'deduced';\n schema?: Schema;\n data: {[columnName: string]: ArrayLike<unknown>};\n length: number;\n};\n\n/** Batch for a table organized as an Apache Arrow table */\nexport type ArrowTableBatch = Batch & {\n shape: 'arrow-table';\n schemaType?: 'explicit' | 'deduced';\n schema?: Schema;\n data: RecordBatch;\n length: number;\n};\n"],"mappings":""}
|
|
@@ -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 @@
|
|
|
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\
|
|
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":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-table.js","names":[],"sources":["../../../src/types/category-table.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Table as ApacheArrowTable, RecordBatch} from 'apache-arrow';\nimport type {Batch, Schema} from './schema';\nimport type {Feature} from './category-gis';\n\n// Idea was to just import types, but it seems\n// Seems this triggers more bundling and build issues than it is worth...\n// import type {Table as ApacheArrowTable, RecordBatch} from 'apache-arrow';\n// type ApacheArrowTable = any;\n// type RecordBatch = any;\n\n/** A general table */\nexport type Table =\n | RowTable\n | ArrayRowTable\n | ObjectRowTable\n | GeoJSONRowTable\n | ColumnarTable\n | ArrowTable;\n\n/** A table organized as an array of rows */\nexport type RowTable = ArrayRowTable | ObjectRowTable | GeoJSONRowTable;\n\n/** A table organized as an array of rows, each row is an array of values */\nexport type ArrayRowTable = {\n shape: 'array-row-table';\n schema?: Schema;\n data: any[][];\n};\n\n/** A table organized as an array of rows, each row is an object mapping columns to values */\nexport type ObjectRowTable = {\n shape: 'object-row-table';\n schema?: Schema;\n data: {[columnName: string]: any}[];\n};\n\n/** A table organized as an array of rows, each row is a GeoJSON Feature */\nexport type GeoJSONRowTable = {\n shape: 'geojson-row-table';\n schema?: Schema;\n data: Feature[];\n};\n\n/** A table organized as a map of columns, each column is an array of value */\nexport type ColumnarTable = {\n shape: 'columnar-table';\n schema?: Schema;\n data: {[columnName: string]: ArrayLike<unknown>};\n};\n\n/** A table organized as an Apache Arrow table */\nexport type ArrowTable = {\n shape: 'arrow-table';\n schema?: Schema;\n data: ApacheArrowTable;\n};\n\n/** A collection of tables */\nexport type Tables<TableType = Table> = {\n shape: 'tables';\n tables: {name: string; table: TableType}[];\n};\n\n// Batches\n\n/** Batch for a general table */\nexport type TableBatch
|
|
1
|
+
{"version":3,"file":"category-table.js","names":[],"sources":["../../../src/types/category-table.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Table as ApacheArrowTable, RecordBatch} from 'apache-arrow';\nimport type {Batch, Schema} from './schema';\nimport type {Feature} from './category-gis';\n\n// Idea was to just import types, but it seems\n// Seems this triggers more bundling and build issues than it is worth...\n// import type {Table as ApacheArrowTable, RecordBatch} from 'apache-arrow';\n// type ApacheArrowTable = any;\n// type RecordBatch = any;\n\n/** A general table */\nexport type Table =\n | RowTable\n | ArrayRowTable\n | ObjectRowTable\n | GeoJSONRowTable\n | ColumnarTable\n | ArrowTable;\n\n/** A table organized as an array of rows */\nexport type RowTable = ArrayRowTable | ObjectRowTable | GeoJSONRowTable;\n\n/** A table organized as an array of rows, each row is an array of values */\nexport type ArrayRowTable = {\n shape: 'array-row-table';\n schema?: Schema;\n data: any[][];\n};\n\n/** A table organized as an array of rows, each row is an object mapping columns to values */\nexport type ObjectRowTable = {\n shape: 'object-row-table';\n schema?: Schema;\n data: {[columnName: string]: any}[];\n};\n\n/** A table organized as an array of rows, each row is a GeoJSON Feature */\nexport type GeoJSONRowTable = {\n shape: 'geojson-row-table';\n schema?: Schema;\n data: Feature[];\n};\n\n/** A table organized as a map of columns, each column is an array of value */\nexport type ColumnarTable = {\n shape: 'columnar-table';\n schema?: Schema;\n data: {[columnName: string]: ArrayLike<unknown>};\n};\n\n/** A table organized as an Apache Arrow table */\nexport type ArrowTable = {\n shape: 'arrow-table';\n schema?: Schema;\n data: ApacheArrowTable;\n};\n\n/** A collection of tables */\nexport type Tables<TableType = Table> = {\n shape: 'tables';\n tables: {name: string; table: TableType}[];\n};\n\n// Batches\n\n/** Batch for a general table */\nexport type TableBatch =\n | ArrayRowTableBatch\n | ObjectRowTableBatch\n | GeoJSONRowTableBatch\n | ColumnarTableBatch\n | ArrowTableBatch;\n\n/** Batch for a table organized as an array of rows, each row is an array of values */\nexport type ArrayRowTableBatch = Batch & {\n shape: 'array-row-table';\n schema?: Schema;\n schemaType?: 'explicit' | 'deduced';\n data: any[][];\n length: number;\n};\n\n/** Batch for a table organized as an array of rows, each row is an object mapping columns to values */\nexport type ObjectRowTableBatch = Batch & {\n shape: 'object-row-table';\n schema?: Schema;\n schemaType?: 'explicit' | 'deduced';\n data: {[columnName: string]: any}[];\n length: number;\n};\n\n/** Batch for a table organized as an array of rows, each row is an array of values */\nexport type GeoJSONRowTableBatch = Batch & {\n shape: 'geojson-row-table';\n schema?: Schema;\n schemaType?: 'explicit' | 'deduced';\n data: Feature[];\n length: number;\n};\n\n/** Batch for a table organized as a map of columns, each column is an array of value */\nexport type ColumnarTableBatch = Batch & {\n shape: 'columnar-table';\n schemaType?: 'explicit' | 'deduced';\n schema?: Schema;\n data: {[columnName: string]: ArrayLike<unknown>};\n length: number;\n};\n\n/** Batch for a table organized as an Apache Arrow table */\nexport type ArrowTableBatch = Batch & {\n shape: 'arrow-table';\n schemaType?: 'explicit' | 'deduced';\n schema?: Schema;\n data: RecordBatch;\n length: number;\n};\n"],"mappings":""}
|
|
@@ -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,EAA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gBAAgB,CAAC;AACvE,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,GAAG,gBAAgB,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC,CAAC"}
|
|
@@ -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":"
|
|
1
|
+
{"version":3,"file":"category-gis.d.ts","sourceRoot":"","sources":["../../src/types/category-gis.ts"],"names":[],"mappings":"AAGA,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,YAAY,EACV,gBAAgB,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"}
|
|
@@ -48,39 +48,49 @@ export type Tables<TableType = Table> = {
|
|
|
48
48
|
}[];
|
|
49
49
|
};
|
|
50
50
|
/** Batch for a general table */
|
|
51
|
-
export type TableBatch =
|
|
52
|
-
data: any;
|
|
53
|
-
length: number;
|
|
54
|
-
schema?: Schema;
|
|
55
|
-
schemaType?: 'explicit' | 'deduced';
|
|
56
|
-
};
|
|
51
|
+
export type TableBatch = ArrayRowTableBatch | ObjectRowTableBatch | GeoJSONRowTableBatch | ColumnarTableBatch | ArrowTableBatch;
|
|
57
52
|
/** Batch for a table organized as an array of rows, each row is an array of values */
|
|
58
|
-
export type ArrayRowTableBatch =
|
|
53
|
+
export type ArrayRowTableBatch = Batch & {
|
|
59
54
|
shape: 'array-row-table';
|
|
55
|
+
schema?: Schema;
|
|
56
|
+
schemaType?: 'explicit' | 'deduced';
|
|
60
57
|
data: any[][];
|
|
58
|
+
length: number;
|
|
61
59
|
};
|
|
62
60
|
/** Batch for a table organized as an array of rows, each row is an object mapping columns to values */
|
|
63
|
-
export type ObjectRowTableBatch =
|
|
61
|
+
export type ObjectRowTableBatch = Batch & {
|
|
64
62
|
shape: 'object-row-table';
|
|
63
|
+
schema?: Schema;
|
|
64
|
+
schemaType?: 'explicit' | 'deduced';
|
|
65
65
|
data: {
|
|
66
66
|
[columnName: string]: any;
|
|
67
67
|
}[];
|
|
68
|
+
length: number;
|
|
68
69
|
};
|
|
69
70
|
/** Batch for a table organized as an array of rows, each row is an array of values */
|
|
70
|
-
export type GeoJSONRowTableBatch =
|
|
71
|
+
export type GeoJSONRowTableBatch = Batch & {
|
|
71
72
|
shape: 'geojson-row-table';
|
|
73
|
+
schema?: Schema;
|
|
74
|
+
schemaType?: 'explicit' | 'deduced';
|
|
72
75
|
data: Feature[];
|
|
76
|
+
length: number;
|
|
73
77
|
};
|
|
74
78
|
/** Batch for a table organized as a map of columns, each column is an array of value */
|
|
75
|
-
export type ColumnarTableBatch =
|
|
79
|
+
export type ColumnarTableBatch = Batch & {
|
|
76
80
|
shape: 'columnar-table';
|
|
81
|
+
schemaType?: 'explicit' | 'deduced';
|
|
82
|
+
schema?: Schema;
|
|
77
83
|
data: {
|
|
78
84
|
[columnName: string]: ArrayLike<unknown>;
|
|
79
85
|
};
|
|
86
|
+
length: number;
|
|
80
87
|
};
|
|
81
88
|
/** Batch for a table organized as an Apache Arrow table */
|
|
82
|
-
export type ArrowTableBatch =
|
|
89
|
+
export type ArrowTableBatch = Batch & {
|
|
83
90
|
shape: 'arrow-table';
|
|
91
|
+
schemaType?: 'explicit' | 'deduced';
|
|
92
|
+
schema?: Schema;
|
|
84
93
|
data: RecordBatch;
|
|
94
|
+
length: number;
|
|
85
95
|
};
|
|
86
96
|
//# sourceMappingURL=category-table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-table.d.ts","sourceRoot":"","sources":["../../src/types/category-table.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,KAAK,IAAI,gBAAgB,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AACzE,OAAO,KAAK,EAAC,KAAK,EAAE,MAAM,EAAC,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAQ5C,sBAAsB;AACtB,MAAM,MAAM,KAAK,GACb,QAAQ,GACR,aAAa,GACb,cAAc,GACd,eAAe,GACf,aAAa,GACb,UAAU,CAAC;AAEf,4CAA4C;AAC5C,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,cAAc,GAAG,eAAe,CAAC;AAExE,4EAA4E;AAC5E,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,iBAAiB,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC;CACf,CAAC;AAEF,6FAA6F;AAC7F,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,EAAE,CAAC;CACrC,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,EAAE,CAAC;CACjB,CAAC;AAEF,8EAA8E;AAC9E,MAAM,MAAM,aAAa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C"}
|
|
@@ -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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AAe,CAAC,OAAO,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/schema",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.23",
|
|
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": "
|
|
37
|
+
"gitHead": "e212f2a0c0e342f7cb65ce84fa2ff39f64b7d94b"
|
|
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
|
-
|
|
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
|
-
//
|
|
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
|
-
};
|
|
@@ -66,39 +66,54 @@ export type Tables<TableType = Table> = {
|
|
|
66
66
|
// Batches
|
|
67
67
|
|
|
68
68
|
/** Batch for a general table */
|
|
69
|
-
export type TableBatch =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
export type TableBatch =
|
|
70
|
+
| ArrayRowTableBatch
|
|
71
|
+
| ObjectRowTableBatch
|
|
72
|
+
| GeoJSONRowTableBatch
|
|
73
|
+
| ColumnarTableBatch
|
|
74
|
+
| ArrowTableBatch;
|
|
75
75
|
|
|
76
76
|
/** Batch for a table organized as an array of rows, each row is an array of values */
|
|
77
|
-
export type ArrayRowTableBatch =
|
|
77
|
+
export type ArrayRowTableBatch = Batch & {
|
|
78
78
|
shape: 'array-row-table';
|
|
79
|
+
schema?: Schema;
|
|
80
|
+
schemaType?: 'explicit' | 'deduced';
|
|
79
81
|
data: any[][];
|
|
82
|
+
length: number;
|
|
80
83
|
};
|
|
81
84
|
|
|
82
85
|
/** Batch for a table organized as an array of rows, each row is an object mapping columns to values */
|
|
83
|
-
export type ObjectRowTableBatch =
|
|
86
|
+
export type ObjectRowTableBatch = Batch & {
|
|
84
87
|
shape: 'object-row-table';
|
|
88
|
+
schema?: Schema;
|
|
89
|
+
schemaType?: 'explicit' | 'deduced';
|
|
85
90
|
data: {[columnName: string]: any}[];
|
|
91
|
+
length: number;
|
|
86
92
|
};
|
|
87
93
|
|
|
88
94
|
/** Batch for a table organized as an array of rows, each row is an array of values */
|
|
89
|
-
export type GeoJSONRowTableBatch =
|
|
95
|
+
export type GeoJSONRowTableBatch = Batch & {
|
|
90
96
|
shape: 'geojson-row-table';
|
|
97
|
+
schema?: Schema;
|
|
98
|
+
schemaType?: 'explicit' | 'deduced';
|
|
91
99
|
data: Feature[];
|
|
100
|
+
length: number;
|
|
92
101
|
};
|
|
93
102
|
|
|
94
103
|
/** Batch for a table organized as a map of columns, each column is an array of value */
|
|
95
|
-
export type ColumnarTableBatch =
|
|
104
|
+
export type ColumnarTableBatch = Batch & {
|
|
96
105
|
shape: 'columnar-table';
|
|
106
|
+
schemaType?: 'explicit' | 'deduced';
|
|
107
|
+
schema?: Schema;
|
|
97
108
|
data: {[columnName: string]: ArrayLike<unknown>};
|
|
109
|
+
length: number;
|
|
98
110
|
};
|
|
99
111
|
|
|
100
112
|
/** Batch for a table organized as an Apache Arrow table */
|
|
101
|
-
export type ArrowTableBatch =
|
|
113
|
+
export type ArrowTableBatch = Batch & {
|
|
102
114
|
shape: 'arrow-table';
|
|
115
|
+
schemaType?: 'explicit' | 'deduced';
|
|
116
|
+
schema?: Schema;
|
|
103
117
|
data: RecordBatch;
|
|
118
|
+
length: number;
|
|
104
119
|
};
|
|
@@ -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>;
|