From 4e5d216afae8cd77c889c139bae59b04caed1ff2 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Fri, 15 Sep 2023 11:12:20 -0700 Subject: [PATCH 01/29] [Feat] Support WKB geometry column in CSV Signed-off-by: Xun Li --- src/layers/src/geojson-layer/geojson-utils.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/layers/src/geojson-layer/geojson-utils.ts b/src/layers/src/geojson-layer/geojson-utils.ts index 3a4ec3ba32..c85d3f18e8 100644 --- a/src/layers/src/geojson-layer/geojson-utils.ts +++ b/src/layers/src/geojson-layer/geojson-utils.ts @@ -151,6 +151,17 @@ export function parseGeometryFromString(geoString: string): Feature | null { } } + // try parse as wkb using loaders.gl WKBLoader + if (!parsedGeo) { + try { + const buffer = Buffer.from(geoString, 'hex'); + const binaryGeo = parseSync(buffer, WKBLoader); + parsedGeo = binaryToGeometry(binaryGeo); + } catch (e) { + return null; + } + } + if (!parsedGeo) { return null; } From 933f5e2282a517e92ed72eaefb4bebe63c1d77f1 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Wed, 6 Sep 2023 14:39:11 -0700 Subject: [PATCH 02/29] support wkb in csv --- src/layers/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/layers/package.json b/src/layers/package.json index bd16e31026..2400cc2b0e 100644 --- a/src/layers/package.json +++ b/src/layers/package.json @@ -48,8 +48,8 @@ "@loaders.gl/wkt": "^3.4.14", "@luma.gl/constants": "^8.5.19", "@mapbox/geojson-normalize": "0.0.1", - "@nebula.gl/layers": "1.0.2-alpha.1", "@nebula.gl/edit-modes": "1.0.2-alpha.1", + "@nebula.gl/layers": "1.0.2-alpha.1", "@turf/bbox": "^6.0.1", "@turf/helpers": "^6.1.4", "@types/geojson": "^7946.0.7", @@ -85,5 +85,8 @@ "volta": { "node": "14.21.1", "yarn": "1.22.17" + }, + "devDependencies": { + "@loaders.gl/wkt": "^3.4.14" } } From ee69cf851e8cc8dc34d8c37bdf4413b759b820f8 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Wed, 6 Sep 2023 17:10:24 -0700 Subject: [PATCH 03/29] update package.json --- src/layers/package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/layers/package.json b/src/layers/package.json index 2400cc2b0e..ad18d80d5b 100644 --- a/src/layers/package.json +++ b/src/layers/package.json @@ -85,8 +85,5 @@ "volta": { "node": "14.21.1", "yarn": "1.22.17" - }, - "devDependencies": { - "@loaders.gl/wkt": "^3.4.14" } } From 4cd24827f7e3f9d0fa375d55ca47c29f9dd3f461 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Wed, 6 Sep 2023 17:15:32 -0700 Subject: [PATCH 04/29] clean up --- src/layers/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layers/package.json b/src/layers/package.json index ad18d80d5b..bd16e31026 100644 --- a/src/layers/package.json +++ b/src/layers/package.json @@ -48,8 +48,8 @@ "@loaders.gl/wkt": "^3.4.14", "@luma.gl/constants": "^8.5.19", "@mapbox/geojson-normalize": "0.0.1", - "@nebula.gl/edit-modes": "1.0.2-alpha.1", "@nebula.gl/layers": "1.0.2-alpha.1", + "@nebula.gl/edit-modes": "1.0.2-alpha.1", "@turf/bbox": "^6.0.1", "@turf/helpers": "^6.1.4", "@types/geojson": "^7946.0.7", From d1e603b38168b5d79c238d0660edbb24d25f6c74 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Tue, 12 Sep 2023 16:40:54 -0700 Subject: [PATCH 05/29] init impl --- src/constants/src/default-settings.ts | 5 +- src/layers/package.json | 2 +- src/layers/src/geojson-layer/geojson-utils.ts | 116 ++++++++++++++++-- src/processors/src/data-processor.ts | 97 +++++++++++++-- src/processors/src/file-handler.ts | 59 +++++++-- src/reducers/src/vis-state-selectors.ts | 4 +- src/types/layers.d.ts | 16 ++- src/utils/src/dataset-utils.ts | 75 +++++++++++ src/utils/src/index.ts | 6 +- 9 files changed, 347 insertions(+), 33 deletions(-) diff --git a/src/constants/src/default-settings.ts b/src/constants/src/default-settings.ts index b1b25d2fc6..fa4ca6734c 100644 --- a/src/constants/src/default-settings.ts +++ b/src/constants/src/default-settings.ts @@ -496,6 +496,8 @@ const GREEN2 = '74, 165, 150'; const RED = '237, 88, 106'; const ORANGE = '231, 110, 58'; +export const ARROW_GEO_METADATA_KEY = 'geo'; + export const FIELD_TYPE_DISPLAY = { [ALL_FIELD_TYPES.boolean]: { label: 'bool', @@ -1108,7 +1110,8 @@ export const DATASET_FORMATS = keyMirror({ row: null, geojson: null, csv: null, - keplergl: null + keplergl: null, + arrow: null }); export const MAP_CONTROLS = keyMirror({ diff --git a/src/layers/package.json b/src/layers/package.json index bd16e31026..ad18d80d5b 100644 --- a/src/layers/package.json +++ b/src/layers/package.json @@ -48,8 +48,8 @@ "@loaders.gl/wkt": "^3.4.14", "@luma.gl/constants": "^8.5.19", "@mapbox/geojson-normalize": "0.0.1", - "@nebula.gl/layers": "1.0.2-alpha.1", "@nebula.gl/edit-modes": "1.0.2-alpha.1", + "@nebula.gl/layers": "1.0.2-alpha.1", "@turf/bbox": "^6.0.1", "@turf/helpers": "^6.1.4", "@types/geojson": "^7946.0.7", diff --git a/src/layers/src/geojson-layer/geojson-utils.ts b/src/layers/src/geojson-layer/geojson-utils.ts index c85d3f18e8..a667e94dbf 100644 --- a/src/layers/src/geojson-layer/geojson-utils.ts +++ b/src/layers/src/geojson-layer/geojson-utils.ts @@ -18,13 +18,14 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +import {ListVector} from 'apache-arrow'; import normalize from '@mapbox/geojson-normalize'; import bbox from '@turf/bbox'; import {parseSync} from '@loaders.gl/core'; import {WKBLoader, WKTLoader} from '@loaders.gl/wkt'; import {binaryToGeometry} from '@loaders.gl/gis'; -import {Feature, BBox} from 'geojson'; +import {Feature, BBox, MultiPolygon, Position, Polygon} from 'geojson'; import {getSampleData} from '@kepler.gl/utils'; export type GetFeature = (d: any) => Feature; @@ -47,16 +48,21 @@ type FeatureTypeMap = { /* eslint-enable */ export function parseGeoJsonRawFeature(rawFeature: unknown): Feature | null { - if (typeof rawFeature === 'object') { - // Support GeoJson feature as object - // probably need to normalize it as well - const normalized = normalize(rawFeature); - if (!normalized || !Array.isArray(normalized.features)) { - // fail to normalize GeoJson - return null; - } + if (rawFeature && typeof rawFeature === 'object') { + if (typeof rawFeature['type'] === 'string') { + // Support GeoJson feature as object + // probably need to normalize it as well + const normalized = normalize(rawFeature); + if (!normalized || !Array.isArray(normalized.features)) { + // fail to normalize GeoJson + return null; + } - return normalized.features[0]; + return normalized.features[0]; + } else if (rawFeature['encoding'].startsWith('geoarrow')) { + // Support GeoArrow data + return parseGeometryFromArrow(rawFeature); + } } else if (typeof rawFeature === 'string') { return parseGeometryFromString(rawFeature); } else if (Array.isArray(rawFeature)) { @@ -225,3 +231,93 @@ export function getGeojsonFeatureTypes(allFeatures: GeojsonDataMaps): FeatureTyp return featureTypes; } + +/** + * parse geometry from arrow data that is returned from processArrowData() + * + * @param rawData the raw geometry data returned from processArrowData, which is an object with two properties: encoding and data + * @see processArrowData + * @returns + */ +export function parseGeometryFromArrow(rawData: object): Feature | null { + const encoding = rawData['encoding']; + const data = rawData['data']; + if (!encoding || !data) return null; + + switch (encoding) { + case 'geoarrow.multipolygon': { + // convert to geojson MultiPolygon + const arrowMultiPolygon: ListVector = data; + const multiPolygon: Position[][][] = []; + for (let m = 0; m < arrowMultiPolygon.length; m++) { + const arrowPolygon = arrowMultiPolygon.get(m); + const polygon: Position[][] = []; + for (let i = 0; arrowPolygon && i < arrowPolygon?.length; i++) { + const arrowRing = arrowPolygon?.get(i); + const ring: Position[] = []; + for (let j = 0; arrowRing && j < arrowRing.length; j++) { + const arrowCoord = arrowRing.get(j); + const coord: Position = Array.from(arrowCoord); + ring.push(coord); + } + polygon.push(ring); + } + multiPolygon.push(polygon); + } + const geometry: MultiPolygon = { + type: 'MultiPolygon', + coordinates: multiPolygon + }; + return { + type: 'Feature', + geometry, + properties: {} + }; + } + case 'geoarrow.polygon': { + // convert to geojson Polygon + const arrowPolygon: ListVector = data; + const polygon: Position[][] = []; + for (let i = 0; arrowPolygon && i < arrowPolygon.length; i++) { + const arrowRing = arrowPolygon.get(i); + const ring: Position[] = []; + for (let j = 0; arrowRing && j < arrowRing.length; j++) { + const arrowCoord = arrowRing.get(j); + const coords: Position = Array.from(arrowCoord); + ring.push(coords); + } + } + const geometry: Polygon = { + type: 'Polygon', + coordinates: polygon + }; + return { + type: 'Feature', + geometry, + properties: {} + }; + } + case 'geoarrow.multipoint': + // convert to geojson MultiPoint + break; + case 'geoarrow.point': + // convert to geojson Point + break; + case 'geoarrow.multilinestring': + // convert to geojson MultiLineString + break; + case 'geoarrow.linestring': + // convert to geojson LineString + break; + case 'geoarrow.wkb': + // convert to wkb + break; + case 'geoarrow.wkt': + // convert to wkt + break; + default: + // encoding is not supported, skip + console.error('GeoArrow encoding not supported'); + } + return null; +} diff --git a/src/processors/src/data-processor.ts b/src/processors/src/data-processor.ts index e5d7609c33..4b8e323ae8 100644 --- a/src/processors/src/data-processor.ts +++ b/src/processors/src/data-processor.ts @@ -18,21 +18,30 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +import {Table as ApacheArrowTable, Field as ArrowField, ListVector} from 'apache-arrow'; import {csvParseRows} from 'd3-dsv'; +import {DATA_TYPES as AnalyzerDATA_TYPES} from 'type-analyzer'; import normalize from '@mapbox/geojson-normalize'; -import {ALL_FIELD_TYPES, DATASET_FORMATS, GUIDES_FILE_FORMAT_DOC} from '@kepler.gl/constants'; +import {ALL_FIELD_TYPES, DATASET_FORMATS, GUIDES_FILE_FORMAT_DOC, ARROW_GEO_METADATA_KEY} from '@kepler.gl/constants'; import {ProcessorResult, Field} from '@kepler.gl/types'; import { + arrowDataTypeToAnalyzerDataType, + arrowDataTypeToFieldType, notNullorUndefined, hasOwnProperty, isPlainObject, analyzerTypeToFieldType, getSampleForTypeAnalyze, getFieldsFromData, - toArray + toArray, + DataContainerInterface } from '@kepler.gl/utils'; import {KeplerGlSchema, ParsedDataset, SavedMap, LoadedMap} from '@kepler.gl/schemas'; import {Feature} from '@nebula.gl/edit-modes'; +import {ArrowLoader} from '@loaders.gl/arrow'; +import { load } from '@loaders.gl/core'; + +import {ProcessFileDataContent} from './file-handler'; // if any of these value occurs in csv, parse it to null; // const CSV_NULLS = ['', 'null', 'NULL', 'Null', 'NaN', '/N']; @@ -388,12 +397,84 @@ export function processKeplerglDataset( return Array.isArray(rawData) ? results : results[0]; } -export const DATASET_HANDLERS: { - row: typeof processRowObject; - geojson: typeof processGeojson; - csv: typeof processCsvData; - keplergl: typeof processKeplerglDataset; -} = { +export function processArrowColumnarData(content: ProcessFileDataContent): ProcessorResult | null { + const { progress, metadata, fileName, length, data, ...columnarData } = content; + const table = ApacheArrowTable.new(columnarData); + const result = processArrowTable(table); + return result; +} + +/** + * Parse a arrow table with geometry columns and return a dataset + * + * @param arrowTable the arrow table to parse + * @returns dataset containing `fields` and `rows` or null + */ +export function processArrowTable(arrowTable: ApacheArrowTable): ProcessorResult | null { + if (!arrowTable) { + return null; + } + const metadata = arrowTable.schema.metadata; + // get geometry columns if metadata has key 'geo' + let geometryColumns = []; + if (metadata.get(ARROW_GEO_METADATA_KEY) !== undefined) { + // load geo metadata + // parse metadata string to JSON object + const geoMeta = JSON.parse(metadata.get(ARROW_GEO_METADATA_KEY) || ''); + // check if schema_version in geoMeta equals to '0.1.0' + const SCHEMA_VERSION = '0.1.0'; + if (geoMeta.schema_version !== SCHEMA_VERSION) { + console.error('Schema version not supported'); + return null; + } + // get all geometry columns + geometryColumns = geoMeta.columns; + } + + const fields: Field[] = []; + + // parse fields and convert columnar to row format table + const rowFormatTable: any[][] = []; + const columnarTable: {[name: string]: ListVector[]} = {}; + arrowTable.schema.fields.forEach((field: ArrowField, index: number) => { + const arrowColumn = arrowTable.getColumn(field.name); + const values = arrowColumn.toArray(); + columnarTable[field.name] = values; + fields.push({ + name: field.name, + id: field.name, + displayName: field.name, + format: '', + fieldIdx: index, + type: geometryColumns[field.name] ? ALL_FIELD_TYPES.geojson : arrowDataTypeToFieldType(field.type), + analyzerType: geometryColumns[field.name] ? AnalyzerDATA_TYPES.GEOMETRY : arrowDataTypeToAnalyzerDataType(field.type), + valueAccessor: (dc: any) => d => { + return dc.valueAt(d.index, index); + } + }); + }); + + const tableRowsCount = arrowTable.length; + const tableKeys = Object.keys(columnarTable); + for (let index = 0; index < tableRowsCount; index++) { + const tableItem: unknown[] = []; + for (let keyIndex = 0; keyIndex < tableKeys.length; keyIndex++) { + const fieldName = tableKeys[keyIndex]; + const cellValue = columnarTable[fieldName][index]; + tableItem.push( + geometryColumns[fieldName] ? + { + encoding: geometryColumns[fieldName].encoding, + data: cellValue + } : cellValue); + } + rowFormatTable.push(tableItem); + } + + return {fields, rows: rowFormatTable}; +} + +export const DATASET_HANDLERS = { [DATASET_FORMATS.row]: processRowObject, [DATASET_FORMATS.geojson]: processGeojson, [DATASET_FORMATS.csv]: processCsvData, diff --git a/src/processors/src/file-handler.ts b/src/processors/src/file-handler.ts index be7251729f..b2c2c2a474 100644 --- a/src/processors/src/file-handler.ts +++ b/src/processors/src/file-handler.ts @@ -18,12 +18,19 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +import {Type as ArrowType, Table as ArrowTable} from 'apache-arrow'; +import {ArrowLoader} from '@loaders.gl/arrow'; import {parseInBatches} from '@loaders.gl/core'; import {JSONLoader, _JSONPath} from '@loaders.gl/json'; import {CSVLoader} from '@loaders.gl/csv'; -import {processGeojson, processKeplerglJSON, processRowObject} from './data-processor'; +import { + processArrowColumnarData, + processGeojson, + processKeplerglJSON, + processRowObject +} from './data-processor'; import {generateHashId, isPlainObject} from '@kepler.gl/utils'; -import {DATASET_FORMATS} from '@kepler.gl/constants'; +import {DATASET_FORMATS, ARROW_GEO_METADATA_KEY} from '@kepler.gl/constants'; import {Loader} from '@loaders.gl/loader-utils'; import {FileCacheItem, ValidKeplerGlMap} from './types'; import {Feature, AddDataToMapPayload} from '@kepler.gl/types'; @@ -50,6 +57,31 @@ const JSON_LOADER_OPTIONS = { ] }; +export type ProcessFileDataContent = { + data: unknown; + fileName: string; + length?: number; + progress?: {rowCount?: number, rowCountInBatch?: number, percent?: number}; + metadata?: Map; +}; + +const ARROW_LOADER_OPTIONS = { + shape: 'arrow-table', // note: this will be changed to `columnar-table` by loaders.gl v3 + batchType: 'arrow' +}; + +export function isArrowTable(rawObject: unknown): rawObject is ArrowTable { + return isPlainObject(rawObject) && rawObject.typeId === ArrowType.Struct && Boolean(rawObject.data); +} + +export function isArrowColumnarData(content: ProcessFileDataContent): boolean { + return ( + isPlainObject(content) && + Boolean(content.metadata) && + Boolean(content.metadata?.has(ARROW_GEO_METADATA_KEY)) + ); +} + export function isGeoJson(json: unknown): json is Feature | FeatureCollection { // json can be feature collection // or single feature @@ -128,7 +160,7 @@ export async function* readBatch( result = batches; } } else { - for (let i = 0; i < batch.data.length; i++) { + for (let i = 0; i < batch.data?.length; i++) { batches.push(batch.data[i]); } } @@ -152,11 +184,12 @@ export async function readFileInBatches({ fileCache: FileCacheItem[]; loaders: Loader[]; loadOptions: any; -}): Promise { - loaders = [JSONLoader, CSVLoader, ...loaders]; + }): Promise { + loaders = [JSONLoader, CSVLoader, ArrowLoader, ...loaders]; loadOptions = { csv: CSV_LOADER_OPTIONS, json: JSON_LOADER_OPTIONS, + arrow: ARROW_LOADER_OPTIONS, metadata: true, ...loadOptions }; @@ -171,14 +204,24 @@ export function processFileData({ content, fileCache }: { - content: {data: unknown; fileName: string}; + content: ProcessFileDataContent; fileCache: FileCacheItem[]; }): Promise { return new Promise((resolve, reject) => { - const {data} = content; - + let {data} = content; let format: string | undefined; let processor: Function | undefined; + + if (isArrowColumnarData(content)) { + // in loaders.gl/arrow version < 4.0.0, the arrow loader in batch didn't return the correct data. + // Instead, the content of each column is returned and stored directly in the content object. + // This is a temporary solution untill loaders.gl/arrow is updated to: + // https://github.com/visgl/loaders.gl/blob/2577ca735878b521f07a556f26ce8ee457a7ad9f/modules/arrow/src/lib/parse-arrow-in-batches.ts#L29 + data = content; + format = DATASET_FORMATS.arrow; + processor = processArrowColumnarData; + } + if (isKeplerGlMap(data)) { format = DATASET_FORMATS.keplergl; processor = processKeplerglJSON; diff --git a/src/reducers/src/vis-state-selectors.ts b/src/reducers/src/vis-state-selectors.ts index c9d7e55584..317b23d28e 100644 --- a/src/reducers/src/vis-state-selectors.ts +++ b/src/reducers/src/vis-state-selectors.ts @@ -21,8 +21,8 @@ import {createSelector} from 'reselect'; // NOTE: default formats must match file-handler-test.js -const DEFAULT_FILE_EXTENSIONS = ['csv', 'json', 'geojson']; -const DEFAULT_FILE_FORMATS = ['CSV', 'Json', 'GeoJSON']; +const DEFAULT_FILE_EXTENSIONS = ['csv', 'json', 'geojson', 'arrow']; +const DEFAULT_FILE_FORMATS = ['CSV', 'Json', 'GeoJSON', 'Arrow']; export const getFileFormatNames = createSelector( // @ts-expect-error diff --git a/src/types/layers.d.ts b/src/types/layers.d.ts index 10a24d9818..7171e3e993 100644 --- a/src/types/layers.d.ts +++ b/src/types/layers.d.ts @@ -57,6 +57,20 @@ export type LayerWeightConfig = { weightField: VisualChannelField; }; +export enum GEOARROW_ENCODINGS { + MULTI_POLYGON = 'geoarrow.multipolygon', + POLYGON = 'geoarrow.polygon', + MULTI_LINESTRING = 'geoarrow.multilinestring', + LINESTRING = 'geoarrow.linestring', + MULTI_POINT = 'geoarrow.multipoint', + POINT = 'geoarrow.point' +} + +export type GeoArrowFieldMetaData = { + encoding: GEOARROW_ENCODINGS; + crs: string; +}; + export type Field = { analyzerType: string; id?: string; @@ -67,7 +81,7 @@ export type Field = { fieldIdx: number; valueAccessor(v: {index: number}): any; filterProps?: any; - metadata?: any; + metadata?: object | GeoArrowFieldMetaData; displayFormat?: string; }; diff --git a/src/utils/src/dataset-utils.ts b/src/utils/src/dataset-utils.ts index 53e8d94810..406feedce9 100644 --- a/src/utils/src/dataset-utils.ts +++ b/src/utils/src/dataset-utils.ts @@ -18,6 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +import {DataType as ArrowDataType} from 'apache-arrow'; import {console as globalConsole} from 'global/window'; import { ALL_FIELD_TYPES, @@ -582,6 +583,80 @@ export function analyzerTypeToFieldType(aType: string): string { } } +/** + * Convert arrow data type to kepler.gl field types + * + * @param arrowType the arrow data type + * @returns corresponding type in `ALL_FIELD_TYPES` + */ +export function arrowDataTypeToFieldType(arrowType: ArrowDataType): typeof ALL_FIELD_TYPES { + // Note: this function doesn't return ALL_FIELD_TYPES.geojson or ALL_FIELD_TYPES.array, which + // should be further detected by caller + if (ArrowDataType.isDate(arrowType)) { + return ALL_FIELD_TYPES.date; + } else if (ArrowDataType.isTimestamp(arrowType) || ArrowDataType.isTime(arrowType)) { + return ALL_FIELD_TYPES.timestamp; + } else if (ArrowDataType.isFloat(arrowType)) { + return ALL_FIELD_TYPES.real; + } else if (ArrowDataType.isInt(arrowType)) { + return ALL_FIELD_TYPES.integer; + } else if (ArrowDataType.isBool(arrowType)) { + return ALL_FIELD_TYPES.boolean; + } else if (ArrowDataType.isUtf8(arrowType) || ArrowDataType.isNull(arrowType)) { + return ALL_FIELD_TYPES.string; + } else if ( + ArrowDataType.isBinary(arrowType) || + ArrowDataType.isDictionary(arrowType) || + ArrowDataType.isFixedSizeBinary(arrowType) || + ArrowDataType.isFixedSizeList(arrowType) || + ArrowDataType.isList(arrowType) || + ArrowDataType.isMap(arrowType) || + ArrowDataType.isStruct(arrowType) + ) { + return ALL_FIELD_TYPES.object; + } else { + globalConsole.warn(`Unsupported arrow type: ${arrowType}`); + return ALL_FIELD_TYPES.string; + } +} + +/** + * Convert arrow data type to analyzer type + * + * @param arrowType the arrow data type + * @returns corresponding type in `AnalyzerDATA_TYPES` + */ +export function arrowDataTypeToAnalyzerDataType( + arrowType: ArrowDataType +): typeof AnalyzerDATA_TYPES { + if (ArrowDataType.isDate(arrowType)) { + return AnalyzerDATA_TYPES.DATE; + } else if (ArrowDataType.isTimestamp(arrowType) || ArrowDataType.isTime(arrowType)) { + return AnalyzerDATA_TYPES.DATETIME; + } else if (ArrowDataType.isFloat(arrowType)) { + return AnalyzerDATA_TYPES.FLOAT; + } else if (ArrowDataType.isInt(arrowType)) { + return AnalyzerDATA_TYPES.INT; + } else if (ArrowDataType.isBool(arrowType)) { + return AnalyzerDATA_TYPES.BOOLEAN; + } else if (ArrowDataType.isUtf8(arrowType) || ArrowDataType.isNull(arrowType)) { + return AnalyzerDATA_TYPES.STRING; + } else if ( + ArrowDataType.isBinary(arrowType) || + ArrowDataType.isDictionary(arrowType) || + ArrowDataType.isFixedSizeBinary(arrowType) || + ArrowDataType.isFixedSizeList(arrowType) || + ArrowDataType.isList(arrowType) || + ArrowDataType.isMap(arrowType) || + ArrowDataType.isStruct(arrowType) + ) { + return AnalyzerDATA_TYPES.OBJECT; + } else { + globalConsole.warn(`Unsupported arrow type: ${arrowType}`); + return AnalyzerDATA_TYPES.STRING; + } +} + const TIME_DISPLAY = '2020-05-11 14:00'; const addTimeLabel = (formats: TimeLabelFormat[]) => diff --git a/src/utils/src/index.ts b/src/utils/src/index.ts index 10e32be99c..a8931864cf 100644 --- a/src/utils/src/index.ts +++ b/src/utils/src/index.ts @@ -52,7 +52,9 @@ export { renameDuplicateFields, analyzerTypeToFieldType, getFormatLabels, - getFieldFormatLabels + getFieldFormatLabels, + arrowDataTypeToFieldType, + arrowDataTypeToAnalyzerDataType } from './dataset-utils'; export {getFormatValue} from './format'; export {exportMapToHTML} from './export-map-html'; @@ -120,4 +122,4 @@ export { export {DataRow} from './data-row'; export type {Centroid} from './h3-utils'; -export {getCentroid, idToPolygonGeo, h3IsValid, getHexFields} from './h3-utils'; \ No newline at end of file +export {getCentroid, idToPolygonGeo, h3IsValid, getHexFields} from './h3-utils'; From d75e46977567682151390768124bc3bfa178c28f Mon Sep 17 00:00:00 2001 From: Xun Li Date: Tue, 12 Sep 2023 22:31:38 -0700 Subject: [PATCH 06/29] wip --- src/layers/src/geojson-layer/geojson-utils.ts | 256 +++++++++++++----- test/node/utils/geojson-utils-test.js | 45 +++ test/node/utils/index.js | 1 + 3 files changed, 238 insertions(+), 64 deletions(-) create mode 100644 test/node/utils/geojson-utils-test.js diff --git a/src/layers/src/geojson-layer/geojson-utils.ts b/src/layers/src/geojson-layer/geojson-utils.ts index a667e94dbf..d5cabd8656 100644 --- a/src/layers/src/geojson-layer/geojson-utils.ts +++ b/src/layers/src/geojson-layer/geojson-utils.ts @@ -18,14 +18,25 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {ListVector} from 'apache-arrow'; +import {ListVector, FloatVector, BinaryVector, Utf8Vector} from 'apache-arrow'; +import wktParser from 'wellknown'; import normalize from '@mapbox/geojson-normalize'; import bbox from '@turf/bbox'; import {parseSync} from '@loaders.gl/core'; import {WKBLoader, WKTLoader} from '@loaders.gl/wkt'; import {binaryToGeometry} from '@loaders.gl/gis'; -import {Feature, BBox, MultiPolygon, Position, Polygon} from 'geojson'; +import { + Feature, + BBox, + MultiPolygon, + Position, + Polygon, + MultiPoint, + Point, + MultiLineString, + LineString +} from 'geojson'; import {getSampleData} from '@kepler.gl/utils'; export type GetFeature = (d: any) => Feature; @@ -232,6 +243,159 @@ export function getGeojsonFeatureTypes(allFeatures: GeojsonDataMaps): FeatureTyp return featureTypes; } +/** + * convert Arrow MultiPolygon to geojson Feature + */ +function arrowMultiPolygonToFeature(arrowMultiPolygon: ListVector): MultiPolygon { + const multiPolygon: Position[][][] = []; + for (let m = 0; m < arrowMultiPolygon.length; m++) { + const arrowPolygon = arrowMultiPolygon.get(m); + const polygon: Position[][] = []; + for (let i = 0; arrowPolygon && i < arrowPolygon?.length; i++) { + const arrowRing = arrowPolygon?.get(i); + const ring: Position[] = []; + for (let j = 0; arrowRing && j < arrowRing.length; j++) { + const arrowCoord = arrowRing.get(j); + const coord: Position = Array.from(arrowCoord); + ring.push(coord); + } + polygon.push(ring); + } + multiPolygon.push(polygon); + } + const geometry: MultiPolygon = { + type: 'MultiPolygon', + coordinates: multiPolygon + }; + return geometry; +} + +/** + * convert Arrow Polygon to geojson Feature + */ +function arrowPolygonToFeature(arrowPolygon: ListVector): Polygon { + const polygon: Position[][] = []; + for (let i = 0; arrowPolygon && i < arrowPolygon.length; i++) { + const arrowRing = arrowPolygon.get(i); + const ring: Position[] = []; + for (let j = 0; arrowRing && j < arrowRing.length; j++) { + const arrowCoord = arrowRing.get(j); + const coords: Position = Array.from(arrowCoord); + ring.push(coords); + } + } + const geometry: Polygon = { + type: 'Polygon', + coordinates: polygon + }; + return geometry; +} + +/** + * convert Arrow MultiPoint to geojson MultiPoint + */ +function arrowMultiPointToFeature(arrowMultiPoint: ListVector): MultiPoint { + const multiPoint: Position[] = []; + for (let i = 0; arrowMultiPoint && i < arrowMultiPoint.length; i++) { + const arrowPoint = arrowMultiPoint.get(i); + if (arrowPoint) { + const coord: Position = Array.from(arrowPoint); + multiPoint.push(coord); + } + } + const geometry: MultiPoint = { + type: 'MultiPoint', + coordinates: multiPoint + }; + return geometry; +} + +/** + * convert Arrow Point to geojson Point + */ +function arrowPointToFeature(arrowPoint: FloatVector): Point { + const point: Position = Array.from(arrowPoint.values); + const geometry: Point = { + type: 'Point', + coordinates: point + }; + return geometry; +} + +/** + * convert Arrow MultiLineString to geojson MultiLineString + */ +function arrowMultiLineStringToFeature(arrowMultiLineString: ListVector): MultiLineString { + const multiLineString: Position[][] = []; + for (let i = 0; arrowMultiLineString && i < arrowMultiLineString.length; i++) { + const arrowLineString = arrowMultiLineString.get(i); + const lineString: Position[] = []; + for (let j = 0; arrowLineString && j < arrowLineString.length; j++) { + const arrowCoord = arrowLineString.get(j); + if (arrowCoord) { + const coords: Position = Array.from(arrowCoord); + lineString.push(coords); + } + } + multiLineString.push(lineString); + } + const geometry: MultiLineString = { + type: 'MultiLineString', + coordinates: multiLineString + }; + return geometry; +} + +/** + * convert Arrow LineString to geojson LineString + */ +function arrowLineStringToFeature(arrowLineString: ListVector): LineString { + const lineString: Position[] = []; + for (let i = 0; arrowLineString && i < arrowLineString.length; i++) { + const arrowCoord = arrowLineString.get(i); + if (arrowCoord) { + const coords: Position = Array.from(arrowCoord); + lineString.push(coords); + } + } + const geometry: LineString = { + type: 'LineString', + coordinates: lineString + }; + return geometry; +} + +/** + * convert Arrow wkb to geojson Geometry + */ +function arrowWkbToFeature(arrowWkb: BinaryVector): Feature | null { + const binaryGeo = parseSync(arrowWkb.values, WKBLoader); + const geometry = binaryToGeometry(binaryGeo); + const normalized = normalize(geometry); + + if (!normalized || !Array.isArray(normalized.features)) { + // fail to normalize geojson + return null; + } + + return normalized.features[0]; +} + +/** + * convert Arrow wkt to geojson Geometry + */ +function arrowWktToFeature(arrowWkt: Utf8Vector): Feature | null { + const geometry = wktParser(arrowWkt.get(0)); + const normalized = normalize(geometry); + + if (!normalized || !Array.isArray(normalized.features)) { + // fail to normalize geojson + return null; + } + + return normalized.features[0]; +} + /** * parse geometry from arrow data that is returned from processArrowData() * @@ -244,80 +408,44 @@ export function parseGeometryFromArrow(rawData: object): Feature | null { const data = rawData['data']; if (!encoding || !data) return null; + let geometry; + switch (encoding) { - case 'geoarrow.multipolygon': { - // convert to geojson MultiPolygon - const arrowMultiPolygon: ListVector = data; - const multiPolygon: Position[][][] = []; - for (let m = 0; m < arrowMultiPolygon.length; m++) { - const arrowPolygon = arrowMultiPolygon.get(m); - const polygon: Position[][] = []; - for (let i = 0; arrowPolygon && i < arrowPolygon?.length; i++) { - const arrowRing = arrowPolygon?.get(i); - const ring: Position[] = []; - for (let j = 0; arrowRing && j < arrowRing.length; j++) { - const arrowCoord = arrowRing.get(j); - const coord: Position = Array.from(arrowCoord); - ring.push(coord); - } - polygon.push(ring); - } - multiPolygon.push(polygon); - } - const geometry: MultiPolygon = { - type: 'MultiPolygon', - coordinates: multiPolygon - }; - return { - type: 'Feature', - geometry, - properties: {} - }; - } - case 'geoarrow.polygon': { - // convert to geojson Polygon - const arrowPolygon: ListVector = data; - const polygon: Position[][] = []; - for (let i = 0; arrowPolygon && i < arrowPolygon.length; i++) { - const arrowRing = arrowPolygon.get(i); - const ring: Position[] = []; - for (let j = 0; arrowRing && j < arrowRing.length; j++) { - const arrowCoord = arrowRing.get(j); - const coords: Position = Array.from(arrowCoord); - ring.push(coords); - } - } - const geometry: Polygon = { - type: 'Polygon', - coordinates: polygon - }; - return { - type: 'Feature', - geometry, - properties: {} - }; - } + case 'geoarrow.multipolygon': + geometry = arrowMultiPolygonToFeature(data); + break; + case 'geoarrow.polygon': + geometry = arrowPolygonToFeature(data); + break; case 'geoarrow.multipoint': - // convert to geojson MultiPoint + geometry = arrowMultiPointToFeature(data); break; case 'geoarrow.point': - // convert to geojson Point + geometry = arrowPointToFeature(data); break; case 'geoarrow.multilinestring': - // convert to geojson MultiLineString + geometry = arrowMultiLineStringToFeature(data); break; case 'geoarrow.linestring': - // convert to geojson LineString + geometry = arrowLineStringToFeature(data); break; - case 'geoarrow.wkb': + case 'geoarrow.wkb': { // convert to wkb - break; - case 'geoarrow.wkt': + return arrowWkbToFeature(data); + } + case 'geoarrow.wkt': { // convert to wkt - break; - default: + return arrowWktToFeature(data); + } + default: { // encoding is not supported, skip console.error('GeoArrow encoding not supported'); + return null; + } } - return null; + return { + type: 'Feature', + geometry, + properties: {} + }; } diff --git a/test/node/utils/geojson-utils-test.js b/test/node/utils/geojson-utils-test.js new file mode 100644 index 0000000000..1d2b20c94f --- /dev/null +++ b/test/node/utils/geojson-utils-test.js @@ -0,0 +1,45 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import test from 'tape'; + +import {ListVector} from 'apache-arrow'; +import {parseGeometryFromArrow} from '@kepler.gl/layesr'; + +test('geojsonUtils.parseGeometryFromArrow', t => { + const testArrowGeometry = ListVector.new([ + [ + [ + [4.924520108835094, 45.80404000200565], + [4.918578945137262, 45.80935260092964], + [4.946835385014492, 45.80941095853843], + [4.924520108835094, 45.80404000200565] + ] + ] + ]); + const testArrowGeometryObject = { + encoding: 'geoarrow.multipolygon', + data: testArrowGeometry + } + const testFeature = parseGeometryFromArrow(testArrowGeometryObject); + + t.equal(testFeature.geometry.type, 'MultiPolygon', 'geometry type is MultiPolygon'); + t.end(); +}); diff --git a/test/node/utils/index.js b/test/node/utils/index.js index f5df834c65..8060c07650 100644 --- a/test/node/utils/index.js +++ b/test/node/utils/index.js @@ -40,3 +40,4 @@ import './kepler-gl-utils-test'; import './timeline-test'; import './composer-helpers-test'; import './dom-to-image'; +import './geojson-utils-test'; From e56be7e421eaf04f63e3f90db6bd1574b33dfa72 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 14 Sep 2023 21:10:49 -0700 Subject: [PATCH 07/29] wip --- src/layers/src/index.ts | 2 +- src/processors/src/data-processor.ts | 13 +- src/utils/src/dataset-utils.ts | 2 +- test/node/utils/geojson-utils-test.js | 197 +++++++++++++++++++++++--- 4 files changed, 182 insertions(+), 32 deletions(-) diff --git a/src/layers/src/index.ts b/src/layers/src/index.ts index df1212bcae..c5a85ba3e8 100644 --- a/src/layers/src/index.ts +++ b/src/layers/src/index.ts @@ -48,7 +48,7 @@ export {defaultElevation as s2DefaultElevation} from './s2-geometry-layer/s2-geo export {getS2Center} from './s2-geometry-layer/s2-utils'; export {default as AggregationLayer} from './aggregation-layer'; import {LAYER_TYPES} from '@kepler.gl/constants'; -export {parseGeoJsonRawFeature} from './geojson-layer/geojson-utils'; +export {parseGeoJsonRawFeature, parseGeometryFromArrow} from './geojson-layer/geojson-utils'; // base layer // eslint-disable-next-line prettier/prettier export type { diff --git a/src/processors/src/data-processor.ts b/src/processors/src/data-processor.ts index 4b8e323ae8..ca9246e700 100644 --- a/src/processors/src/data-processor.ts +++ b/src/processors/src/data-processor.ts @@ -33,14 +33,10 @@ import { analyzerTypeToFieldType, getSampleForTypeAnalyze, getFieldsFromData, - toArray, - DataContainerInterface + toArray } from '@kepler.gl/utils'; import {KeplerGlSchema, ParsedDataset, SavedMap, LoadedMap} from '@kepler.gl/schemas'; import {Feature} from '@nebula.gl/edit-modes'; -import {ArrowLoader} from '@loaders.gl/arrow'; -import { load } from '@loaders.gl/core'; - import {ProcessFileDataContent} from './file-handler'; // if any of these value occurs in csv, parse it to null; @@ -398,10 +394,9 @@ export function processKeplerglDataset( } export function processArrowColumnarData(content: ProcessFileDataContent): ProcessorResult | null { - const { progress, metadata, fileName, length, data, ...columnarData } = content; - const table = ApacheArrowTable.new(columnarData); - const result = processArrowTable(table); - return result; + // const { progress, metadata, fileName, length, data, ...columnarData } = content; + // const table = ApacheArrowTable.new(columnarData); + return null; } /** diff --git a/src/utils/src/dataset-utils.ts b/src/utils/src/dataset-utils.ts index 406feedce9..b33ce6140a 100644 --- a/src/utils/src/dataset-utils.ts +++ b/src/utils/src/dataset-utils.ts @@ -589,7 +589,7 @@ export function analyzerTypeToFieldType(aType: string): string { * @param arrowType the arrow data type * @returns corresponding type in `ALL_FIELD_TYPES` */ -export function arrowDataTypeToFieldType(arrowType: ArrowDataType): typeof ALL_FIELD_TYPES { +export function arrowDataTypeToFieldType(arrowType: ArrowDataType): string { // Note: this function doesn't return ALL_FIELD_TYPES.geojson or ALL_FIELD_TYPES.array, which // should be further detected by caller if (ArrowDataType.isDate(arrowType)) { diff --git a/test/node/utils/geojson-utils-test.js b/test/node/utils/geojson-utils-test.js index 1d2b20c94f..7a383d9216 100644 --- a/test/node/utils/geojson-utils-test.js +++ b/test/node/utils/geojson-utils-test.js @@ -20,26 +20,181 @@ import test from 'tape'; -import {ListVector} from 'apache-arrow'; -import {parseGeometryFromArrow} from '@kepler.gl/layesr'; - -test('geojsonUtils.parseGeometryFromArrow', t => { - const testArrowGeometry = ListVector.new([ - [ - [ - [4.924520108835094, 45.80404000200565], - [4.918578945137262, 45.80935260092964], - [4.946835385014492, 45.80941095853843], - [4.924520108835094, 45.80404000200565] - ] - ] - ]); - const testArrowGeometryObject = { - encoding: 'geoarrow.multipolygon', - data: testArrowGeometry - } - const testFeature = parseGeometryFromArrow(testArrowGeometryObject); - - t.equal(testFeature.geometry.type, 'MultiPolygon', 'geometry type is MultiPolygon'); +import {ArrowLoader} from '@loaders.gl/arrow'; +import {ARROW_GEO_METADATA_KEY} from '@kepler.gl/constants'; +import {parseGeometryFromArrow} from '@kepler.gl/layers'; + +// a simple geojson file contains one point +const expectedPointGeojson = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: { + id: 2, + name: 'name2' + }, + geometry: { + type: 'Point', + coordinates: [1, 1] + } + } + ] +}; + +// a parquet file converted from the above geojson file in arraybuffer format +const testPointArrowRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,216,3,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,80,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,100,253,255,255,52,2,0,0,4,0,0,0,39,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,36,1,0,0,228,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,16,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,124,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,28,0,0,0,4,0,0,0,14,0,0,0,103,101,111,97,114,114,111,119,46,112,111,105,110,116,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,24,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,40,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,156,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,255,255,255,255,0,0,0,0,24,0,0,0,0,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,96,2,0,0,60,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,240,250,255,255,24,2,0,0,4,0,0,0,10,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,49,46,48,44,49,46,48,93,125,125,125,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,232,3,0,0,0,0,0,0,32,1,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,80,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,100,253,255,255,52,2,0,0,4,0,0,0,39,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,36,1,0,0,228,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,16,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,124,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,28,0,0,0,4,0,0,0,14,0,0,0,103,101,111,97,114,114,111,119,46,112,111,105,110,116,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,72,6,0,0,65,82,82,79,87,49'; + +// a simple geojson file contains one linestring +const expectedLineStringGeoJson = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: { + id: 1, + name: 'name1' + }, + geometry: { + type: 'LineString', + coordinates: [ + [0, 0], + [1, 1] + ] + } + } + ] +}; +// a simple geojson file contains one MultiLinestring +const expectedMultiLineStringGeoJson = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: { + id: 2, + name: 'name2' + }, + geometry: { + type: 'MultiLineString', + coordinates: [ + [ + [0, 0], + [1, 1] + ], + [ + [1, 1], + [2, 2] + ] + ] + } + } + ] +}; + +// a simple geojson file contains one polygon and one multipolygon +const testGeojsonFile3 = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: { + id: 1, + name: 'name1' + }, + geometry: { + type: 'Polygon', + coordinates: [ + [ + [0, 0], + [1, 1], + [2, 2], + [0, 0] + ] + ] + } + }, + { + type: 'Feature', + properties: { + id: 2, + name: 'name2' + }, + geometry: { + type: 'MultiPolygon', + coordinates: [ + [ + [ + [0, 0], + [1, 1], + [2, 2], + [0, 0] + ] + ], + [ + [ + [0, 0], + [1, 1], + [2, 2], + [0, 0] + ] + ] + ] + } + } + ] +}; + +test('geojsonUtils.parseGeometryFromArrow', async t => { + // load parquet file using loaders.gl/arrow + const testPointArrowTable = new Uint8Array( + testPointArrowRawBytes.split(',').map(byte => parseInt(byte, 10)) + ); + + const arrowTable = await ArrowLoader.parse(testPointArrowTable.buffer, { + arrow: {shape: 'arrow-table'} + }); + + // check if the arrow table is loaded correctly + t.equal(arrowTable.length, 1, 'arrow table has 1 row'); + t.equal(arrowTable.numCols, 3, 'arrow table has 3 columns'); + + // check fields exist in arrow table schema + t.equal(arrowTable.schema.fields[0].name, 'id', 'arrow table has id column'); + t.equal(arrowTable.schema.fields[1].name, 'name', 'arrow table has name column'); + t.equal(arrowTable.schema.fields[2].name, 'geometry', 'arrow table has geometry column'); + + const metadata = arrowTable.schema.metadata; + // check metadata exists in arrow table schema + t.equal(Boolean(metadata.get(ARROW_GEO_METADATA_KEY)), true, 'arrow table has geo metadata'); + + const geoMeta = JSON.parse(metadata.get(ARROW_GEO_METADATA_KEY) || ''); + const geometryColumns = geoMeta.columns; + + // check 'geometry' is in geometryColumns (geometryColumns is a Map object) + t.equal(Boolean(geometryColumns['geometry']), true, 'geometryColumns has geometry column'); + + // get encoding from geometryColumns['geometry'] + const encoding = geometryColumns['geometry'].encoding; + + // check encoding is 'geoarrow.point' + t.equal(encoding, 'geoarrow.point', 'encoding is geoarrow.point'); + + // get first geometry from arrow geometry column + const firstArrowGeometry = arrowTable.getColumn('geometry').get(0); + const firstArrowGeometryObject = { + encoding, + data: firstArrowGeometry + }; + // parse arrow geometry to geojson feature + const firstFeature = parseGeometryFromArrow(firstArrowGeometryObject); + + // check if geometry in firstFeature is equal to the original geometry in expectedPointGeojson + t.deepEqual( + firstFeature.geometry, + expectedPointGeojson.features[0].geometry, + 'firstFeature.geometry is equal to expectedPointGeojson.features[0].geometry' + ); t.end(); }); From 1016b26b9f3265f0660c2ff5927f494474e0c9f6 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Fri, 15 Sep 2023 17:15:08 -0700 Subject: [PATCH 08/29] add test cases --- src/layers/src/geojson-layer/geojson-utils.ts | 2 + test/node/utils/geojson-utils-test.js | 213 ++++++++++++------ 2 files changed, 140 insertions(+), 75 deletions(-) diff --git a/src/layers/src/geojson-layer/geojson-utils.ts b/src/layers/src/geojson-layer/geojson-utils.ts index d5cabd8656..dc5ec77a6c 100644 --- a/src/layers/src/geojson-layer/geojson-utils.ts +++ b/src/layers/src/geojson-layer/geojson-utils.ts @@ -283,6 +283,8 @@ function arrowPolygonToFeature(arrowPolygon: ListVector): Polygon { const coords: Position = Array.from(arrowCoord); ring.push(coords); } + polygon.push(ring); + console.log(polygon); } const geometry: Polygon = { type: 'Polygon', diff --git a/test/node/utils/geojson-utils-test.js b/test/node/utils/geojson-utils-test.js index 7a383d9216..4e2dab6692 100644 --- a/test/node/utils/geojson-utils-test.js +++ b/test/node/utils/geojson-utils-test.js @@ -24,6 +24,10 @@ import {ArrowLoader} from '@loaders.gl/arrow'; import {ARROW_GEO_METADATA_KEY} from '@kepler.gl/constants'; import {parseGeometryFromArrow} from '@kepler.gl/layers'; +// an arrow file converted from the geojson file below in arraybuffer format +const testPointArrowRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,216,3,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,80,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,100,253,255,255,52,2,0,0,4,0,0,0,39,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,36,1,0,0,228,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,16,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,124,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,28,0,0,0,4,0,0,0,14,0,0,0,103,101,111,97,114,114,111,119,46,112,111,105,110,116,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,24,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,40,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,156,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,255,255,255,255,0,0,0,0,24,0,0,0,0,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,96,2,0,0,60,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,240,250,255,255,24,2,0,0,4,0,0,0,10,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,49,46,48,44,49,46,48,93,125,125,125,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,232,3,0,0,0,0,0,0,32,1,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,80,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,100,253,255,255,52,2,0,0,4,0,0,0,39,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,36,1,0,0,228,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,16,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,124,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,28,0,0,0,4,0,0,0,14,0,0,0,103,101,111,97,114,114,111,119,46,112,111,105,110,116,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,72,6,0,0,65,82,82,79,87,49'; + // a simple geojson file contains one point const expectedPointGeojson = { type: 'FeatureCollection', @@ -42,11 +46,9 @@ const expectedPointGeojson = { ] }; -// a parquet file converted from the above geojson file in arraybuffer format -const testPointArrowRawBytes = - '65,82,82,79,87,49,0,0,255,255,255,255,216,3,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,80,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,100,253,255,255,52,2,0,0,4,0,0,0,39,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,36,1,0,0,228,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,16,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,124,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,28,0,0,0,4,0,0,0,14,0,0,0,103,101,111,97,114,114,111,119,46,112,111,105,110,116,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,24,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,40,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,156,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,255,255,255,255,0,0,0,0,24,0,0,0,0,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,96,2,0,0,60,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,240,250,255,255,24,2,0,0,4,0,0,0,10,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,49,46,48,44,49,46,48,93,125,125,125,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,232,3,0,0,0,0,0,0,32,1,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,80,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,100,253,255,255,52,2,0,0,4,0,0,0,39,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,36,1,0,0,228,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,16,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,124,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,28,0,0,0,4,0,0,0,14,0,0,0,103,101,111,97,114,114,111,119,46,112,111,105,110,116,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,72,6,0,0,65,82,82,79,87,49'; - // a simple geojson file contains one linestring +const testLineStringArrowRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,24,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,0,0,0,0,255,255,255,255,72,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,64,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,188,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,100,2,0,0,64,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,228,250,255,255,28,2,0,0,4,0,0,0,15,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,49,46,48,44,49,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,40,4,0,0,0,0,0,0,80,1,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,128,6,0,0,65,82,82,79,87,49'; const expectedLineStringGeoJson = { type: 'FeatureCollection', features: [ @@ -66,26 +68,28 @@ const expectedLineStringGeoJson = { } ] }; -// a simple geojson file contains one MultiLinestring -const expectedMultiLineStringGeoJson = { + +// a simple geojson file contains one polygon and one multipolygon +const testPolygonArrowRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,56,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,84,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,96,253,255,255,56,2,0,0,4,0,0,0,43,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,108,121,103,111,110,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,128,1,0,0,64,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,16,0,0,0,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,120,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,104,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,220,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,124,2,0,0,100,2,0,0,64,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,232,250,255,255,28,2,0,0,4,0,0,0,12,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,50,46,48,44,50,46,48,93,125,125,125,0,0,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,72,4,0,0,0,0,0,0,128,1,0,0,0,0,0,0,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,84,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,96,253,255,255,56,2,0,0,4,0,0,0,43,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,108,121,103,111,110,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,128,1,0,0,64,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,16,0,0,0,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,168,6,0,0,65,82,82,79,87,49'; + +const expectedPolygonGeojson = { type: 'FeatureCollection', features: [ { type: 'Feature', properties: { - id: 2, - name: 'name2' + id: 1, + name: 'name1' }, geometry: { - type: 'MultiLineString', + type: 'Polygon', coordinates: [ [ [0, 0], - [1, 1] - ], - [ [1, 1], - [2, 2] + [2, 2], + [0, 0] ] ] } @@ -93,33 +97,69 @@ const expectedMultiLineStringGeoJson = { ] }; -// a simple geojson file contains one polygon and one multipolygon -const testGeojsonFile3 = { +// a simple geojson file contains one MultiPoint +const testMultiPointArrowRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,24,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,105,110,116,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,0,0,0,0,255,255,255,255,72,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,64,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,188,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,100,2,0,0,64,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,228,250,255,255,28,2,0,0,4,0,0,0,15,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,50,46,48,44,50,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,40,4,0,0,0,0,0,0,80,1,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,105,110,116,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,128,6,0,0,65,82,82,79,87,49'; +const expectedMultiPointGeoJson = { type: 'FeatureCollection', features: [ { type: 'Feature', properties: { - id: 1, - name: 'name1' + id: 2, + name: 'name2' }, geometry: { - type: 'Polygon', + type: 'MultiPoint', + coordinates: [ + [1, 1], + [2, 2] + ] + } + } + ] +}; + +// a simple geojson file contains one MultiLinestring +const testMultiLineStringArrowRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,80,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,100,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,80,253,255,255,72,2,0,0,4,0,0,0,59,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,136,1,0,0,72,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,124,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,112,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,40,0,0,0,4,0,0,0,24,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,120,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,112,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,220,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,16,64,0,0,0,0,0,0,16,64,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,132,2,0,0,108,2,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,208,250,255,255,36,2,0,0,4,0,0,0,20,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,52,46,48,44,52,46,48,93,125,125,125,0,0,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,96,4,0,0,0,0,0,0,128,1,0,0,0,0,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,100,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,80,253,255,255,72,2,0,0,4,0,0,0,59,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,136,1,0,0,72,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,124,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,112,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,40,0,0,0,4,0,0,0,24,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,200,6,0,0,65,82,82,79,87,49'; +const expectedMultiLineStringGeoJson = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: { + id: 2, + name: 'name2' + }, + geometry: { + type: 'MultiLineString', coordinates: [ [ - [0, 0], [1, 1], - [2, 2], - [0, 0] + [2, 2] + ], + [ + [3, 3], + [4, 4] ] ] } - }, + } + ] +}; + +// a simple geojson file contains one MultiPolygon +const testMultiPolygonArrowRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,120,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,96,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,84,253,255,255,68,2,0,0,4,0,0,0,53,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,108,121,103,111,110,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,176,1,0,0,112,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,120,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,108,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,36,0,0,0,4,0,0,0,21,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,12,255,255,255,8,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,0,0,0,0,255,255,255,255,168,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,224,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,252,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,160,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,255,255,255,255,0,0,0,0,24,0,0,0,0,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,124,2,0,0,104,2,0,0,68,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,220,250,255,255,32,2,0,0,4,0,0,0,17,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,51,46,48,44,51,46,48,93,125,125,125,0,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,136,4,0,0,0,0,0,0,176,1,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,96,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,84,253,255,255,68,2,0,0,4,0,0,0,53,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,108,121,103,111,110,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,176,1,0,0,112,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,120,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,108,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,36,0,0,0,4,0,0,0,21,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,12,255,255,255,8,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,232,6,0,0,65,82,82,79,87,49'; +const expectedMultiPolygonGeojson = { + type: 'FeatureCollection', + features: [ { type: 'Feature', properties: { - id: 2, - name: 'name2' + id: 1, + name: 'name1' }, geometry: { type: 'MultiPolygon', @@ -127,17 +167,19 @@ const testGeojsonFile3 = { [ [ [0, 0], + [0, 1], [1, 1], - [2, 2], + [1, 0], [0, 0] ] ], [ [ - [0, 0], - [1, 1], [2, 2], - [0, 0] + [2, 3], + [3, 3], + [3, 2], + [2, 2] ] ] ] @@ -146,55 +188,76 @@ const testGeojsonFile3 = { ] }; -test('geojsonUtils.parseGeometryFromArrow', async t => { - // load parquet file using loaders.gl/arrow - const testPointArrowTable = new Uint8Array( - testPointArrowRawBytes.split(',').map(byte => parseInt(byte, 10)) - ); +test.only('geojsonUtils.parseGeometryFromArrow', async t => { + async function testParseFromArrow(t, rawArrowBytes, expectedGeojson) { + // load parquet file using loaders.gl/arrow + const testArrowTable = new Uint8Array(rawArrowBytes.split(',').map(byte => parseInt(byte, 10))); + + const arrowTable = await ArrowLoader.parse(testArrowTable.buffer, { + arrow: {shape: 'arrow-table'} + }); + + // check if the arrow table is loaded correctly + t.equal( + arrowTable.length, + expectedGeojson.features.length, + `arrow table has ${expectedGeojson.features.length} row` + ); + + const colNames = [...Object.keys(expectedGeojson.features[0].properties), 'geometry']; + t.equal(arrowTable.numCols, colNames.length, `arrow table has ${colNames.length} columns`); + + // check fields exist in arrow table schema + arrowTable.schema.fields.map(field => + t.equal(colNames.includes(field.name), true, `arrow table has ${field.name} column`) + ); + + // check metadata exists in arrow table schema + const metadata = arrowTable.schema.metadata; + t.equal(Boolean(metadata.get(ARROW_GEO_METADATA_KEY)), true, 'arrow table has geo metadata'); + + const geoMeta = JSON.parse(metadata.get(ARROW_GEO_METADATA_KEY) || ''); + const geometryColumns = geoMeta.columns; + + // check 'geometry' is in geometryColumns (geometryColumns is a Map object) + t.equal(Boolean(geometryColumns['geometry']), true, 'geometryColumns has geometry column'); + + // get encoding from geometryColumns['geometry'] + const encoding = geometryColumns['geometry'].encoding; + + // check encoding is one of GEOARROW_ENCODINGS + t.ok(encoding.startsWith('geoarrow'), 'encoding is one of GEOARROW_ENCODINGS'); + + // get first geometry from arrow geometry column + const firstArrowGeometry = arrowTable.getColumn('geometry').get(0); + const firstArrowGeometryObject = { + encoding, + data: firstArrowGeometry + }; + + // parse arrow geometry to geojson feature + const firstFeature = parseGeometryFromArrow(firstArrowGeometryObject); + + // check if geometry in firstFeature is equal to the original geometry in expectedPointGeojson + t.deepEqual( + firstFeature.geometry, + expectedGeojson.features[0].geometry, + 'firstFeature.geometry is equal to expectedGeojson.features[0].geometry' + ); + } + + const testCases = [ + [testPointArrowRawBytes, expectedPointGeojson], + [testMultiPointArrowRawBytes, expectedMultiPointGeoJson], + [testLineStringArrowRawBytes, expectedLineStringGeoJson], + [testMultiLineStringArrowRawBytes, expectedMultiLineStringGeoJson], + [testPolygonArrowRawBytes, expectedPolygonGeojson], + [testMultiPolygonArrowRawBytes, expectedMultiPolygonGeojson] + ]; - const arrowTable = await ArrowLoader.parse(testPointArrowTable.buffer, { - arrow: {shape: 'arrow-table'} + testCases.forEach(async testCase => { + await testParseFromArrow(t, testCase[0], testCase[1]); }); - // check if the arrow table is loaded correctly - t.equal(arrowTable.length, 1, 'arrow table has 1 row'); - t.equal(arrowTable.numCols, 3, 'arrow table has 3 columns'); - - // check fields exist in arrow table schema - t.equal(arrowTable.schema.fields[0].name, 'id', 'arrow table has id column'); - t.equal(arrowTable.schema.fields[1].name, 'name', 'arrow table has name column'); - t.equal(arrowTable.schema.fields[2].name, 'geometry', 'arrow table has geometry column'); - - const metadata = arrowTable.schema.metadata; - // check metadata exists in arrow table schema - t.equal(Boolean(metadata.get(ARROW_GEO_METADATA_KEY)), true, 'arrow table has geo metadata'); - - const geoMeta = JSON.parse(metadata.get(ARROW_GEO_METADATA_KEY) || ''); - const geometryColumns = geoMeta.columns; - - // check 'geometry' is in geometryColumns (geometryColumns is a Map object) - t.equal(Boolean(geometryColumns['geometry']), true, 'geometryColumns has geometry column'); - - // get encoding from geometryColumns['geometry'] - const encoding = geometryColumns['geometry'].encoding; - - // check encoding is 'geoarrow.point' - t.equal(encoding, 'geoarrow.point', 'encoding is geoarrow.point'); - - // get first geometry from arrow geometry column - const firstArrowGeometry = arrowTable.getColumn('geometry').get(0); - const firstArrowGeometryObject = { - encoding, - data: firstArrowGeometry - }; - // parse arrow geometry to geojson feature - const firstFeature = parseGeometryFromArrow(firstArrowGeometryObject); - - // check if geometry in firstFeature is equal to the original geometry in expectedPointGeojson - t.deepEqual( - firstFeature.geometry, - expectedPointGeojson.features[0].geometry, - 'firstFeature.geometry is equal to expectedPointGeojson.features[0].geometry' - ); t.end(); }); From 5665729f49ef71c03d4257587cb95f61d2041289 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Mon, 18 Sep 2023 10:42:47 -0700 Subject: [PATCH 09/29] wip Signed-off-by: Xun Li --- src/layers/src/geojson-layer/geojson-utils.ts | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/layers/src/geojson-layer/geojson-utils.ts b/src/layers/src/geojson-layer/geojson-utils.ts index dc5ec77a6c..c7553091b5 100644 --- a/src/layers/src/geojson-layer/geojson-utils.ts +++ b/src/layers/src/geojson-layer/geojson-utils.ts @@ -19,7 +19,7 @@ // THE SOFTWARE. import {ListVector, FloatVector, BinaryVector, Utf8Vector} from 'apache-arrow'; -import wktParser from 'wellknown'; +import Console from 'global/console'; import normalize from '@mapbox/geojson-normalize'; import bbox from '@turf/bbox'; import {parseSync} from '@loaders.gl/core'; @@ -58,22 +58,26 @@ type FeatureTypeMap = { }; /* eslint-enable */ -export function parseGeoJsonRawFeature(rawFeature: unknown): Feature | null { - if (rawFeature && typeof rawFeature === 'object') { - if (typeof rawFeature['type'] === 'string') { - // Support GeoJson feature as object - // probably need to normalize it as well - const normalized = normalize(rawFeature); - if (!normalized || !Array.isArray(normalized.features)) { - // fail to normalize GeoJson - return null; - } +type RawArrowFeature = { + encoding?: string; + data: any; +}; - return normalized.features[0]; - } else if (rawFeature['encoding'].startsWith('geoarrow')) { +export function parseGeoJsonRawFeature(rawFeature: {} | Feature | RawArrowFeature): Feature | null { + if (rawFeature && typeof rawFeature === 'object') { + if ('encoding' in rawFeature && rawFeature.encoding?.startsWith('geoarrow')) { // Support GeoArrow data return parseGeometryFromArrow(rawFeature); } + // Support GeoJson feature as object + // probably need to normalize it as well + const normalized = normalize(rawFeature); + if (!normalized || !Array.isArray(normalized.features)) { + // fail to normalize GeoJson + return null; + } + + return normalized.features[0]; } else if (typeof rawFeature === 'string') { return parseGeometryFromString(rawFeature); } else if (Array.isArray(rawFeature)) { @@ -284,7 +288,6 @@ function arrowPolygonToFeature(arrowPolygon: ListVector): Polygon { ring.push(coords); } polygon.push(ring); - console.log(polygon); } const geometry: Polygon = { type: 'Polygon', @@ -387,7 +390,7 @@ function arrowWkbToFeature(arrowWkb: BinaryVector): Feature | null { * convert Arrow wkt to geojson Geometry */ function arrowWktToFeature(arrowWkt: Utf8Vector): Feature | null { - const geometry = wktParser(arrowWkt.get(0)); + const geometry = parseSync(arrowWkt.get(0) || '', WKTLoader); const normalized = normalize(geometry); if (!normalized || !Array.isArray(normalized.features)) { @@ -405,9 +408,9 @@ function arrowWktToFeature(arrowWkt: Utf8Vector): Feature | null { * @see processArrowData * @returns */ -export function parseGeometryFromArrow(rawData: object): Feature | null { - const encoding = rawData['encoding']; - const data = rawData['data']; +export function parseGeometryFromArrow(rawData: RawArrowFeature): Feature | null { + const encoding = rawData.encoding; + const data = rawData.data; if (!encoding || !data) return null; let geometry; @@ -441,7 +444,7 @@ export function parseGeometryFromArrow(rawData: object): Feature | null { } default: { // encoding is not supported, skip - console.error('GeoArrow encoding not supported'); + Console.error('GeoArrow encoding not supported'); return null; } } From 27c5c024bad43874561ba44685ee0b2c631ae532 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Mon, 18 Sep 2023 11:38:44 -0700 Subject: [PATCH 10/29] add arrow wkb/wkt --- src/layers/src/geojson-layer/geojson-utils.ts | 67 +++++++++---------- src/processors/src/data-processor.ts | 12 +--- src/types/layers.d.ts | 16 +---- test/node/utils/geojson-utils-test.js | 30 ++++++++- 4 files changed, 64 insertions(+), 61 deletions(-) diff --git a/src/layers/src/geojson-layer/geojson-utils.ts b/src/layers/src/geojson-layer/geojson-utils.ts index c7553091b5..9b8b6097f7 100644 --- a/src/layers/src/geojson-layer/geojson-utils.ts +++ b/src/layers/src/geojson-layer/geojson-utils.ts @@ -18,7 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {ListVector, FloatVector, BinaryVector, Utf8Vector} from 'apache-arrow'; +import {ListVector, FloatVector} from 'apache-arrow'; import Console from 'global/console'; import normalize from '@mapbox/geojson-normalize'; import bbox from '@turf/bbox'; @@ -65,7 +65,7 @@ type RawArrowFeature = { export function parseGeoJsonRawFeature(rawFeature: {} | Feature | RawArrowFeature): Feature | null { if (rawFeature && typeof rawFeature === 'object') { - if ('encoding' in rawFeature && rawFeature.encoding?.startsWith('geoarrow')) { + if ('encoding' in rawFeature && rawFeature.encoding) { // Support GeoArrow data return parseGeometryFromArrow(rawFeature); } @@ -172,17 +172,6 @@ export function parseGeometryFromString(geoString: string): Feature | null { } } - // try parse as wkb using loaders.gl WKBLoader - if (!parsedGeo) { - try { - const buffer = Buffer.from(geoString, 'hex'); - const binaryGeo = parseSync(buffer, WKBLoader); - parsedGeo = binaryToGeometry(binaryGeo); - } catch (e) { - return null; - } - } - if (!parsedGeo) { return null; } @@ -247,6 +236,17 @@ export function getGeojsonFeatureTypes(allFeatures: GeojsonDataMaps): FeatureTyp return featureTypes; } +export enum GEOARROW_ENCODINGS { + MULTI_POLYGON = 'geoarrow.multipolygon', + POLYGON = 'geoarrow.polygon', + MULTI_LINESTRING = 'geoarrow.multilinestring', + LINESTRING = 'geoarrow.linestring', + MULTI_POINT = 'geoarrow.multipoint', + POINT = 'geoarrow.point', + WKB = 'wkb', + WKT = 'wkt' +} + /** * convert Arrow MultiPolygon to geojson Feature */ @@ -268,7 +268,7 @@ function arrowMultiPolygonToFeature(arrowMultiPolygon: ListVector): MultiPolygon multiPolygon.push(polygon); } const geometry: MultiPolygon = { - type: 'MultiPolygon', + type: FeatureTypes.MultiPolygon, coordinates: multiPolygon }; return geometry; @@ -290,7 +290,7 @@ function arrowPolygonToFeature(arrowPolygon: ListVector): Polygon { polygon.push(ring); } const geometry: Polygon = { - type: 'Polygon', + type: FeatureTypes.Polygon, coordinates: polygon }; return geometry; @@ -309,7 +309,7 @@ function arrowMultiPointToFeature(arrowMultiPoint: ListVector): MultiPoint { } } const geometry: MultiPoint = { - type: 'MultiPoint', + type: FeatureTypes.MultiPoint, coordinates: multiPoint }; return geometry; @@ -321,7 +321,7 @@ function arrowMultiPointToFeature(arrowMultiPoint: ListVector): MultiPoint { function arrowPointToFeature(arrowPoint: FloatVector): Point { const point: Position = Array.from(arrowPoint.values); const geometry: Point = { - type: 'Point', + type: FeatureTypes.Point, coordinates: point }; return geometry; @@ -345,7 +345,7 @@ function arrowMultiLineStringToFeature(arrowMultiLineString: ListVector): MultiL multiLineString.push(lineString); } const geometry: MultiLineString = { - type: 'MultiLineString', + type: FeatureTypes.MultiLineString, coordinates: multiLineString }; return geometry; @@ -364,7 +364,7 @@ function arrowLineStringToFeature(arrowLineString: ListVector): LineString { } } const geometry: LineString = { - type: 'LineString', + type: FeatureTypes.LineString, coordinates: lineString }; return geometry; @@ -373,8 +373,8 @@ function arrowLineStringToFeature(arrowLineString: ListVector): LineString { /** * convert Arrow wkb to geojson Geometry */ -function arrowWkbToFeature(arrowWkb: BinaryVector): Feature | null { - const binaryGeo = parseSync(arrowWkb.values, WKBLoader); +function arrowWkbToFeature(arrowWkb: Uint8Array): Feature | null { + const binaryGeo = parseSync(arrowWkb, WKBLoader); const geometry = binaryToGeometry(binaryGeo); const normalized = normalize(geometry); @@ -389,8 +389,8 @@ function arrowWkbToFeature(arrowWkb: BinaryVector): Feature | null { /** * convert Arrow wkt to geojson Geometry */ -function arrowWktToFeature(arrowWkt: Utf8Vector): Feature | null { - const geometry = parseSync(arrowWkt.get(0) || '', WKTLoader); +function arrowWktToFeature(arrowWkt: string): Feature | null { + const geometry = parseSync(arrowWkt, WKTLoader); const normalized = normalize(geometry); if (!normalized || !Array.isArray(normalized.features)) { @@ -409,41 +409,38 @@ function arrowWktToFeature(arrowWkt: Utf8Vector): Feature | null { * @returns */ export function parseGeometryFromArrow(rawData: RawArrowFeature): Feature | null { - const encoding = rawData.encoding; + const encoding = rawData.encoding?.toLowerCase(); const data = rawData.data; if (!encoding || !data) return null; let geometry; switch (encoding) { - case 'geoarrow.multipolygon': + case GEOARROW_ENCODINGS.MULTI_POLYGON: geometry = arrowMultiPolygonToFeature(data); break; - case 'geoarrow.polygon': + case GEOARROW_ENCODINGS.POLYGON: geometry = arrowPolygonToFeature(data); break; - case 'geoarrow.multipoint': + case GEOARROW_ENCODINGS.MULTI_POINT: geometry = arrowMultiPointToFeature(data); break; - case 'geoarrow.point': + case GEOARROW_ENCODINGS.POINT: geometry = arrowPointToFeature(data); break; - case 'geoarrow.multilinestring': + case GEOARROW_ENCODINGS.MULTI_LINESTRING: geometry = arrowMultiLineStringToFeature(data); break; - case 'geoarrow.linestring': + case GEOARROW_ENCODINGS.LINESTRING: geometry = arrowLineStringToFeature(data); break; - case 'geoarrow.wkb': { - // convert to wkb + case GEOARROW_ENCODINGS.WKB: { return arrowWkbToFeature(data); } - case 'geoarrow.wkt': { - // convert to wkt + case GEOARROW_ENCODINGS.WKT: { return arrowWktToFeature(data); } default: { - // encoding is not supported, skip Console.error('GeoArrow encoding not supported'); return null; } diff --git a/src/processors/src/data-processor.ts b/src/processors/src/data-processor.ts index ca9246e700..9c71f1a2fa 100644 --- a/src/processors/src/data-processor.ts +++ b/src/processors/src/data-processor.ts @@ -19,7 +19,8 @@ // THE SOFTWARE. import {Table as ApacheArrowTable, Field as ArrowField, ListVector} from 'apache-arrow'; -import {csvParseRows} from 'd3-dsv'; +import { csvParseRows } from 'd3-dsv'; +import {Console} from 'global/console'; import {DATA_TYPES as AnalyzerDATA_TYPES} from 'type-analyzer'; import normalize from '@mapbox/geojson-normalize'; import {ALL_FIELD_TYPES, DATASET_FORMATS, GUIDES_FILE_FORMAT_DOC, ARROW_GEO_METADATA_KEY} from '@kepler.gl/constants'; @@ -37,7 +38,6 @@ import { } from '@kepler.gl/utils'; import {KeplerGlSchema, ParsedDataset, SavedMap, LoadedMap} from '@kepler.gl/schemas'; import {Feature} from '@nebula.gl/edit-modes'; -import {ProcessFileDataContent} from './file-handler'; // if any of these value occurs in csv, parse it to null; // const CSV_NULLS = ['', 'null', 'NULL', 'Null', 'NaN', '/N']; @@ -393,12 +393,6 @@ export function processKeplerglDataset( return Array.isArray(rawData) ? results : results[0]; } -export function processArrowColumnarData(content: ProcessFileDataContent): ProcessorResult | null { - // const { progress, metadata, fileName, length, data, ...columnarData } = content; - // const table = ApacheArrowTable.new(columnarData); - return null; -} - /** * Parse a arrow table with geometry columns and return a dataset * @@ -419,7 +413,7 @@ export function processArrowTable(arrowTable: ApacheArrowTable): ProcessorResult // check if schema_version in geoMeta equals to '0.1.0' const SCHEMA_VERSION = '0.1.0'; if (geoMeta.schema_version !== SCHEMA_VERSION) { - console.error('Schema version not supported'); + Console.error('Apache Arrow schema version not supported'); return null; } // get all geometry columns diff --git a/src/types/layers.d.ts b/src/types/layers.d.ts index 7171e3e993..402a722adc 100644 --- a/src/types/layers.d.ts +++ b/src/types/layers.d.ts @@ -57,20 +57,6 @@ export type LayerWeightConfig = { weightField: VisualChannelField; }; -export enum GEOARROW_ENCODINGS { - MULTI_POLYGON = 'geoarrow.multipolygon', - POLYGON = 'geoarrow.polygon', - MULTI_LINESTRING = 'geoarrow.multilinestring', - LINESTRING = 'geoarrow.linestring', - MULTI_POINT = 'geoarrow.multipoint', - POINT = 'geoarrow.point' -} - -export type GeoArrowFieldMetaData = { - encoding: GEOARROW_ENCODINGS; - crs: string; -}; - export type Field = { analyzerType: string; id?: string; @@ -81,7 +67,7 @@ export type Field = { fieldIdx: number; valueAccessor(v: {index: number}): any; filterProps?: any; - metadata?: object | GeoArrowFieldMetaData; + metadata?: object; displayFormat?: string; }; diff --git a/test/node/utils/geojson-utils-test.js b/test/node/utils/geojson-utils-test.js index 4e2dab6692..737895eead 100644 --- a/test/node/utils/geojson-utils-test.js +++ b/test/node/utils/geojson-utils-test.js @@ -69,7 +69,7 @@ const expectedLineStringGeoJson = { ] }; -// a simple geojson file contains one polygon and one multipolygon +// a simple geojson file contains one polygon const testPolygonArrowRawBytes = '65,82,82,79,87,49,0,0,255,255,255,255,56,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,84,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,96,253,255,255,56,2,0,0,4,0,0,0,43,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,108,121,103,111,110,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,128,1,0,0,64,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,16,0,0,0,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,120,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,104,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,220,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,124,2,0,0,100,2,0,0,64,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,232,250,255,255,28,2,0,0,4,0,0,0,12,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,50,46,48,44,50,46,48,93,125,125,125,0,0,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,72,4,0,0,0,0,0,0,128,1,0,0,0,0,0,0,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,84,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,96,253,255,255,56,2,0,0,4,0,0,0,43,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,108,121,103,111,110,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,128,1,0,0,64,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,16,0,0,0,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,168,6,0,0,65,82,82,79,87,49'; @@ -188,6 +188,30 @@ const expectedMultiPolygonGeojson = { ] }; +// Arrow with one point encoded in WKT +const testPointArrowWKTRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,120,3,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,84,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,5,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,84,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,8,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,48,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,156,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,11,0,0,0,80,79,73,78,84,32,40,48,32,48,41,0,0,0,0,0,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,108,2,0,0,84,2,0,0,48,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,8,251,255,255,12,2,0,0,4,0,0,0,255,1,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,84,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,48,46,48,44,48,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,136,3,0,0,0,0,0,0,16,1,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,84,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,5,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,84,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,216,5,0,0,65,82,82,79,87,49'; + +// Arrow with one point encoded in WKB +const testPointArrowWKBRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,120,3,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,66,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,4,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,66,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,8,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,56,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,156,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,21,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,108,2,0,0,84,2,0,0,48,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,8,251,255,255,12,2,0,0,4,0,0,0,255,1,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,66,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,48,46,48,44,48,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,136,3,0,0,0,0,0,0,16,1,0,0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,66,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,4,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,66,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,216,5,0,0,65,82,82,79,87,49'; + + // a simple geojson file contains one point +const expectedPointGeojsonForWellKnownFormat = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: { + }, + geometry: { + type: 'Point', + coordinates: [0, 0] + } + } + ] +}; + test.only('geojsonUtils.parseGeometryFromArrow', async t => { async function testParseFromArrow(t, rawArrowBytes, expectedGeojson) { // load parquet file using loaders.gl/arrow @@ -252,7 +276,9 @@ test.only('geojsonUtils.parseGeometryFromArrow', async t => { [testLineStringArrowRawBytes, expectedLineStringGeoJson], [testMultiLineStringArrowRawBytes, expectedMultiLineStringGeoJson], [testPolygonArrowRawBytes, expectedPolygonGeojson], - [testMultiPolygonArrowRawBytes, expectedMultiPolygonGeojson] + [testMultiPolygonArrowRawBytes, expectedMultiPolygonGeojson], + [testPointArrowWKTRawBytes, expectedPointGeojsonForWellKnownFormat], + [testPointArrowWKBRawBytes, expectedPointGeojsonForWellKnownFormat] ]; testCases.forEach(async testCase => { From b387a887591ac0b0c6469990ff646ccb13c69b7d Mon Sep 17 00:00:00 2001 From: Xun Li Date: Mon, 18 Sep 2023 11:56:49 -0700 Subject: [PATCH 11/29] clean up --- src/layers/src/geojson-layer/geojson-utils.ts | 253 +---------------- src/utils/src/arrow-utils.ts | 267 ++++++++++++++++++ src/utils/src/index.ts | 1 + ...json-utils-test.js => arrow-utils-test.js} | 25 +- test/node/utils/index.js | 2 +- 5 files changed, 290 insertions(+), 258 deletions(-) create mode 100644 src/utils/src/arrow-utils.ts rename test/node/utils/{geojson-utils-test.js => arrow-utils-test.js} (99%) diff --git a/src/layers/src/geojson-layer/geojson-utils.ts b/src/layers/src/geojson-layer/geojson-utils.ts index 9b8b6097f7..8c2a84ef29 100644 --- a/src/layers/src/geojson-layer/geojson-utils.ts +++ b/src/layers/src/geojson-layer/geojson-utils.ts @@ -18,50 +18,25 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {ListVector, FloatVector} from 'apache-arrow'; -import Console from 'global/console'; import normalize from '@mapbox/geojson-normalize'; import bbox from '@turf/bbox'; import {parseSync} from '@loaders.gl/core'; import {WKBLoader, WKTLoader} from '@loaders.gl/wkt'; import {binaryToGeometry} from '@loaders.gl/gis'; - +import {Feature, BBox} from 'geojson'; import { - Feature, - BBox, - MultiPolygon, - Position, - Polygon, - MultiPoint, - Point, - MultiLineString, - LineString -} from 'geojson'; -import {getSampleData} from '@kepler.gl/utils'; + getSampleData, + parseGeometryFromArrow, + FeatureTypes, + RawArrowFeature +} from '@kepler.gl/utils'; export type GetFeature = (d: any) => Feature; export type GeojsonDataMaps = Array; -/* eslint-disable */ -// TODO: Re-enable eslint when we upgrade to handle enums and type maps -export enum FeatureTypes { - Point = 'Point', - MultiPoint = 'MultiPoint', - LineString = 'LineString', - MultiLineString = 'MultiLineString', - Polygon = 'Polygon', - MultiPolygon = 'MultiPolygon' -} - type FeatureTypeMap = { [key in FeatureTypes]: boolean; }; -/* eslint-enable */ - -type RawArrowFeature = { - encoding?: string; - data: any; -}; export function parseGeoJsonRawFeature(rawFeature: {} | Feature | RawArrowFeature): Feature | null { if (rawFeature && typeof rawFeature === 'object') { @@ -235,219 +210,3 @@ export function getGeojsonFeatureTypes(allFeatures: GeojsonDataMaps): FeatureTyp return featureTypes; } - -export enum GEOARROW_ENCODINGS { - MULTI_POLYGON = 'geoarrow.multipolygon', - POLYGON = 'geoarrow.polygon', - MULTI_LINESTRING = 'geoarrow.multilinestring', - LINESTRING = 'geoarrow.linestring', - MULTI_POINT = 'geoarrow.multipoint', - POINT = 'geoarrow.point', - WKB = 'wkb', - WKT = 'wkt' -} - -/** - * convert Arrow MultiPolygon to geojson Feature - */ -function arrowMultiPolygonToFeature(arrowMultiPolygon: ListVector): MultiPolygon { - const multiPolygon: Position[][][] = []; - for (let m = 0; m < arrowMultiPolygon.length; m++) { - const arrowPolygon = arrowMultiPolygon.get(m); - const polygon: Position[][] = []; - for (let i = 0; arrowPolygon && i < arrowPolygon?.length; i++) { - const arrowRing = arrowPolygon?.get(i); - const ring: Position[] = []; - for (let j = 0; arrowRing && j < arrowRing.length; j++) { - const arrowCoord = arrowRing.get(j); - const coord: Position = Array.from(arrowCoord); - ring.push(coord); - } - polygon.push(ring); - } - multiPolygon.push(polygon); - } - const geometry: MultiPolygon = { - type: FeatureTypes.MultiPolygon, - coordinates: multiPolygon - }; - return geometry; -} - -/** - * convert Arrow Polygon to geojson Feature - */ -function arrowPolygonToFeature(arrowPolygon: ListVector): Polygon { - const polygon: Position[][] = []; - for (let i = 0; arrowPolygon && i < arrowPolygon.length; i++) { - const arrowRing = arrowPolygon.get(i); - const ring: Position[] = []; - for (let j = 0; arrowRing && j < arrowRing.length; j++) { - const arrowCoord = arrowRing.get(j); - const coords: Position = Array.from(arrowCoord); - ring.push(coords); - } - polygon.push(ring); - } - const geometry: Polygon = { - type: FeatureTypes.Polygon, - coordinates: polygon - }; - return geometry; -} - -/** - * convert Arrow MultiPoint to geojson MultiPoint - */ -function arrowMultiPointToFeature(arrowMultiPoint: ListVector): MultiPoint { - const multiPoint: Position[] = []; - for (let i = 0; arrowMultiPoint && i < arrowMultiPoint.length; i++) { - const arrowPoint = arrowMultiPoint.get(i); - if (arrowPoint) { - const coord: Position = Array.from(arrowPoint); - multiPoint.push(coord); - } - } - const geometry: MultiPoint = { - type: FeatureTypes.MultiPoint, - coordinates: multiPoint - }; - return geometry; -} - -/** - * convert Arrow Point to geojson Point - */ -function arrowPointToFeature(arrowPoint: FloatVector): Point { - const point: Position = Array.from(arrowPoint.values); - const geometry: Point = { - type: FeatureTypes.Point, - coordinates: point - }; - return geometry; -} - -/** - * convert Arrow MultiLineString to geojson MultiLineString - */ -function arrowMultiLineStringToFeature(arrowMultiLineString: ListVector): MultiLineString { - const multiLineString: Position[][] = []; - for (let i = 0; arrowMultiLineString && i < arrowMultiLineString.length; i++) { - const arrowLineString = arrowMultiLineString.get(i); - const lineString: Position[] = []; - for (let j = 0; arrowLineString && j < arrowLineString.length; j++) { - const arrowCoord = arrowLineString.get(j); - if (arrowCoord) { - const coords: Position = Array.from(arrowCoord); - lineString.push(coords); - } - } - multiLineString.push(lineString); - } - const geometry: MultiLineString = { - type: FeatureTypes.MultiLineString, - coordinates: multiLineString - }; - return geometry; -} - -/** - * convert Arrow LineString to geojson LineString - */ -function arrowLineStringToFeature(arrowLineString: ListVector): LineString { - const lineString: Position[] = []; - for (let i = 0; arrowLineString && i < arrowLineString.length; i++) { - const arrowCoord = arrowLineString.get(i); - if (arrowCoord) { - const coords: Position = Array.from(arrowCoord); - lineString.push(coords); - } - } - const geometry: LineString = { - type: FeatureTypes.LineString, - coordinates: lineString - }; - return geometry; -} - -/** - * convert Arrow wkb to geojson Geometry - */ -function arrowWkbToFeature(arrowWkb: Uint8Array): Feature | null { - const binaryGeo = parseSync(arrowWkb, WKBLoader); - const geometry = binaryToGeometry(binaryGeo); - const normalized = normalize(geometry); - - if (!normalized || !Array.isArray(normalized.features)) { - // fail to normalize geojson - return null; - } - - return normalized.features[0]; -} - -/** - * convert Arrow wkt to geojson Geometry - */ -function arrowWktToFeature(arrowWkt: string): Feature | null { - const geometry = parseSync(arrowWkt, WKTLoader); - const normalized = normalize(geometry); - - if (!normalized || !Array.isArray(normalized.features)) { - // fail to normalize geojson - return null; - } - - return normalized.features[0]; -} - -/** - * parse geometry from arrow data that is returned from processArrowData() - * - * @param rawData the raw geometry data returned from processArrowData, which is an object with two properties: encoding and data - * @see processArrowData - * @returns - */ -export function parseGeometryFromArrow(rawData: RawArrowFeature): Feature | null { - const encoding = rawData.encoding?.toLowerCase(); - const data = rawData.data; - if (!encoding || !data) return null; - - let geometry; - - switch (encoding) { - case GEOARROW_ENCODINGS.MULTI_POLYGON: - geometry = arrowMultiPolygonToFeature(data); - break; - case GEOARROW_ENCODINGS.POLYGON: - geometry = arrowPolygonToFeature(data); - break; - case GEOARROW_ENCODINGS.MULTI_POINT: - geometry = arrowMultiPointToFeature(data); - break; - case GEOARROW_ENCODINGS.POINT: - geometry = arrowPointToFeature(data); - break; - case GEOARROW_ENCODINGS.MULTI_LINESTRING: - geometry = arrowMultiLineStringToFeature(data); - break; - case GEOARROW_ENCODINGS.LINESTRING: - geometry = arrowLineStringToFeature(data); - break; - case GEOARROW_ENCODINGS.WKB: { - return arrowWkbToFeature(data); - } - case GEOARROW_ENCODINGS.WKT: { - return arrowWktToFeature(data); - } - default: { - Console.error('GeoArrow encoding not supported'); - return null; - } - } - return { - type: 'Feature', - geometry, - properties: {} - }; -} diff --git a/src/utils/src/arrow-utils.ts b/src/utils/src/arrow-utils.ts new file mode 100644 index 0000000000..48c996e96d --- /dev/null +++ b/src/utils/src/arrow-utils.ts @@ -0,0 +1,267 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import {ListVector, FloatVector} from 'apache-arrow'; +import Console from 'global/console'; +import normalize from '@mapbox/geojson-normalize'; +import {parseSync} from '@loaders.gl/core'; +import {WKBLoader, WKTLoader} from '@loaders.gl/wkt'; +import {binaryToGeometry} from '@loaders.gl/gis'; + +import { + Feature, + MultiPolygon, + Position, + Polygon, + MultiPoint, + Point, + MultiLineString, + LineString +} from 'geojson'; + +export enum FeatureTypes { + Point = 'Point', + MultiPoint = 'MultiPoint', + LineString = 'LineString', + MultiLineString = 'MultiLineString', + Polygon = 'Polygon', + MultiPolygon = 'MultiPolygon' +} + +export type RawArrowFeature = { + encoding?: string; + data: any; +}; + +export enum GEOARROW_ENCODINGS { + MULTI_POLYGON = 'geoarrow.multipolygon', + POLYGON = 'geoarrow.polygon', + MULTI_LINESTRING = 'geoarrow.multilinestring', + LINESTRING = 'geoarrow.linestring', + MULTI_POINT = 'geoarrow.multipoint', + POINT = 'geoarrow.point', + WKB = 'wkb', + WKT = 'wkt' +} + +/** + * convert Arrow MultiPolygon to geojson Feature + */ +function arrowMultiPolygonToFeature(arrowMultiPolygon: ListVector): MultiPolygon { + const multiPolygon: Position[][][] = []; + for (let m = 0; m < arrowMultiPolygon.length; m++) { + const arrowPolygon = arrowMultiPolygon.get(m); + const polygon: Position[][] = []; + for (let i = 0; arrowPolygon && i < arrowPolygon?.length; i++) { + const arrowRing = arrowPolygon?.get(i); + const ring: Position[] = []; + for (let j = 0; arrowRing && j < arrowRing.length; j++) { + const arrowCoord = arrowRing.get(j); + const coord: Position = Array.from(arrowCoord); + ring.push(coord); + } + polygon.push(ring); + } + multiPolygon.push(polygon); + } + const geometry: MultiPolygon = { + type: FeatureTypes.MultiPolygon, + coordinates: multiPolygon + }; + return geometry; +} + +/** + * convert Arrow Polygon to geojson Feature + */ +function arrowPolygonToFeature(arrowPolygon: ListVector): Polygon { + const polygon: Position[][] = []; + for (let i = 0; arrowPolygon && i < arrowPolygon.length; i++) { + const arrowRing = arrowPolygon.get(i); + const ring: Position[] = []; + for (let j = 0; arrowRing && j < arrowRing.length; j++) { + const arrowCoord = arrowRing.get(j); + const coords: Position = Array.from(arrowCoord); + ring.push(coords); + } + polygon.push(ring); + } + const geometry: Polygon = { + type: FeatureTypes.Polygon, + coordinates: polygon + }; + return geometry; +} + +/** + * convert Arrow MultiPoint to geojson MultiPoint + */ +function arrowMultiPointToFeature(arrowMultiPoint: ListVector): MultiPoint { + const multiPoint: Position[] = []; + for (let i = 0; arrowMultiPoint && i < arrowMultiPoint.length; i++) { + const arrowPoint = arrowMultiPoint.get(i); + if (arrowPoint) { + const coord: Position = Array.from(arrowPoint); + multiPoint.push(coord); + } + } + const geometry: MultiPoint = { + type: FeatureTypes.MultiPoint, + coordinates: multiPoint + }; + return geometry; +} + +/** + * convert Arrow Point to geojson Point + */ +function arrowPointToFeature(arrowPoint: FloatVector): Point { + const point: Position = Array.from(arrowPoint.values); + const geometry: Point = { + type: FeatureTypes.Point, + coordinates: point + }; + return geometry; +} + +/** + * convert Arrow MultiLineString to geojson MultiLineString + */ +function arrowMultiLineStringToFeature(arrowMultiLineString: ListVector): MultiLineString { + const multiLineString: Position[][] = []; + for (let i = 0; arrowMultiLineString && i < arrowMultiLineString.length; i++) { + const arrowLineString = arrowMultiLineString.get(i); + const lineString: Position[] = []; + for (let j = 0; arrowLineString && j < arrowLineString.length; j++) { + const arrowCoord = arrowLineString.get(j); + if (arrowCoord) { + const coords: Position = Array.from(arrowCoord); + lineString.push(coords); + } + } + multiLineString.push(lineString); + } + const geometry: MultiLineString = { + type: FeatureTypes.MultiLineString, + coordinates: multiLineString + }; + return geometry; +} + +/** + * convert Arrow LineString to geojson LineString + */ +function arrowLineStringToFeature(arrowLineString: ListVector): LineString { + const lineString: Position[] = []; + for (let i = 0; arrowLineString && i < arrowLineString.length; i++) { + const arrowCoord = arrowLineString.get(i); + if (arrowCoord) { + const coords: Position = Array.from(arrowCoord); + lineString.push(coords); + } + } + const geometry: LineString = { + type: FeatureTypes.LineString, + coordinates: lineString + }; + return geometry; +} + +/** + * convert Arrow wkb to geojson Geometry + */ +function arrowWkbToFeature(arrowWkb: Uint8Array): Feature | null { + const binaryGeo = parseSync(arrowWkb, WKBLoader); + const geometry = binaryToGeometry(binaryGeo); + const normalized = normalize(geometry); + + if (!normalized || !Array.isArray(normalized.features)) { + // fail to normalize geojson + return null; + } + + return normalized.features[0]; +} + +/** + * convert Arrow wkt to geojson Geometry + */ +function arrowWktToFeature(arrowWkt: string): Feature | null { + const geometry = parseSync(arrowWkt, WKTLoader); + const normalized = normalize(geometry); + + if (!normalized || !Array.isArray(normalized.features)) { + // fail to normalize geojson + return null; + } + + return normalized.features[0]; +} + +/** + * parse geometry from arrow data that is returned from processArrowData() + * + * @param rawData the raw geometry data returned from processArrowData, which is an object with two properties: encoding and data + * @see processArrowData + * @returns + */ +export function parseGeometryFromArrow(rawData: RawArrowFeature): Feature | null { + const encoding = rawData.encoding?.toLowerCase(); + const data = rawData.data; + if (!encoding || !data) return null; + + let geometry; + + switch (encoding) { + case GEOARROW_ENCODINGS.MULTI_POLYGON: + geometry = arrowMultiPolygonToFeature(data); + break; + case GEOARROW_ENCODINGS.POLYGON: + geometry = arrowPolygonToFeature(data); + break; + case GEOARROW_ENCODINGS.MULTI_POINT: + geometry = arrowMultiPointToFeature(data); + break; + case GEOARROW_ENCODINGS.POINT: + geometry = arrowPointToFeature(data); + break; + case GEOARROW_ENCODINGS.MULTI_LINESTRING: + geometry = arrowMultiLineStringToFeature(data); + break; + case GEOARROW_ENCODINGS.LINESTRING: + geometry = arrowLineStringToFeature(data); + break; + case GEOARROW_ENCODINGS.WKB: { + return arrowWkbToFeature(data); + } + case GEOARROW_ENCODINGS.WKT: { + return arrowWktToFeature(data); + } + default: { + Console.error('GeoArrow encoding not supported'); + return null; + } + } + return { + type: 'Feature', + geometry, + properties: {} + }; +} diff --git a/src/utils/src/index.ts b/src/utils/src/index.ts index a8931864cf..e43a19c4d7 100644 --- a/src/utils/src/index.ts +++ b/src/utils/src/index.ts @@ -123,3 +123,4 @@ export {DataRow} from './data-row'; export type {Centroid} from './h3-utils'; export {getCentroid, idToPolygonGeo, h3IsValid, getHexFields} from './h3-utils'; +export * from './arrow-utils'; diff --git a/test/node/utils/geojson-utils-test.js b/test/node/utils/arrow-utils-test.js similarity index 99% rename from test/node/utils/geojson-utils-test.js rename to test/node/utils/arrow-utils-test.js index 737895eead..7fda9bc4e4 100644 --- a/test/node/utils/geojson-utils-test.js +++ b/test/node/utils/arrow-utils-test.js @@ -22,13 +22,13 @@ import test from 'tape'; import {ArrowLoader} from '@loaders.gl/arrow'; import {ARROW_GEO_METADATA_KEY} from '@kepler.gl/constants'; -import {parseGeometryFromArrow} from '@kepler.gl/layers'; +import {parseGeometryFromArrow, GEOARROW_ENCODINGS} from '@kepler.gl/utils'; -// an arrow file converted from the geojson file below in arraybuffer format +// an arrow file converted from the geojson below in arraybuffer format const testPointArrowRawBytes = '65,82,82,79,87,49,0,0,255,255,255,255,216,3,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,80,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,100,253,255,255,52,2,0,0,4,0,0,0,39,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,36,1,0,0,228,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,16,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,124,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,28,0,0,0,4,0,0,0,14,0,0,0,103,101,111,97,114,114,111,119,46,112,111,105,110,116,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,24,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,40,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,156,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,255,255,255,255,0,0,0,0,24,0,0,0,0,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,96,2,0,0,60,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,240,250,255,255,24,2,0,0,4,0,0,0,10,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,49,46,48,44,49,46,48,93,125,125,125,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,232,3,0,0,0,0,0,0,32,1,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,80,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,100,253,255,255,52,2,0,0,4,0,0,0,39,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,36,1,0,0,228,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,16,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,124,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,28,0,0,0,4,0,0,0,14,0,0,0,103,101,111,97,114,114,111,119,46,112,111,105,110,116,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,72,6,0,0,65,82,82,79,87,49'; -// a simple geojson file contains one point +// a simple geojson contains one point const expectedPointGeojson = { type: 'FeatureCollection', features: [ @@ -46,7 +46,7 @@ const expectedPointGeojson = { ] }; -// a simple geojson file contains one linestring +// a simple geojson contains one linestring const testLineStringArrowRawBytes = '65,82,82,79,87,49,0,0,255,255,255,255,24,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,0,0,0,0,255,255,255,255,72,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,64,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,188,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,100,2,0,0,64,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,228,250,255,255,28,2,0,0,4,0,0,0,15,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,49,46,48,44,49,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,40,4,0,0,0,0,0,0,80,1,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,128,6,0,0,65,82,82,79,87,49'; const expectedLineStringGeoJson = { @@ -69,7 +69,7 @@ const expectedLineStringGeoJson = { ] }; -// a simple geojson file contains one polygon +// a simple geojson contains one polygon const testPolygonArrowRawBytes = '65,82,82,79,87,49,0,0,255,255,255,255,56,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,84,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,96,253,255,255,56,2,0,0,4,0,0,0,43,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,108,121,103,111,110,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,128,1,0,0,64,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,16,0,0,0,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,120,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,104,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,220,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,124,2,0,0,100,2,0,0,64,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,232,250,255,255,28,2,0,0,4,0,0,0,12,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,50,46,48,44,50,46,48,93,125,125,125,0,0,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,72,4,0,0,0,0,0,0,128,1,0,0,0,0,0,0,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,84,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,96,253,255,255,56,2,0,0,4,0,0,0,43,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,108,121,103,111,110,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,128,1,0,0,64,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,16,0,0,0,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,168,6,0,0,65,82,82,79,87,49'; @@ -97,7 +97,7 @@ const expectedPolygonGeojson = { ] }; -// a simple geojson file contains one MultiPoint +// a simple geojson contains one MultiPoint const testMultiPointArrowRawBytes = '65,82,82,79,87,49,0,0,255,255,255,255,24,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,105,110,116,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,0,0,0,0,255,255,255,255,72,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,64,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,188,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,100,2,0,0,64,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,228,250,255,255,28,2,0,0,4,0,0,0,15,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,50,46,48,44,50,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,40,4,0,0,0,0,0,0,80,1,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,105,110,116,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,128,6,0,0,65,82,82,79,87,49'; const expectedMultiPointGeoJson = { @@ -120,7 +120,7 @@ const expectedMultiPointGeoJson = { ] }; -// a simple geojson file contains one MultiLinestring +// a simple geojson contains one MultiLinestring const testMultiLineStringArrowRawBytes = '65,82,82,79,87,49,0,0,255,255,255,255,80,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,100,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,80,253,255,255,72,2,0,0,4,0,0,0,59,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,136,1,0,0,72,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,124,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,112,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,40,0,0,0,4,0,0,0,24,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,120,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,112,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,220,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,16,64,0,0,0,0,0,0,16,64,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,132,2,0,0,108,2,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,208,250,255,255,36,2,0,0,4,0,0,0,20,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,52,46,48,44,52,46,48,93,125,125,125,0,0,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,96,4,0,0,0,0,0,0,128,1,0,0,0,0,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,100,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,80,253,255,255,72,2,0,0,4,0,0,0,59,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,136,1,0,0,72,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,124,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,112,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,40,0,0,0,4,0,0,0,24,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,200,6,0,0,65,82,82,79,87,49'; const expectedMultiLineStringGeoJson = { @@ -149,7 +149,7 @@ const expectedMultiLineStringGeoJson = { ] }; -// a simple geojson file contains one MultiPolygon +// a simple geojson contains one MultiPolygon const testMultiPolygonArrowRawBytes = '65,82,82,79,87,49,0,0,255,255,255,255,120,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,96,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,84,253,255,255,68,2,0,0,4,0,0,0,53,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,108,121,103,111,110,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,176,1,0,0,112,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,120,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,108,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,36,0,0,0,4,0,0,0,21,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,12,255,255,255,8,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,0,0,0,0,255,255,255,255,168,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,224,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,252,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,160,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,255,255,255,255,0,0,0,0,24,0,0,0,0,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,124,2,0,0,104,2,0,0,68,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,220,250,255,255,32,2,0,0,4,0,0,0,17,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,51,46,48,44,51,46,48,93,125,125,125,0,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,136,4,0,0,0,0,0,0,176,1,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,96,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,84,253,255,255,68,2,0,0,4,0,0,0,53,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,108,121,103,111,110,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,176,1,0,0,112,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,120,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,108,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,36,0,0,0,4,0,0,0,21,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,12,255,255,255,8,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,232,6,0,0,65,82,82,79,87,49'; const expectedMultiPolygonGeojson = { @@ -196,13 +196,15 @@ const testPointArrowWKTRawBytes = const testPointArrowWKBRawBytes = '65,82,82,79,87,49,0,0,255,255,255,255,120,3,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,66,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,4,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,66,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,8,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,56,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,156,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,21,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,108,2,0,0,84,2,0,0,48,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,8,251,255,255,12,2,0,0,4,0,0,0,255,1,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,66,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,48,46,48,44,48,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,136,3,0,0,0,0,0,0,16,1,0,0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,66,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,4,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,66,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,216,5,0,0,65,82,82,79,87,49'; - // a simple geojson file contains one point + // a simple geojson contains one point const expectedPointGeojsonForWellKnownFormat = { type: 'FeatureCollection', features: [ { type: 'Feature', properties: { + id: 1, + name: 'name1' }, geometry: { type: 'Point', @@ -250,7 +252,10 @@ test.only('geojsonUtils.parseGeometryFromArrow', async t => { const encoding = geometryColumns['geometry'].encoding; // check encoding is one of GEOARROW_ENCODINGS - t.ok(encoding.startsWith('geoarrow'), 'encoding is one of GEOARROW_ENCODINGS'); + t.ok( + Object.values(GEOJSON_ENCODINGS).includes(encoding), + 'encoding is one of GEOARROW_ENCODINGS' + ); // get first geometry from arrow geometry column const firstArrowGeometry = arrowTable.getColumn('geometry').get(0); diff --git a/test/node/utils/index.js b/test/node/utils/index.js index 8060c07650..4b825b2473 100644 --- a/test/node/utils/index.js +++ b/test/node/utils/index.js @@ -40,4 +40,4 @@ import './kepler-gl-utils-test'; import './timeline-test'; import './composer-helpers-test'; import './dom-to-image'; -import './geojson-utils-test'; +import './arrow-utils-test'; From 87782275003cc2edbb78f1aa735b109de2f44acb Mon Sep 17 00:00:00 2001 From: Xun Li Date: Mon, 18 Sep 2023 12:05:31 -0700 Subject: [PATCH 12/29] reorg test files --- test/fixtures/test-arrow-data.js | 213 ++++++++++++++++++++++++++++ test/node/utils/arrow-utils-test.js | 210 +++------------------------ 2 files changed, 232 insertions(+), 191 deletions(-) create mode 100644 test/fixtures/test-arrow-data.js diff --git a/test/fixtures/test-arrow-data.js b/test/fixtures/test-arrow-data.js new file mode 100644 index 0000000000..f0a3f1faea --- /dev/null +++ b/test/fixtures/test-arrow-data.js @@ -0,0 +1,213 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// an arrow file converted from the geojson below in arraybuffer format +export const testPointArrowRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,216,3,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,80,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,100,253,255,255,52,2,0,0,4,0,0,0,39,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,36,1,0,0,228,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,16,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,124,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,28,0,0,0,4,0,0,0,14,0,0,0,103,101,111,97,114,114,111,119,46,112,111,105,110,116,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,24,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,40,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,156,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,255,255,255,255,0,0,0,0,24,0,0,0,0,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,96,2,0,0,60,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,240,250,255,255,24,2,0,0,4,0,0,0,10,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,49,46,48,44,49,46,48,93,125,125,125,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,232,3,0,0,0,0,0,0,32,1,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,80,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,100,253,255,255,52,2,0,0,4,0,0,0,39,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,36,1,0,0,228,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,16,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,124,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,28,0,0,0,4,0,0,0,14,0,0,0,103,101,111,97,114,114,111,119,46,112,111,105,110,116,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,72,6,0,0,65,82,82,79,87,49'; + +// a simple geojson contains one point +export const expectedPointGeojson = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: { + id: 2, + name: 'name2' + }, + geometry: { + type: 'Point', + coordinates: [1, 1] + } + } + ] +}; + +export const testLineStringArrowRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,24,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,0,0,0,0,255,255,255,255,72,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,64,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,188,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,100,2,0,0,64,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,228,250,255,255,28,2,0,0,4,0,0,0,15,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,49,46,48,44,49,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,40,4,0,0,0,0,0,0,80,1,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,128,6,0,0,65,82,82,79,87,49'; + +// a simple geojson contains one linestring +export const expectedLineStringGeoJson = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: { + id: 1, + name: 'name1' + }, + geometry: { + type: 'LineString', + coordinates: [ + [0, 0], + [1, 1] + ] + } + } + ] +}; + +export const testPolygonArrowRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,56,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,84,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,96,253,255,255,56,2,0,0,4,0,0,0,43,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,108,121,103,111,110,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,128,1,0,0,64,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,16,0,0,0,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,120,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,104,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,220,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,124,2,0,0,100,2,0,0,64,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,232,250,255,255,28,2,0,0,4,0,0,0,12,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,50,46,48,44,50,46,48,93,125,125,125,0,0,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,72,4,0,0,0,0,0,0,128,1,0,0,0,0,0,0,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,84,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,96,253,255,255,56,2,0,0,4,0,0,0,43,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,108,121,103,111,110,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,128,1,0,0,64,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,16,0,0,0,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,168,6,0,0,65,82,82,79,87,49'; + +// a simple geojson contains one polygon +export const expectedPolygonGeojson = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: { + id: 1, + name: 'name1' + }, + geometry: { + type: 'Polygon', + coordinates: [ + [ + [0, 0], + [1, 1], + [2, 2], + [0, 0] + ] + ] + } + } + ] +}; + +export const testMultiPointArrowRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,24,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,105,110,116,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,0,0,0,0,255,255,255,255,72,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,64,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,188,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,100,2,0,0,64,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,228,250,255,255,28,2,0,0,4,0,0,0,15,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,50,46,48,44,50,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,40,4,0,0,0,0,0,0,80,1,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,105,110,116,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,128,6,0,0,65,82,82,79,87,49'; + +// a simple geojson contains one MultiPoint +export const expectedMultiPointGeoJson = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: { + id: 2, + name: 'name2' + }, + geometry: { + type: 'MultiPoint', + coordinates: [ + [1, 1], + [2, 2] + ] + } + } + ] +}; + +export const testMultiLineStringArrowRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,80,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,100,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,80,253,255,255,72,2,0,0,4,0,0,0,59,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,136,1,0,0,72,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,124,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,112,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,40,0,0,0,4,0,0,0,24,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,120,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,112,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,220,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,16,64,0,0,0,0,0,0,16,64,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,132,2,0,0,108,2,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,208,250,255,255,36,2,0,0,4,0,0,0,20,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,52,46,48,44,52,46,48,93,125,125,125,0,0,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,96,4,0,0,0,0,0,0,128,1,0,0,0,0,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,100,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,80,253,255,255,72,2,0,0,4,0,0,0,59,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,136,1,0,0,72,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,124,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,112,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,40,0,0,0,4,0,0,0,24,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,200,6,0,0,65,82,82,79,87,49'; + +// a simple geojson contains one MultiLinestring +export const expectedMultiLineStringGeoJson = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: { + id: 2, + name: 'name2' + }, + geometry: { + type: 'MultiLineString', + coordinates: [ + [ + [1, 1], + [2, 2] + ], + [ + [3, 3], + [4, 4] + ] + ] + } + } + ] +}; + +export const testMultiPolygonArrowRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,120,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,96,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,84,253,255,255,68,2,0,0,4,0,0,0,53,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,108,121,103,111,110,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,176,1,0,0,112,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,120,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,108,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,36,0,0,0,4,0,0,0,21,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,12,255,255,255,8,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,0,0,0,0,255,255,255,255,168,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,224,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,252,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,160,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,255,255,255,255,0,0,0,0,24,0,0,0,0,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,124,2,0,0,104,2,0,0,68,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,220,250,255,255,32,2,0,0,4,0,0,0,17,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,51,46,48,44,51,46,48,93,125,125,125,0,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,136,4,0,0,0,0,0,0,176,1,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,96,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,84,253,255,255,68,2,0,0,4,0,0,0,53,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,108,121,103,111,110,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,176,1,0,0,112,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,120,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,108,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,36,0,0,0,4,0,0,0,21,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,12,255,255,255,8,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,232,6,0,0,65,82,82,79,87,49'; + +// a simple geojson contains one MultiPolygon +export const expectedMultiPolygonGeojson = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: { + id: 1, + name: 'name1' + }, + geometry: { + type: 'MultiPolygon', + coordinates: [ + [ + [ + [0, 0], + [0, 1], + [1, 1], + [1, 0], + [0, 0] + ] + ], + [ + [ + [2, 2], + [2, 3], + [3, 3], + [3, 2], + [2, 2] + ] + ] + ] + } + } + ] +}; + +// Arrow with one point encoded in WKT +export const testPointArrowWKTRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,120,3,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,84,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,5,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,84,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,8,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,48,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,156,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,11,0,0,0,80,79,73,78,84,32,40,48,32,48,41,0,0,0,0,0,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,108,2,0,0,84,2,0,0,48,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,8,251,255,255,12,2,0,0,4,0,0,0,255,1,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,84,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,48,46,48,44,48,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,136,3,0,0,0,0,0,0,16,1,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,84,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,5,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,84,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,216,5,0,0,65,82,82,79,87,49'; + +// Arrow with one point encoded in WKB +export const testPointArrowWKBRawBytes = + '65,82,82,79,87,49,0,0,255,255,255,255,120,3,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,66,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,4,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,66,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,8,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,56,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,156,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,21,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,108,2,0,0,84,2,0,0,48,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,8,251,255,255,12,2,0,0,4,0,0,0,255,1,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,66,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,48,46,48,44,48,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,136,3,0,0,0,0,0,0,16,1,0,0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,66,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,4,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,66,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,216,5,0,0,65,82,82,79,87,49'; + +// a simple geojson contains one point for arrow WKT/WKB test +export const expectedPointGeojsonForWellKnownFormat = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + properties: { + id: 1, + name: 'name1' + }, + geometry: { + type: 'Point', + coordinates: [0, 0] + } + } + ] +}; diff --git a/test/node/utils/arrow-utils-test.js b/test/node/utils/arrow-utils-test.js index 7fda9bc4e4..2f2da841b9 100644 --- a/test/node/utils/arrow-utils-test.js +++ b/test/node/utils/arrow-utils-test.js @@ -24,197 +24,25 @@ import {ArrowLoader} from '@loaders.gl/arrow'; import {ARROW_GEO_METADATA_KEY} from '@kepler.gl/constants'; import {parseGeometryFromArrow, GEOARROW_ENCODINGS} from '@kepler.gl/utils'; -// an arrow file converted from the geojson below in arraybuffer format -const testPointArrowRawBytes = - '65,82,82,79,87,49,0,0,255,255,255,255,216,3,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,80,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,100,253,255,255,52,2,0,0,4,0,0,0,39,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,36,1,0,0,228,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,16,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,124,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,28,0,0,0,4,0,0,0,14,0,0,0,103,101,111,97,114,114,111,119,46,112,111,105,110,116,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,24,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,40,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,156,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,255,255,255,255,0,0,0,0,24,0,0,0,0,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,96,2,0,0,60,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,240,250,255,255,24,2,0,0,4,0,0,0,10,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,49,46,48,44,49,46,48,93,125,125,125,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,232,3,0,0,0,0,0,0,32,1,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,80,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,100,253,255,255,52,2,0,0,4,0,0,0,39,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,36,1,0,0,228,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,16,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,124,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,28,0,0,0,4,0,0,0,14,0,0,0,103,101,111,97,114,114,111,119,46,112,111,105,110,116,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,72,6,0,0,65,82,82,79,87,49'; - -// a simple geojson contains one point -const expectedPointGeojson = { - type: 'FeatureCollection', - features: [ - { - type: 'Feature', - properties: { - id: 2, - name: 'name2' - }, - geometry: { - type: 'Point', - coordinates: [1, 1] - } - } - ] -}; - -// a simple geojson contains one linestring -const testLineStringArrowRawBytes = - '65,82,82,79,87,49,0,0,255,255,255,255,24,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,0,0,0,0,255,255,255,255,72,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,64,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,188,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,100,2,0,0,64,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,228,250,255,255,28,2,0,0,4,0,0,0,15,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,49,46,48,44,49,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,40,4,0,0,0,0,0,0,80,1,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,108,105,110,101,115,116,114,105,110,103,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,128,6,0,0,65,82,82,79,87,49'; -const expectedLineStringGeoJson = { - type: 'FeatureCollection', - features: [ - { - type: 'Feature', - properties: { - id: 1, - name: 'name1' - }, - geometry: { - type: 'LineString', - coordinates: [ - [0, 0], - [1, 1] - ] - } - } - ] -}; - -// a simple geojson contains one polygon -const testPolygonArrowRawBytes = - '65,82,82,79,87,49,0,0,255,255,255,255,56,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,84,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,96,253,255,255,56,2,0,0,4,0,0,0,43,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,108,121,103,111,110,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,128,1,0,0,64,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,16,0,0,0,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,120,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,104,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,220,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,124,2,0,0,100,2,0,0,64,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,232,250,255,255,28,2,0,0,4,0,0,0,12,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,50,46,48,44,50,46,48,93,125,125,125,0,0,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,72,4,0,0,0,0,0,0,128,1,0,0,0,0,0,0,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,84,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,96,253,255,255,56,2,0,0,4,0,0,0,43,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,108,121,103,111,110,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,128,1,0,0,64,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,16,0,0,0,103,101,111,97,114,114,111,119,46,112,111,108,121,103,111,110,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,168,6,0,0,65,82,82,79,87,49'; - -const expectedPolygonGeojson = { - type: 'FeatureCollection', - features: [ - { - type: 'Feature', - properties: { - id: 1, - name: 'name1' - }, - geometry: { - type: 'Polygon', - coordinates: [ - [ - [0, 0], - [1, 1], - [2, 2], - [0, 0] - ] - ] - } - } - ] -}; - -// a simple geojson contains one MultiPoint -const testMultiPointArrowRawBytes = - '65,82,82,79,87,49,0,0,255,255,255,255,24,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,105,110,116,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,0,0,0,0,255,255,255,255,72,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,64,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,188,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,120,2,0,0,100,2,0,0,64,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,228,250,255,255,28,2,0,0,4,0,0,0,15,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,50,46,48,44,50,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,40,4,0,0,0,0,0,0,80,1,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,92,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,88,253,255,255,64,2,0,0,4,0,0,0,49,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,105,110,116,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,84,1,0,0,20,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,116,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,104,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,32,0,0,0,4,0,0,0,19,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,105,110,116,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,128,6,0,0,65,82,82,79,87,49'; -const expectedMultiPointGeoJson = { - type: 'FeatureCollection', - features: [ - { - type: 'Feature', - properties: { - id: 2, - name: 'name2' - }, - geometry: { - type: 'MultiPoint', - coordinates: [ - [1, 1], - [2, 2] - ] - } - } - ] -}; - -// a simple geojson contains one MultiLinestring -const testMultiLineStringArrowRawBytes = - '65,82,82,79,87,49,0,0,255,255,255,255,80,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,100,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,80,253,255,255,72,2,0,0,4,0,0,0,59,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,136,1,0,0,72,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,124,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,112,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,40,0,0,0,4,0,0,0,24,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,120,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,112,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,220,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,50,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,16,64,0,0,0,0,0,0,16,64,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,132,2,0,0,108,2,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,208,250,255,255,36,2,0,0,4,0,0,0,20,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,49,46,48,44,49,46,48,44,52,46,48,44,52,46,48,93,125,125,125,0,0,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,96,4,0,0,0,0,0,0,128,1,0,0,0,0,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,100,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,80,253,255,255,72,2,0,0,4,0,0,0,59,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,76,105,110,101,83,116,114,105,110,103,34,125,125,125,0,3,0,0,0,103,101,111,0,3,0,0,0,136,1,0,0,72,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,124,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,112,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,40,0,0,0,4,0,0,0,24,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,108,105,110,101,115,116,114,105,110,103,0,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,200,6,0,0,65,82,82,79,87,49'; -const expectedMultiLineStringGeoJson = { - type: 'FeatureCollection', - features: [ - { - type: 'Feature', - properties: { - id: 2, - name: 'name2' - }, - geometry: { - type: 'MultiLineString', - coordinates: [ - [ - [1, 1], - [2, 2] - ], - [ - [3, 3], - [4, 4] - ] - ] - } - } - ] -}; - -// a simple geojson contains one MultiPolygon -const testMultiPolygonArrowRawBytes = - '65,82,82,79,87,49,0,0,255,255,255,255,120,4,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,96,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,84,253,255,255,68,2,0,0,4,0,0,0,53,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,108,121,103,111,110,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,176,1,0,0,112,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,120,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,108,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,36,0,0,0,4,0,0,0,21,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,12,255,255,255,8,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,0,0,0,0,255,255,255,255,168,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,224,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,252,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,160,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,240,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,8,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,255,255,255,255,0,0,0,0,24,0,0,0,0,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,124,2,0,0,104,2,0,0,68,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,220,250,255,255,32,2,0,0,4,0,0,0,17,2,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,51,46,48,44,51,46,48,93,125,125,125,0,0,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,136,4,0,0,0,0,0,0,176,1,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,96,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,84,253,255,255,68,2,0,0,4,0,0,0,53,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,77,117,108,116,105,80,111,108,121,103,111,110,34,125,125,125,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,176,1,0,0,112,1,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,12,24,0,0,0,120,0,0,0,8,0,0,0,28,0,0,0,1,0,0,0,108,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,36,0,0,0,4,0,0,0,21,0,0,0,103,101,111,97,114,114,111,119,46,109,117,108,116,105,112,111,108,121,103,111,110,0,0,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,12,255,255,255,8,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,56,255,255,255,52,255,255,255,0,0,1,12,20,0,0,0,28,0,0,0,4,0,0,0,1,0,0,0,20,0,0,0,4,0,0,0,105,116,101,109,0,0,0,0,100,255,255,255,96,255,255,255,0,0,1,16,20,0,0,0,32,0,0,0,4,0,0,0,1,0,0,0,44,0,0,0,4,0,0,0,105,116,101,109,0,0,6,0,8,0,4,0,6,0,0,0,2,0,0,0,16,0,20,0,8,0,0,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,0,3,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,120,121,0,0,0,0,6,0,8,0,6,0,6,0,0,0,0,0,2,0,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,232,6,0,0,65,82,82,79,87,49'; -const expectedMultiPolygonGeojson = { - type: 'FeatureCollection', - features: [ - { - type: 'Feature', - properties: { - id: 1, - name: 'name1' - }, - geometry: { - type: 'MultiPolygon', - coordinates: [ - [ - [ - [0, 0], - [0, 1], - [1, 1], - [1, 0], - [0, 0] - ] - ], - [ - [ - [2, 2], - [2, 3], - [3, 3], - [3, 2], - [2, 2] - ] - ] - ] - } - } - ] -}; - -// Arrow with one point encoded in WKT -const testPointArrowWKTRawBytes = - '65,82,82,79,87,49,0,0,255,255,255,255,120,3,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,84,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,5,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,84,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,8,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,48,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,156,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,11,0,0,0,80,79,73,78,84,32,40,48,32,48,41,0,0,0,0,0,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,108,2,0,0,84,2,0,0,48,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,8,251,255,255,12,2,0,0,4,0,0,0,255,1,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,84,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,48,46,48,44,48,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,136,3,0,0,0,0,0,0,16,1,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,84,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,5,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,84,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,216,5,0,0,65,82,82,79,87,49'; - -// Arrow with one point encoded in WKB -const testPointArrowWKBRawBytes = - '65,82,82,79,87,49,0,0,255,255,255,255,120,3,0,0,16,0,0,0,0,0,10,0,14,0,6,0,5,0,8,0,10,0,0,0,0,1,4,0,16,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,66,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,4,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,66,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,255,255,255,255,8,1,0,0,20,0,0,0,0,0,0,0,12,0,22,0,6,0,5,0,8,0,12,0,12,0,0,0,0,3,4,0,24,0,0,0,56,0,0,0,0,0,0,0,0,0,10,0,24,0,12,0,4,0,8,0,10,0,0,0,156,0,0,0,16,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,110,97,109,101,49,0,0,0,0,0,0,0,21,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,20,0,0,0,0,0,14,0,24,0,6,0,8,0,12,0,16,0,20,0,14,0,0,0,0,0,4,0,108,2,0,0,84,2,0,0,48,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,8,251,255,255,12,2,0,0,4,0,0,0,255,1,0,0,123,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,66,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,98,98,111,120,34,58,91,48,46,48,44,48,46,48,44,48,46,48,44,48,46,48,93,125,125,125,0,8,0,0,0,103,100,97,108,58,103,101,111,0,0,0,0,1,0,0,0,136,3,0,0,0,0,0,0,16,1,0,0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,12,0,0,0,4,0,8,0,10,0,0,0,72,2,0,0,4,0,0,0,1,0,0,0,4,0,0,0,112,253,255,255,44,2,0,0,4,0,0,0,28,2,0,0,123,34,115,99,104,101,109,97,95,118,101,114,115,105,111,110,34,58,34,48,46,49,46,48,34,44,34,112,114,105,109,97,114,121,95,99,111,108,117,109,110,34,58,34,103,101,111,109,101,116,114,121,34,44,34,99,111,108,117,109,110,115,34,58,123,34,103,101,111,109,101,116,114,121,34,58,123,34,101,110,99,111,100,105,110,103,34,58,34,87,75,66,34,44,34,99,114,115,34,58,34,71,69,79,71,67,82,83,91,92,34,87,71,83,32,56,52,92,34,44,68,65,84,85,77,91,92,34,87,111,114,108,100,32,71,101,111,100,101,116,105,99,32,83,121,115,116,101,109,32,49,57,56,52,92,34,44,69,76,76,73,80,83,79,73,68,91,92,34,87,71,83,32,56,52,92,34,44,54,51,55,56,49,51,55,44,50,57,56,46,50,53,55,50,50,51,53,54,51,44,76,69,78,71,84,72,85,78,73,84,91,92,34,109,101,116,114,101,92,34,44,49,93,93,93,44,80,82,73,77,69,77,91,92,34,71,114,101,101,110,119,105,99,104,92,34,44,48,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,67,83,91,101,108,108,105,112,115,111,105,100,97,108,44,50,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,97,116,105,116,117,100,101,32,40,76,97,116,41,92,34,44,110,111,114,116,104,44,79,82,68,69,82,91,49,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,65,88,73,83,91,92,34,103,101,111,100,101,116,105,99,32,108,111,110,103,105,116,117,100,101,32,40,76,111,110,41,92,34,44,101,97,115,116,44,79,82,68,69,82,91,50,93,44,65,78,71,76,69,85,78,73,84,91,92,34,100,101,103,114,101,101,92,34,44,48,46,48,49,55,52,53,51,50,57,50,53,49,57,57,52,51,51,93,93,44,73,68,91,92,34,69,80,83,71,92,34,44,52,51,50,54,93,93,34,44,34,103,100,97,108,58,103,101,111,109,101,116,114,121,95,116,121,112,101,34,58,34,80,111,105,110,116,34,125,125,125,0,0,0,0,3,0,0,0,103,101,111,0,3,0,0,0,204,0,0,0,140,0,0,0,24,0,0,0,0,0,18,0,24,0,8,0,6,0,7,0,12,0,0,0,16,0,20,0,18,0,0,0,0,0,1,4,20,0,0,0,96,0,0,0,8,0,0,0,24,0,0,0,0,0,0,0,8,0,0,0,103,101,111,109,101,116,114,121,0,0,0,0,1,0,0,0,12,0,0,0,8,0,12,0,4,0,8,0,8,0,0,0,16,0,0,0,4,0,0,0,3,0,0,0,87,75,66,0,20,0,0,0,65,82,82,79,87,58,101,120,116,101,110,115,105,111,110,58,110,97,109,101,0,0,0,0,216,255,255,255,212,255,255,255,0,0,1,5,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,110,97,109,101,0,0,0,0,4,0,4,0,4,0,0,0,16,0,20,0,8,0,6,0,7,0,12,0,0,0,16,0,16,0,0,0,0,0,1,2,16,0,0,0,28,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,105,100,0,0,8,0,12,0,8,0,7,0,8,0,0,0,0,0,0,1,32,0,0,0,216,5,0,0,65,82,82,79,87,49'; - - // a simple geojson contains one point -const expectedPointGeojsonForWellKnownFormat = { - type: 'FeatureCollection', - features: [ - { - type: 'Feature', - properties: { - id: 1, - name: 'name1' - }, - geometry: { - type: 'Point', - coordinates: [0, 0] - } - } - ] -}; - -test.only('geojsonUtils.parseGeometryFromArrow', async t => { +import { + testPointArrowRawBytes, + testLineStringArrowRawBytes, + testPolygonArrowRawBytes, + testMultiPointArrowRawBytes, + testMultiLineStringArrowRawBytes, + testMultiPolygonArrowRawBytes, + testPointArrowWKBRawBytes, + testPointArrowWKTRawBytes, + expectedPointGeojson, + expectedPointGeojsonForWellKnownFormat, + expectedLineStringGeoJson, + expectedPolygonGeojson, + expectedMultiPointGeoJson, + expectedMultiLineStringGeoJson, + expectedMultiPolygonGeojson +} from '../../fixtures/test-arrow-data'; + +test('geojsonUtils.parseGeometryFromArrow', async t => { async function testParseFromArrow(t, rawArrowBytes, expectedGeojson) { // load parquet file using loaders.gl/arrow const testArrowTable = new Uint8Array(rawArrowBytes.split(',').map(byte => parseInt(byte, 10))); From 10b1004bb2ea7937491b552120e39d9f7b7d2072 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Mon, 18 Sep 2023 12:46:36 -0700 Subject: [PATCH 13/29] clean up --- src/processors/src/data-processor.ts | 29 ++++++++++----- src/processors/src/file-handler.ts | 47 ++++--------------------- src/reducers/src/vis-state-selectors.ts | 4 +-- src/types/layers.d.ts | 2 +- 4 files changed, 29 insertions(+), 53 deletions(-) diff --git a/src/processors/src/data-processor.ts b/src/processors/src/data-processor.ts index 9c71f1a2fa..e9b7f59441 100644 --- a/src/processors/src/data-processor.ts +++ b/src/processors/src/data-processor.ts @@ -19,11 +19,16 @@ // THE SOFTWARE. import {Table as ApacheArrowTable, Field as ArrowField, ListVector} from 'apache-arrow'; -import { csvParseRows } from 'd3-dsv'; +import {csvParseRows} from 'd3-dsv'; import {Console} from 'global/console'; import {DATA_TYPES as AnalyzerDATA_TYPES} from 'type-analyzer'; import normalize from '@mapbox/geojson-normalize'; -import {ALL_FIELD_TYPES, DATASET_FORMATS, GUIDES_FILE_FORMAT_DOC, ARROW_GEO_METADATA_KEY} from '@kepler.gl/constants'; +import { + ALL_FIELD_TYPES, + DATASET_FORMATS, + GUIDES_FILE_FORMAT_DOC, + ARROW_GEO_METADATA_KEY +} from '@kepler.gl/constants'; import {ProcessorResult, Field} from '@kepler.gl/types'; import { arrowDataTypeToAnalyzerDataType, @@ -435,8 +440,12 @@ export function processArrowTable(arrowTable: ApacheArrowTable): ProcessorResult displayName: field.name, format: '', fieldIdx: index, - type: geometryColumns[field.name] ? ALL_FIELD_TYPES.geojson : arrowDataTypeToFieldType(field.type), - analyzerType: geometryColumns[field.name] ? AnalyzerDATA_TYPES.GEOMETRY : arrowDataTypeToAnalyzerDataType(field.type), + type: geometryColumns[field.name] + ? ALL_FIELD_TYPES.geojson + : arrowDataTypeToFieldType(field.type), + analyzerType: geometryColumns[field.name] + ? AnalyzerDATA_TYPES.GEOMETRY + : arrowDataTypeToAnalyzerDataType(field.type), valueAccessor: (dc: any) => d => { return dc.valueAt(d.index, index); } @@ -451,11 +460,13 @@ export function processArrowTable(arrowTable: ApacheArrowTable): ProcessorResult const fieldName = tableKeys[keyIndex]; const cellValue = columnarTable[fieldName][index]; tableItem.push( - geometryColumns[fieldName] ? - { - encoding: geometryColumns[fieldName].encoding, - data: cellValue - } : cellValue); + geometryColumns[fieldName] + ? { + encoding: geometryColumns[fieldName].encoding, + data: cellValue + } + : cellValue + ); } rowFormatTable.push(tableItem); } diff --git a/src/processors/src/file-handler.ts b/src/processors/src/file-handler.ts index b2c2c2a474..d01dc65f0c 100644 --- a/src/processors/src/file-handler.ts +++ b/src/processors/src/file-handler.ts @@ -18,19 +18,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {Type as ArrowType, Table as ArrowTable} from 'apache-arrow'; -import {ArrowLoader} from '@loaders.gl/arrow'; import {parseInBatches} from '@loaders.gl/core'; import {JSONLoader, _JSONPath} from '@loaders.gl/json'; import {CSVLoader} from '@loaders.gl/csv'; -import { - processArrowColumnarData, - processGeojson, - processKeplerglJSON, - processRowObject -} from './data-processor'; +import {processGeojson, processKeplerglJSON, processRowObject} from './data-processor'; import {generateHashId, isPlainObject} from '@kepler.gl/utils'; -import {DATASET_FORMATS, ARROW_GEO_METADATA_KEY} from '@kepler.gl/constants'; +import {DATASET_FORMATS} from '@kepler.gl/constants'; import {Loader} from '@loaders.gl/loader-utils'; import {FileCacheItem, ValidKeplerGlMap} from './types'; import {Feature, AddDataToMapPayload} from '@kepler.gl/types'; @@ -61,27 +54,10 @@ export type ProcessFileDataContent = { data: unknown; fileName: string; length?: number; - progress?: {rowCount?: number, rowCountInBatch?: number, percent?: number}; + progress?: {rowCount?: number; rowCountInBatch?: number; percent?: number}; metadata?: Map; }; -const ARROW_LOADER_OPTIONS = { - shape: 'arrow-table', // note: this will be changed to `columnar-table` by loaders.gl v3 - batchType: 'arrow' -}; - -export function isArrowTable(rawObject: unknown): rawObject is ArrowTable { - return isPlainObject(rawObject) && rawObject.typeId === ArrowType.Struct && Boolean(rawObject.data); -} - -export function isArrowColumnarData(content: ProcessFileDataContent): boolean { - return ( - isPlainObject(content) && - Boolean(content.metadata) && - Boolean(content.metadata?.has(ARROW_GEO_METADATA_KEY)) - ); -} - export function isGeoJson(json: unknown): json is Feature | FeatureCollection { // json can be feature collection // or single feature @@ -184,12 +160,11 @@ export async function readFileInBatches({ fileCache: FileCacheItem[]; loaders: Loader[]; loadOptions: any; - }): Promise { - loaders = [JSONLoader, CSVLoader, ArrowLoader, ...loaders]; +}): Promise { + loaders = [JSONLoader, CSVLoader, ...loaders]; loadOptions = { csv: CSV_LOADER_OPTIONS, json: JSON_LOADER_OPTIONS, - arrow: ARROW_LOADER_OPTIONS, metadata: true, ...loadOptions }; @@ -208,20 +183,10 @@ export function processFileData({ fileCache: FileCacheItem[]; }): Promise { return new Promise((resolve, reject) => { - let {data} = content; + const {data} = content; let format: string | undefined; let processor: Function | undefined; - if (isArrowColumnarData(content)) { - // in loaders.gl/arrow version < 4.0.0, the arrow loader in batch didn't return the correct data. - // Instead, the content of each column is returned and stored directly in the content object. - // This is a temporary solution untill loaders.gl/arrow is updated to: - // https://github.com/visgl/loaders.gl/blob/2577ca735878b521f07a556f26ce8ee457a7ad9f/modules/arrow/src/lib/parse-arrow-in-batches.ts#L29 - data = content; - format = DATASET_FORMATS.arrow; - processor = processArrowColumnarData; - } - if (isKeplerGlMap(data)) { format = DATASET_FORMATS.keplergl; processor = processKeplerglJSON; diff --git a/src/reducers/src/vis-state-selectors.ts b/src/reducers/src/vis-state-selectors.ts index 317b23d28e..c9d7e55584 100644 --- a/src/reducers/src/vis-state-selectors.ts +++ b/src/reducers/src/vis-state-selectors.ts @@ -21,8 +21,8 @@ import {createSelector} from 'reselect'; // NOTE: default formats must match file-handler-test.js -const DEFAULT_FILE_EXTENSIONS = ['csv', 'json', 'geojson', 'arrow']; -const DEFAULT_FILE_FORMATS = ['CSV', 'Json', 'GeoJSON', 'Arrow']; +const DEFAULT_FILE_EXTENSIONS = ['csv', 'json', 'geojson']; +const DEFAULT_FILE_FORMATS = ['CSV', 'Json', 'GeoJSON']; export const getFileFormatNames = createSelector( // @ts-expect-error diff --git a/src/types/layers.d.ts b/src/types/layers.d.ts index 402a722adc..10a24d9818 100644 --- a/src/types/layers.d.ts +++ b/src/types/layers.d.ts @@ -67,7 +67,7 @@ export type Field = { fieldIdx: number; valueAccessor(v: {index: number}): any; filterProps?: any; - metadata?: object; + metadata?: any; displayFormat?: string; }; From ebb5e1261e245a0ce5c27a81a4649de0eab84b1f Mon Sep 17 00:00:00 2001 From: Xun Li Date: Mon, 18 Sep 2023 14:04:13 -0700 Subject: [PATCH 14/29] wip --- package.json | 1 + src/layers/src/geojson-layer/geojson-utils.ts | 2 +- src/layers/src/index.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b484785b10..603417731b 100644 --- a/package.json +++ b/package.json @@ -239,6 +239,7 @@ "lodash": "4.17.19", "minimist": "1.2.3", "node-fetch": "2.6.1", + "puppeteer": "^18.2.1", "tough-cookie": "4.0.0" }, "peerDependencies": { diff --git a/src/layers/src/geojson-layer/geojson-utils.ts b/src/layers/src/geojson-layer/geojson-utils.ts index 8c2a84ef29..e671e9ee71 100644 --- a/src/layers/src/geojson-layer/geojson-utils.ts +++ b/src/layers/src/geojson-layer/geojson-utils.ts @@ -23,7 +23,7 @@ import bbox from '@turf/bbox'; import {parseSync} from '@loaders.gl/core'; import {WKBLoader, WKTLoader} from '@loaders.gl/wkt'; import {binaryToGeometry} from '@loaders.gl/gis'; -import {Feature, BBox} from 'geojson'; +import {Feature, BBox} from 'geojson'; import { getSampleData, parseGeometryFromArrow, diff --git a/src/layers/src/index.ts b/src/layers/src/index.ts index c5a85ba3e8..df1212bcae 100644 --- a/src/layers/src/index.ts +++ b/src/layers/src/index.ts @@ -48,7 +48,7 @@ export {defaultElevation as s2DefaultElevation} from './s2-geometry-layer/s2-geo export {getS2Center} from './s2-geometry-layer/s2-utils'; export {default as AggregationLayer} from './aggregation-layer'; import {LAYER_TYPES} from '@kepler.gl/constants'; -export {parseGeoJsonRawFeature, parseGeometryFromArrow} from './geojson-layer/geojson-utils'; +export {parseGeoJsonRawFeature} from './geojson-layer/geojson-utils'; // base layer // eslint-disable-next-line prettier/prettier export type { From 37429abde8fe3c16bea311424cd363c1cfc7313a Mon Sep 17 00:00:00 2001 From: Xun Li Date: Mon, 16 Oct 2023 11:35:36 -0700 Subject: [PATCH 15/29] try binary format in GeoJsonLayer --- src/components/package.json | 2 +- src/components/src/map-container.tsx | 2 +- src/constants/package.json | 6 +- src/layers/src/geojson-layer/geojson-layer.ts | 218 ++++++++++++++---- src/layers/src/geojson-layer/geojson-utils.ts | 2 +- src/processors/src/data-processor.ts | 12 +- src/reducers/package.json | 28 +-- src/types/types.d.ts | 2 +- 8 files changed, 207 insertions(+), 65 deletions(-) diff --git a/src/components/package.json b/src/components/package.json index 03f00ac282..4ae2260b62 100644 --- a/src/components/package.json +++ b/src/components/package.json @@ -65,8 +65,8 @@ "@types/lodash.throttle": "^4.1.7", "@types/lodash.uniq": "^4.5.7", "@types/lodash.uniqby": "^4.7.7", - "@types/react-copy-to-clipboard": "^5.0.2", "@types/react": "^18.0.28", + "@types/react-copy-to-clipboard": "^5.0.2", "@types/react-dom": "^18.0.11", "@types/react-lifecycles-compat": "^3.0.1", "@types/react-map-gl": "^6.1.3", diff --git a/src/components/src/map-container.tsx b/src/components/src/map-container.tsx index 2ebc5af3c2..5728a7192c 100644 --- a/src/components/src/map-container.tsx +++ b/src/components/src/map-container.tsx @@ -744,7 +744,7 @@ export default function MapContainerFactory( mapboxApiAccessToken, mapboxApiUrl, layersForDeck, - editorInfo: primaryMap + editorInfo: false ? { editor, editorMenuActive, diff --git a/src/constants/package.json b/src/constants/package.json index 8c2434713d..471b378c83 100644 --- a/src/constants/package.json +++ b/src/constants/package.json @@ -1,7 +1,7 @@ { "name": "@kepler.gl/constants", "author": "Shan He ", - "version": "3.0.0-alpha.1", + "version": "3.0.0-alpha.0", "description": "kepler.gl constants used by kepler.gl components, actions and reducers", "license": "MIT", "main": "dist/index.js", @@ -30,7 +30,9 @@ "umd" ], "dependencies": { - "@kepler.gl/types": "3.0.0-alpha.1", + "@dnd-kit/core": "^6.0.8", + "@dnd-kit/modifiers": "^6.0.1", + "@kepler.gl/types": "3.0.0-alpha.0", "@types/d3-scale": "^3.2.2", "@types/keymirror": "^0.1.1", "colorbrewer": "^1.5.0", diff --git a/src/layers/src/geojson-layer/geojson-layer.ts b/src/layers/src/geojson-layer/geojson-layer.ts index 6a03a5c1db..e2f8a22709 100644 --- a/src/layers/src/geojson-layer/geojson-layer.ts +++ b/src/layers/src/geojson-layer/geojson-layer.ts @@ -167,6 +167,7 @@ export type GeoJsonLayerConfig = Merge< export type GeoJsonLayerMeta = { featureTypes?: {polygon: boolean; point: boolean; line: boolean}; fixedRadius?: boolean; + isArrow?: boolean; }; export const geoJsonRequiredColumns: ['geojson'] = ['geojson']; @@ -331,7 +332,9 @@ export default class GeoJsonLayer extends Layer { } calculateDataAttribute({dataContainer, filteredIndex}, getPosition) { - return filteredIndex.map(i => this.dataToFeature[i]).filter(d => d); + return this.meta.isArrow + ? this.dataToFeature + : filteredIndex.map(i => this.dataToFeature[i]).filter(d => d); } formatLayerData(datasets, oldLayerData) { @@ -361,19 +364,108 @@ export default class GeoJsonLayer extends Layer { updateLayerMeta(dataContainer) { const getFeature = this.getPositionAccessor(dataContainer); - this.dataToFeature = getGeojsonDataMaps(dataContainer, getFeature); - // get bounds from features - const bounds = getGeojsonBounds(this.dataToFeature); - // if any of the feature has properties.radius set to be true - const fixedRadius = Boolean( - this.dataToFeature.find(d => d && d.properties && d.properties.radius) - ); - - // keep a record of what type of geometry the collection has - const featureTypes = getGeojsonFeatureTypes(this.dataToFeature); - - this.updateMeta({bounds, fixedRadius, featureTypes}); + const feature = getFeature({index: 0}); + const isArrow = feature && 'encoding' in feature; + + if (isArrow) { + // create binary data from arrow data for GeoJsonLayer + const nDim = 2; + const geoColumn = feature.data.parent; + const chunks = geoColumn.chunks; + const dataToFeature: any = []; + let sampleCoordinateArray: any = null; + for (let c = 0; c < chunks.length; c++) { + const geometries = chunks[c]; + const flatCoordinateArray = geometries + .getChildAt(0) + .getChildAt(0) + .getChildAt(0) + .getChildAt(0).data.values; + sampleCoordinateArray = flatCoordinateArray; + const ringOffsets = geometries.getChildAt(0).getChildAt(0).valueOffsets; + const polygonOffsets = ringOffsets; + const numOfPolygon = flatCoordinateArray.length / nDim; + + // create Uint16Array with incremental values starting from 0 + const featureIds = new Uint32Array(numOfPolygon); + for (let i = 0; i < numOfPolygon; i++) { + featureIds[i] = i; + } + const globalFeatureIds = new Uint32Array(numOfPolygon); + for (let i = 0; i < numOfPolygon; i++) { + globalFeatureIds[i] = i + geoColumn._chunkOffsets[c]; + } + dataToFeature.push({ + points: { + globalFeatureIds: {value: [], size: 1}, + positions: {value: [], size: 2}, + properties: [], + numericProps: [], + featureIds: {value: [], size: 1} + }, + lines: { + globalFeatureIds: {value: new Uint32Array(0), size: 1}, + pathIndices: {value: new Uint16Array(0), size: 1}, + positions: {value: new Float32Array(0), size: 2}, + properties: [], + numericProps: [], + featureIds: {value: new Uint32Array(0), size: 1} + }, + polygons: { + globalFeatureIds: {value: globalFeatureIds, size: 1}, + positions: { + value: flatCoordinateArray, + size: nDim + }, + polygonIndices: {value: polygonOffsets, size: 1}, + primitivePolygonIndices: {value: polygonOffsets, size: 1}, + properties: [], + featureIds: {value: featureIds, size: 1}, + numericProps: [], + fields: [] + } + }); + } + this.dataToFeature = dataToFeature; + + // iterate flatCoodrinatesArray to get bounds + const bounds = [Infinity, Infinity, -Infinity, -Infinity]; + const nSamples = + sampleCoordinateArray.length / nDim > 1000 ? 1000 : sampleCoordinateArray.length / 2; + for (let i = 0; i < nSamples; i += nDim) { + const lng = sampleCoordinateArray[i]; + const lat = sampleCoordinateArray[i + 1]; + if (lng < bounds[0]) { + bounds[0] = lng; + } + if (lat < bounds[1]) { + bounds[1] = lat; + } + if (lng > bounds[2]) { + bounds[2] = lng; + } + if (lat > bounds[3]) { + bounds[3] = lat; + } + } + const fixedRadius = false; + const featureTypes = {polygon: true, point: false, line: false}; + this.updateMeta({bounds, fixedRadius, featureTypes, isArrow}); + } else { + this.dataToFeature = getGeojsonDataMaps(dataContainer, getFeature); + // get bounds from features + const bounds = getGeojsonBounds(this.dataToFeature); + // if any of the feature has properties.radius set to be true + const fixedRadius = Boolean( + this.dataToFeature.find(d => d && d.properties && d.properties.radius) + ); + + // keep a record of what type of geometry the collection has + const featureTypes = getGeojsonFeatureTypes(this.dataToFeature); + + this.updateMeta({bounds, fixedRadius, featureTypes, isArrow}); + } } setInitialLayerConfig({dataContainer}) { @@ -388,7 +480,7 @@ export default class GeoJsonLayer extends Layer { // set both fill and stroke to true return this.updateLayerVisConfig({ filled: true, - stroked: true, + stroked: false, strokeColor: colorMaker.next().value }); } else if (featureTypes && featureTypes.point) { @@ -399,10 +491,21 @@ export default class GeoJsonLayer extends Layer { return this; } + hasLayerData(layerData) { + if (!layerData) { + return false; + } + return Boolean( + layerData.data && + (layerData.data.length || + ('points' in layerData.data && 'polygons' in layerData.data && 'lines' in layerData.data)) + ); + } + renderLayer(opts) { const {data, gpuFilter, objectHovered, mapState, interactionConfig} = opts; - const {fixedRadius, featureTypes} = this.meta; + const {fixedRadius, featureTypes, isArrow} = this.meta; const radiusScale = this.getRadiusScaleByZoom(mapState, fixedRadius); const zoomFactor = this.getZoomFactor(mapState); const eleZoomFactor = this.getElevationZoomFactor(mapState); @@ -429,35 +532,70 @@ export default class GeoJsonLayer extends Layer { const pickable = interactionConfig.tooltip.enabled; const hoveredObject = this.hasHoveredObject(objectHovered); - return [ - new DeckGLGeoJsonLayer({ - ...defaultLayerProps, - ...layerProps, - ...data, - pickable, - highlightColor: HIGHLIGH_COLOR_3D, - autoHighlight: visConfig.enable3d && pickable, - stroked: visConfig.stroked, - filled: visConfig.filled, - extruded: visConfig.enable3d, - wireframe: visConfig.wireframe, - wrapLongitude: false, - lineMiterLimit: 2, - capRounded: true, - jointRounded: true, - updateTriggers, - _subLayerProps: { - ...(featureTypes?.polygon ? {'polygons-stroke': opaOverwrite} : {}), - ...(featureTypes?.line ? {linestrings: opaOverwrite} : {}), - ...(featureTypes?.point - ? { + const geojsonLayers = isArrow ? + data.data.map((d, i) => { + return new DeckGLGeoJsonLayer({ + ...defaultLayerProps, + ...layerProps, + ...data, + data: d, + id: `${this.id}-${i}`, + pickable, + highlightColor: HIGHLIGH_COLOR_3D, + autoHighlight: visConfig.enable3d && pickable, + stroked: visConfig.stroked, + filled: visConfig.filled, + extruded: visConfig.enable3d, + wireframe: visConfig.wireframe, + wrapLongitude: false, + lineMiterLimit: 2, + capRounded: true, + jointRounded: true, + updateTriggers, + _subLayerProps: { + ...(featureTypes?.polygon ? { 'polygons-stroke': opaOverwrite } : {}), + ...(featureTypes?.line ? { linestrings: opaOverwrite } : {}), + ...(featureTypes?.point + ? { points: { lineOpacity: visConfig.strokeOpacity } } - : {}) - } - }), + : {}) + } + }); + }) : [ + new DeckGLGeoJsonLayer({ + ...defaultLayerProps, + ...layerProps, + ...data, + pickable, + highlightColor: HIGHLIGH_COLOR_3D, + autoHighlight: visConfig.enable3d && pickable, + stroked: visConfig.stroked, + filled: visConfig.filled, + extruded: visConfig.enable3d, + wireframe: visConfig.wireframe, + wrapLongitude: false, + lineMiterLimit: 2, + capRounded: true, + jointRounded: true, + updateTriggers, + _subLayerProps: { + ...(featureTypes?.polygon ? { 'polygons-stroke': opaOverwrite } : {}), + ...(featureTypes?.line ? { linestrings: opaOverwrite } : {}), + ...(featureTypes?.point + ? { + points: { + lineOpacity: visConfig.strokeOpacity + } + } + : {}) + } + }) + ]; + return [ + ...geojsonLayers, // hover layer ...(hoveredObject && !visConfig.enable3d ? [ diff --git a/src/layers/src/geojson-layer/geojson-utils.ts b/src/layers/src/geojson-layer/geojson-utils.ts index e671e9ee71..cfb3fdc9dc 100644 --- a/src/layers/src/geojson-layer/geojson-utils.ts +++ b/src/layers/src/geojson-layer/geojson-utils.ts @@ -32,7 +32,7 @@ import { } from '@kepler.gl/utils'; export type GetFeature = (d: any) => Feature; -export type GeojsonDataMaps = Array; +export type GeojsonDataMaps = Array | {points?: any, lines?: any, polygons?: any}; type FeatureTypeMap = { [key in FeatureTypes]: boolean; diff --git a/src/processors/src/data-processor.ts b/src/processors/src/data-processor.ts index e9b7f59441..8c3130ee85 100644 --- a/src/processors/src/data-processor.ts +++ b/src/processors/src/data-processor.ts @@ -18,7 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {Table as ApacheArrowTable, Field as ArrowField, ListVector} from 'apache-arrow'; +import {Table as ApacheArrowTable, Field as ArrowField, Column as ArrowColumn} from 'apache-arrow'; import {csvParseRows} from 'd3-dsv'; import {Console} from 'global/console'; import {DATA_TYPES as AnalyzerDATA_TYPES} from 'type-analyzer'; @@ -429,11 +429,10 @@ export function processArrowTable(arrowTable: ApacheArrowTable): ProcessorResult // parse fields and convert columnar to row format table const rowFormatTable: any[][] = []; - const columnarTable: {[name: string]: ListVector[]} = {}; + const columnarTable: {[name: string]: ArrowColumn} = {}; arrowTable.schema.fields.forEach((field: ArrowField, index: number) => { const arrowColumn = arrowTable.getColumn(field.name); - const values = arrowColumn.toArray(); - columnarTable[field.name] = values; + columnarTable[field.name] = arrowColumn; fields.push({ name: field.name, id: field.name, @@ -458,7 +457,10 @@ export function processArrowTable(arrowTable: ApacheArrowTable): ProcessorResult const tableItem: unknown[] = []; for (let keyIndex = 0; keyIndex < tableKeys.length; keyIndex++) { const fieldName = tableKeys[keyIndex]; - const cellValue = columnarTable[fieldName][index]; + const cellValue = columnarTable[fieldName].get(index); + if (geometryColumns[fieldName]) { + cellValue.parent = columnarTable[fieldName]; + } tableItem.push( geometryColumns[fieldName] ? { diff --git a/src/reducers/package.json b/src/reducers/package.json index 1cc5d3e935..7ac461f0ce 100644 --- a/src/reducers/package.json +++ b/src/reducers/package.json @@ -1,7 +1,7 @@ { "name": "@kepler.gl/reducers", "author": "Shan He ", - "version": "3.0.0-alpha.1", + "version": "3.0.0-alpha.0", "description": "kepler.gl constants used by kepler.gl components, actions and reducers", "license": "MIT", "main": "dist/index.js", @@ -30,19 +30,19 @@ "umd" ], "dependencies": { - "@kepler.gl/actions": "3.0.0-alpha.1", - "@kepler.gl/cloud-providers": "3.0.0-alpha.1", - "@kepler.gl/constants": "3.0.0-alpha.1", - "@kepler.gl/deckgl-layers": "3.0.0-alpha.1", - "@kepler.gl/layers": "3.0.0-alpha.1", - "@kepler.gl/effects": "3.0.0-alpha.1", - "@kepler.gl/localization": "3.0.0-alpha.1", - "@kepler.gl/processors": "3.0.0-alpha.1", - "@kepler.gl/schemas": "3.0.0-alpha.1", - "@kepler.gl/table": "3.0.0-alpha.1", - "@kepler.gl/tasks": "3.0.0-alpha.1", - "@kepler.gl/types": "3.0.0-alpha.1", - "@kepler.gl/utils": "3.0.0-alpha.1", + "@dnd-kit/sortable": "^7.0.2", + "@kepler.gl/actions": "3.0.0-alpha.0", + "@kepler.gl/cloud-providers": "3.0.0-alpha.0", + "@kepler.gl/constants": "3.0.0-alpha.0", + "@kepler.gl/deckgl-layers": "3.0.0-alpha.0", + "@kepler.gl/layers": "3.0.0-alpha.0", + "@kepler.gl/localization": "3.0.0-alpha.0", + "@kepler.gl/processors": "3.0.0-alpha.0", + "@kepler.gl/schemas": "3.0.0-alpha.0", + "@kepler.gl/table": "3.0.0-alpha.0", + "@kepler.gl/tasks": "3.0.0-alpha.0", + "@kepler.gl/types": "3.0.0-alpha.0", + "@kepler.gl/utils": "3.0.0-alpha.0", "@loaders.gl/loader-utils": "^3.4.14", "@types/lodash.clonedeep": "^4.5.7", "@types/lodash.flattendeep": "^4.4.7", diff --git a/src/types/types.d.ts b/src/types/types.d.ts index e65229e0a3..ade2f5645a 100644 --- a/src/types/types.d.ts +++ b/src/types/types.d.ts @@ -23,4 +23,4 @@ export type RowData = { [key: string]: string | null; }[]; -export type ProcessorResult = {fields: Field[]; rows: any[][]} | null; +export type ProcessorResult = {fields: Field[]; rows: any[][]; rawData?: any} | null; From 1d6c383fc552102c8feed273d386c0323d489932 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Tue, 17 Oct 2023 14:16:08 -0700 Subject: [PATCH 16/29] wip --- .../layer-panel/layer-configurator.tsx | 4 + src/constants/src/layers.ts | 1 + src/layers/src/arrow-layer/arrow-layer.ts | 215 ++++++++++ src/layers/src/geojson-layer/geojson-layer.ts | 216 ++-------- src/layers/src/geojson-layer/geojson-utils.ts | 16 +- src/layers/src/index.ts | 3 + src/localization/src/translations/en.ts | 1 + src/processors/src/data-processor.ts | 45 +-- src/table/src/kepler-table.ts | 12 +- src/types/actions.d.ts | 1 + src/utils/src/arrow-data-container.ts | 186 +++++++++ src/utils/src/arrow-utils.ts | 380 ++++++++---------- src/utils/src/data-container-interface.ts | 7 + src/utils/src/data-container-utils.ts | 6 +- src/utils/src/dataset-utils.ts | 4 +- src/utils/src/index.ts | 2 +- 16 files changed, 666 insertions(+), 433 deletions(-) create mode 100644 src/layers/src/arrow-layer/arrow-layer.ts create mode 100644 src/utils/src/arrow-data-container.ts diff --git a/src/components/src/side-panel/layer-panel/layer-configurator.tsx b/src/components/src/side-panel/layer-panel/layer-configurator.tsx index fd65197481..6c092b7821 100644 --- a/src/components/src/side-panel/layer-panel/layer-configurator.tsx +++ b/src/components/src/side-panel/layer-panel/layer-configurator.tsx @@ -887,6 +887,10 @@ export default function LayerConfiguratorFactory( ); } + _renderGeoarrowLayerConfig(props) { + return this._renderGeojsonLayerConfig(props); + } + _render3DLayerConfig({layer, visConfiguratorProps}) { return ( diff --git a/src/constants/src/layers.ts b/src/constants/src/layers.ts index e803b92bde..a6f57c9dc2 100644 --- a/src/constants/src/layers.ts +++ b/src/constants/src/layers.ts @@ -502,6 +502,7 @@ export const LAYER_TYPES = keyMirror({ grid: null, hexagon: null, geojson: null, + geoarrow: null, cluster: null, icon: null, heatmap: null, diff --git a/src/layers/src/arrow-layer/arrow-layer.ts b/src/layers/src/arrow-layer/arrow-layer.ts new file mode 100644 index 0000000000..abe5b6a129 --- /dev/null +++ b/src/layers/src/arrow-layer/arrow-layer.ts @@ -0,0 +1,215 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import uniq from 'lodash.uniq'; +import {DATA_TYPES} from 'type-analyzer'; +import {Feature} from 'geojson'; + +import {BinaryFeatures} from '@loaders.gl/schema'; +import {GeoJsonLayer as DeckGLGeoJsonLayer} from '@deck.gl/layers'; +import { + GEOJSON_FIELDS, + HIGHLIGH_COLOR_3D, + CHANNEL_SCALES, + ColorRange, + LAYER_VIS_CONFIGS +} from '@kepler.gl/constants'; +import { + VisConfigNumber, + VisConfigColorSelect, + VisConfigColorRange, + VisConfigRange, + VisConfigBoolean, + Merge, + RGBColor +} from '@kepler.gl/types'; +import {KeplerTable} from '@kepler.gl/table'; +import { DataContainerInterface, getBinaryGeometriesFromGeoArrowPolygon } from '@kepler.gl/utils'; + +import Layer, { + colorMaker, + LayerBaseConfig, + LayerBaseConfigPartial, + LayerColorConfig, + LayerColumn, + LayerHeightConfig, + LayerRadiusConfig, + LayerSizeConfig, + LayerStrokeColorConfig +} from '../base-layer'; +import { + getGeojsonDataMaps, + getGeojsonBounds, + getGeojsonFeatureTypes, + GeojsonDataMaps +} from '../geojson-layer/geojson-utils'; +import GeoJsonLayer, {SUPPORTED_ANALYZER_TYPES} from '../geojson-layer/geojson-layer'; + +export default class ArrowLayer extends GeoJsonLayer { + dataToFeature: BinaryFeatures[]; + + // constructor + constructor(props) { + super(props); + + this.dataToFeature = []; + } + + static findDefaultLayerProps({label, metadata, fields = []}: KeplerTable) { + const geojsonColumns = fields + .filter(f => f.type === 'geojson' && SUPPORTED_ANALYZER_TYPES[f.analyzerType]) + .map(f => f.name); + + const defaultColumns = { + geojson: uniq([...GEOJSON_FIELDS.geojson, ...geojsonColumns]) + }; + + const foundColumns = this.findDefaultColumnField(defaultColumns, fields); + if (!foundColumns || !foundColumns.length || metadata.format !== 'arrow') { + return {props: []}; + } + + return { + props: foundColumns.map(columns => ({ + label: (typeof label === 'string' && label.replace(/\.[^/.]+$/, '')) || this.type, + columns, + isVisible: true + })) + }; + } + + get type() { + return ArrowLayer.type; + } + static get type() { + return 'geoarrow'; + } + + get name() { + return 'GeoArrow'; + } + + calculateDataAttribute({dataContainer, filteredIndex}, getPosition) { + // TODO: filter arrow table using predicate + // filteredIndex.map(i => this.dataToFeature[i]).filter(d => d); + return this.dataToFeature; + } + + updateLayerMeta(dataContainer: DataContainerInterface) { + const {geojson} = this.config.columns; + const geoColumn = dataContainer.getColumn(geojson.fieldIdx); + + // create binary data from arrow data for GeoJsonLayer + const {binaryGeometries, bounds, featureTypes} = getBinaryGeometriesFromGeoArrowPolygon( + geoColumn + ); + this.dataToFeature = binaryGeometries; + + const fixedRadius = false; + this.updateMeta({bounds, fixedRadius, featureTypes}); + } + + renderLayer(opts) { + const {data, gpuFilter, objectHovered, mapState, interactionConfig} = opts; + + const {fixedRadius, featureTypes} = this.meta; + const radiusScale = this.getRadiusScaleByZoom(mapState, fixedRadius); + const zoomFactor = this.getZoomFactor(mapState); + const eleZoomFactor = this.getElevationZoomFactor(mapState); + + const {visConfig} = this.config; + + const layerProps = { + lineWidthScale: visConfig.thickness * zoomFactor * 8, + elevationScale: visConfig.elevationScale * eleZoomFactor, + pointRadiusScale: radiusScale, + lineMiterLimit: 4 + }; + + const updateTriggers = { + ...this.getVisualChannelUpdateTriggers(), + getFilterValue: gpuFilter.filterValueUpdateTriggers + }; + + const defaultLayerProps = this.getDefaultDeckLayerProps(opts); + const opaOverwrite = { + opacity: visConfig.strokeOpacity + }; + + const pickable = interactionConfig.tooltip.enabled; + const hoveredObject = this.hasHoveredObject(objectHovered); + + const deckLayers = data.data.map((d, i) => { + return new DeckGLGeoJsonLayer({ + ...defaultLayerProps, + ...layerProps, + ...data, + data: d, + id: `${this.id}-${i}`, + pickable, + highlightColor: HIGHLIGH_COLOR_3D, + autoHighlight: visConfig.enable3d && pickable, + stroked: visConfig.stroked, + filled: visConfig.filled, + extruded: visConfig.enable3d, + wireframe: visConfig.wireframe, + wrapLongitude: false, + lineMiterLimit: 2, + capRounded: true, + jointRounded: true, + updateTriggers, + _subLayerProps: { + ...(featureTypes?.polygon ? {'polygons-stroke': opaOverwrite} : {}), + ...(featureTypes?.line ? {linestrings: opaOverwrite} : {}), + ...(featureTypes?.point + ? { + points: { + lineOpacity: visConfig.strokeOpacity + } + } + : {}) + } + }); + }); + return [ + ...deckLayers, + // hover layer + ...(hoveredObject && !visConfig.enable3d + ? [ + new DeckGLGeoJsonLayer({ + ...this.getDefaultHoverLayerProps(), + ...layerProps, + visible: defaultLayerProps.visible, + wrapLongitude: false, + data: [hoveredObject], + getLineWidth: data.getLineWidth, + getPointRadius: data.getPointRadius, + getElevation: data.getElevation, + getLineColor: this.config.highlightColor, + getFillColor: this.config.highlightColor, + // always draw outline + stroked: true, + filled: false + }) + ] + : []) + ]; + } +} diff --git a/src/layers/src/geojson-layer/geojson-layer.ts b/src/layers/src/geojson-layer/geojson-layer.ts index e2f8a22709..c387b902dd 100644 --- a/src/layers/src/geojson-layer/geojson-layer.ts +++ b/src/layers/src/geojson-layer/geojson-layer.ts @@ -20,7 +20,6 @@ import uniq from 'lodash.uniq'; import {DATA_TYPES} from 'type-analyzer'; - import Layer, { colorMaker, LayerBaseConfig, @@ -59,7 +58,7 @@ import { import {KeplerTable} from '@kepler.gl/table'; import {DataContainerInterface} from '@kepler.gl/utils'; -const SUPPORTED_ANALYZER_TYPES = { +export const SUPPORTED_ANALYZER_TYPES = { [DATA_TYPES.GEOMETRY]: true, [DATA_TYPES.GEOMETRY_FROM_STRING]: true, [DATA_TYPES.PAIR_GEOMETRY_FROM_STRING]: true @@ -167,7 +166,6 @@ export type GeoJsonLayerConfig = Merge< export type GeoJsonLayerMeta = { featureTypes?: {polygon: boolean; point: boolean; line: boolean}; fixedRadius?: boolean; - isArrow?: boolean; }; export const geoJsonRequiredColumns: ['geojson'] = ['geojson']; @@ -198,11 +196,11 @@ export default class GeoJsonLayer extends Layer { get type() { return GeoJsonLayer.type; } - static get type(): 'geojson' { + static get type() { return 'geojson'; } - get name(): 'Polygon' { + get name() { return 'Polygon'; } @@ -278,7 +276,7 @@ export default class GeoJsonLayer extends Layer { }; } - static findDefaultLayerProps({label, fields = []}: KeplerTable) { + static findDefaultLayerProps({label, metadata, fields = []}: KeplerTable) { const geojsonColumns = fields .filter(f => f.type === 'geojson' && SUPPORTED_ANALYZER_TYPES[f.analyzerType]) .map(f => f.name); @@ -288,7 +286,7 @@ export default class GeoJsonLayer extends Layer { }; const foundColumns = this.findDefaultColumnField(defaultColumns, fields); - if (!foundColumns || !foundColumns.length) { + if (!foundColumns || !foundColumns.length || metadata.format === 'arrow') { return {props: []}; } @@ -332,9 +330,7 @@ export default class GeoJsonLayer extends Layer { } calculateDataAttribute({dataContainer, filteredIndex}, getPosition) { - return this.meta.isArrow - ? this.dataToFeature - : filteredIndex.map(i => this.dataToFeature[i]).filter(d => d); + return filteredIndex.map(i => this.dataToFeature[i]).filter(d => d); } formatLayerData(datasets, oldLayerData) { @@ -365,107 +361,18 @@ export default class GeoJsonLayer extends Layer { updateLayerMeta(dataContainer) { const getFeature = this.getPositionAccessor(dataContainer); - const feature = getFeature({index: 0}); - const isArrow = feature && 'encoding' in feature; - - if (isArrow) { - // create binary data from arrow data for GeoJsonLayer - const nDim = 2; - const geoColumn = feature.data.parent; - const chunks = geoColumn.chunks; - const dataToFeature: any = []; - let sampleCoordinateArray: any = null; - for (let c = 0; c < chunks.length; c++) { - const geometries = chunks[c]; - const flatCoordinateArray = geometries - .getChildAt(0) - .getChildAt(0) - .getChildAt(0) - .getChildAt(0).data.values; - sampleCoordinateArray = flatCoordinateArray; - const ringOffsets = geometries.getChildAt(0).getChildAt(0).valueOffsets; - const polygonOffsets = ringOffsets; - const numOfPolygon = flatCoordinateArray.length / nDim; - - // create Uint16Array with incremental values starting from 0 - const featureIds = new Uint32Array(numOfPolygon); - for (let i = 0; i < numOfPolygon; i++) { - featureIds[i] = i; - } - const globalFeatureIds = new Uint32Array(numOfPolygon); - for (let i = 0; i < numOfPolygon; i++) { - globalFeatureIds[i] = i + geoColumn._chunkOffsets[c]; - } - dataToFeature.push({ - points: { - globalFeatureIds: {value: [], size: 1}, - positions: {value: [], size: 2}, - properties: [], - numericProps: [], - featureIds: {value: [], size: 1} - }, - lines: { - globalFeatureIds: {value: new Uint32Array(0), size: 1}, - pathIndices: {value: new Uint16Array(0), size: 1}, - positions: {value: new Float32Array(0), size: 2}, - properties: [], - numericProps: [], - featureIds: {value: new Uint32Array(0), size: 1} - }, - polygons: { - globalFeatureIds: {value: globalFeatureIds, size: 1}, - positions: { - value: flatCoordinateArray, - size: nDim - }, - polygonIndices: {value: polygonOffsets, size: 1}, - primitivePolygonIndices: {value: polygonOffsets, size: 1}, - properties: [], - featureIds: {value: featureIds, size: 1}, - numericProps: [], - fields: [] - } - }); - } - this.dataToFeature = dataToFeature; - - // iterate flatCoodrinatesArray to get bounds - const bounds = [Infinity, Infinity, -Infinity, -Infinity]; - const nSamples = - sampleCoordinateArray.length / nDim > 1000 ? 1000 : sampleCoordinateArray.length / 2; - for (let i = 0; i < nSamples; i += nDim) { - const lng = sampleCoordinateArray[i]; - const lat = sampleCoordinateArray[i + 1]; - if (lng < bounds[0]) { - bounds[0] = lng; - } - if (lat < bounds[1]) { - bounds[1] = lat; - } - if (lng > bounds[2]) { - bounds[2] = lng; - } - if (lat > bounds[3]) { - bounds[3] = lat; - } - } - const fixedRadius = false; - const featureTypes = {polygon: true, point: false, line: false}; - this.updateMeta({bounds, fixedRadius, featureTypes, isArrow}); - } else { - this.dataToFeature = getGeojsonDataMaps(dataContainer, getFeature); - // get bounds from features - const bounds = getGeojsonBounds(this.dataToFeature); - // if any of the feature has properties.radius set to be true - const fixedRadius = Boolean( - this.dataToFeature.find(d => d && d.properties && d.properties.radius) - ); - - // keep a record of what type of geometry the collection has - const featureTypes = getGeojsonFeatureTypes(this.dataToFeature); - - this.updateMeta({bounds, fixedRadius, featureTypes, isArrow}); - } + this.dataToFeature = getGeojsonDataMaps(dataContainer, getFeature); + // get bounds from features + const bounds = getGeojsonBounds(this.dataToFeature); + // if any of the feature has properties.radius set to be true + const fixedRadius = Boolean( + this.dataToFeature.find(d => d && d.properties && d.properties.radius) + ); + + // keep a record of what type of geometry the collection has + const featureTypes = getGeojsonFeatureTypes(this.dataToFeature); + + this.updateMeta({bounds, fixedRadius, featureTypes}); } setInitialLayerConfig({dataContainer}) { @@ -505,7 +412,7 @@ export default class GeoJsonLayer extends Layer { renderLayer(opts) { const {data, gpuFilter, objectHovered, mapState, interactionConfig} = opts; - const {fixedRadius, featureTypes, isArrow} = this.meta; + const {fixedRadius, featureTypes} = this.meta; const radiusScale = this.getRadiusScaleByZoom(mapState, fixedRadius); const zoomFactor = this.getZoomFactor(mapState); const eleZoomFactor = this.getElevationZoomFactor(mapState); @@ -532,70 +439,35 @@ export default class GeoJsonLayer extends Layer { const pickable = interactionConfig.tooltip.enabled; const hoveredObject = this.hasHoveredObject(objectHovered); - const geojsonLayers = isArrow ? - data.data.map((d, i) => { - return new DeckGLGeoJsonLayer({ - ...defaultLayerProps, - ...layerProps, - ...data, - data: d, - id: `${this.id}-${i}`, - pickable, - highlightColor: HIGHLIGH_COLOR_3D, - autoHighlight: visConfig.enable3d && pickable, - stroked: visConfig.stroked, - filled: visConfig.filled, - extruded: visConfig.enable3d, - wireframe: visConfig.wireframe, - wrapLongitude: false, - lineMiterLimit: 2, - capRounded: true, - jointRounded: true, - updateTriggers, - _subLayerProps: { - ...(featureTypes?.polygon ? { 'polygons-stroke': opaOverwrite } : {}), - ...(featureTypes?.line ? { linestrings: opaOverwrite } : {}), - ...(featureTypes?.point - ? { - points: { - lineOpacity: visConfig.strokeOpacity - } - } - : {}) - } - }); - }) : [ - new DeckGLGeoJsonLayer({ - ...defaultLayerProps, - ...layerProps, - ...data, - pickable, - highlightColor: HIGHLIGH_COLOR_3D, - autoHighlight: visConfig.enable3d && pickable, - stroked: visConfig.stroked, - filled: visConfig.filled, - extruded: visConfig.enable3d, - wireframe: visConfig.wireframe, - wrapLongitude: false, - lineMiterLimit: 2, - capRounded: true, - jointRounded: true, - updateTriggers, - _subLayerProps: { - ...(featureTypes?.polygon ? { 'polygons-stroke': opaOverwrite } : {}), - ...(featureTypes?.line ? { linestrings: opaOverwrite } : {}), - ...(featureTypes?.point - ? { + return [ + new DeckGLGeoJsonLayer({ + ...defaultLayerProps, + ...layerProps, + ...data, + pickable, + highlightColor: HIGHLIGH_COLOR_3D, + autoHighlight: visConfig.enable3d && pickable, + stroked: visConfig.stroked, + filled: visConfig.filled, + extruded: visConfig.enable3d, + wireframe: visConfig.wireframe, + wrapLongitude: false, + lineMiterLimit: 2, + capRounded: true, + jointRounded: true, + updateTriggers, + _subLayerProps: { + ...(featureTypes?.polygon ? {'polygons-stroke': opaOverwrite} : {}), + ...(featureTypes?.line ? {linestrings: opaOverwrite} : {}), + ...(featureTypes?.point + ? { points: { lineOpacity: visConfig.strokeOpacity } } - : {}) - } - }) - ]; - return [ - ...geojsonLayers, + : {}) + } + }), // hover layer ...(hoveredObject && !visConfig.enable3d ? [ diff --git a/src/layers/src/geojson-layer/geojson-utils.ts b/src/layers/src/geojson-layer/geojson-utils.ts index cfb3fdc9dc..8de540ab49 100644 --- a/src/layers/src/geojson-layer/geojson-utils.ts +++ b/src/layers/src/geojson-layer/geojson-utils.ts @@ -24,26 +24,17 @@ import {parseSync} from '@loaders.gl/core'; import {WKBLoader, WKTLoader} from '@loaders.gl/wkt'; import {binaryToGeometry} from '@loaders.gl/gis'; import {Feature, BBox} from 'geojson'; -import { - getSampleData, - parseGeometryFromArrow, - FeatureTypes, - RawArrowFeature -} from '@kepler.gl/utils'; +import {getSampleData, FeatureTypes} from '@kepler.gl/utils'; export type GetFeature = (d: any) => Feature; -export type GeojsonDataMaps = Array | {points?: any, lines?: any, polygons?: any}; +export type GeojsonDataMaps = Array; type FeatureTypeMap = { [key in FeatureTypes]: boolean; }; -export function parseGeoJsonRawFeature(rawFeature: {} | Feature | RawArrowFeature): Feature | null { +export function parseGeoJsonRawFeature(rawFeature: {} | Feature): Feature | null { if (rawFeature && typeof rawFeature === 'object') { - if ('encoding' in rawFeature && rawFeature.encoding) { - // Support GeoArrow data - return parseGeometryFromArrow(rawFeature); - } // Support GeoJson feature as object // probably need to normalize it as well const normalized = normalize(rawFeature); @@ -70,6 +61,7 @@ export function parseGeoJsonRawFeature(rawFeature: {} | Feature | RawArrowFeatur return null; } + /** * Parse raw data to GeoJson feature * @param dataContainer diff --git a/src/layers/src/index.ts b/src/layers/src/index.ts index df1212bcae..53b0fffd92 100644 --- a/src/layers/src/index.ts +++ b/src/layers/src/index.ts @@ -31,6 +31,7 @@ import {default as LineLayer} from './line-layer/line-layer'; import {default as GridLayer} from './grid-layer/grid-layer'; export {pointToPolygonGeo} from './grid-layer/grid-utils'; import {default as HexagonLayer} from './hexagon-layer/hexagon-layer'; +import {default as ArrowLayer} from './arrow-layer/arrow-layer'; import {default as GeojsonLayer} from './geojson-layer/geojson-layer'; export {defaultElevation, defaultLineWidth, defaultRadius} from './geojson-layer/geojson-layer'; import {default as ClusterLayer} from './cluster-layer/cluster-layer'; @@ -71,6 +72,7 @@ export const KeplerGlLayers = { GridLayer, HexagonLayer, GeojsonLayer, + ArrowLayer, ClusterLayer, IconLayer, HeatmapLayer, @@ -88,6 +90,7 @@ export const LayerClasses = { [LAYER_TYPES.grid]: GridLayer, [LAYER_TYPES.hexagon]: HexagonLayer, [LAYER_TYPES.geojson]: GeojsonLayer, + [LAYER_TYPES.geoarrow]: ArrowLayer, [LAYER_TYPES.cluster]: ClusterLayer, [LAYER_TYPES.icon]: IconLayer, [LAYER_TYPES.heatmap]: HeatmapLayer, diff --git a/src/localization/src/translations/en.ts b/src/localization/src/translations/en.ts index 927855e345..b118452e7a 100644 --- a/src/localization/src/translations/en.ts +++ b/src/localization/src/translations/en.ts @@ -120,6 +120,7 @@ export default { hexbin: 'hexbin', polygon: 'polygon', geojson: 'geojson', + geoarrow: 'geoarrow', cluster: 'cluster', icon: 'icon', heatmap: 'heatmap', diff --git a/src/processors/src/data-processor.ts b/src/processors/src/data-processor.ts index 8c3130ee85..bd8098d7ee 100644 --- a/src/processors/src/data-processor.ts +++ b/src/processors/src/data-processor.ts @@ -255,7 +255,7 @@ export function parseCsvRowsByFieldType( * } * })); */ -export function processRowObject(rawData: unknown[]): ProcessorResult { +export function processRowObject(rawData: object[]): ProcessorResult { if (!Array.isArray(rawData)) { return null; } else if (!rawData.length) { @@ -418,8 +418,7 @@ export function processArrowTable(arrowTable: ApacheArrowTable): ProcessorResult // check if schema_version in geoMeta equals to '0.1.0' const SCHEMA_VERSION = '0.1.0'; if (geoMeta.schema_version !== SCHEMA_VERSION) { - Console.error('Apache Arrow schema version not supported'); - return null; + Console.warn('Apache Arrow schema version not supported'); } // get all geometry columns geometryColumns = geoMeta.columns; @@ -427,22 +426,19 @@ export function processArrowTable(arrowTable: ApacheArrowTable): ProcessorResult const fields: Field[] = []; - // parse fields and convert columnar to row format table - const rowFormatTable: any[][] = []; - const columnarTable: {[name: string]: ArrowColumn} = {}; + // parse fields arrowTable.schema.fields.forEach((field: ArrowField, index: number) => { - const arrowColumn = arrowTable.getColumn(field.name); - columnarTable[field.name] = arrowColumn; + const isGeometryColumn = + geometryColumns[field.name] !== undefined || + field.metadata.get('ARROW:extension:name')?.startsWith('geoarrow'); fields.push({ name: field.name, id: field.name, displayName: field.name, format: '', fieldIdx: index, - type: geometryColumns[field.name] - ? ALL_FIELD_TYPES.geojson - : arrowDataTypeToFieldType(field.type), - analyzerType: geometryColumns[field.name] + type: isGeometryColumn ? ALL_FIELD_TYPES.geojson : arrowDataTypeToFieldType(field.type), + analyzerType: isGeometryColumn ? AnalyzerDATA_TYPES.GEOMETRY : arrowDataTypeToAnalyzerDataType(field.type), valueAccessor: (dc: any) => d => { @@ -451,29 +447,8 @@ export function processArrowTable(arrowTable: ApacheArrowTable): ProcessorResult }); }); - const tableRowsCount = arrowTable.length; - const tableKeys = Object.keys(columnarTable); - for (let index = 0; index < tableRowsCount; index++) { - const tableItem: unknown[] = []; - for (let keyIndex = 0; keyIndex < tableKeys.length; keyIndex++) { - const fieldName = tableKeys[keyIndex]; - const cellValue = columnarTable[fieldName].get(index); - if (geometryColumns[fieldName]) { - cellValue.parent = columnarTable[fieldName]; - } - tableItem.push( - geometryColumns[fieldName] - ? { - encoding: geometryColumns[fieldName].encoding, - data: cellValue - } - : cellValue - ); - } - rowFormatTable.push(tableItem); - } - - return {fields, rows: rowFormatTable}; + // return empty rows and use raw arrow table to construct column-wise data container + return {fields, rows: [], rawData: arrowTable}; } export const DATASET_HANDLERS = { diff --git a/src/table/src/kepler-table.ts b/src/table/src/kepler-table.ts index f0083f6603..99708b268a 100644 --- a/src/table/src/kepler-table.ts +++ b/src/table/src/kepler-table.ts @@ -41,12 +41,13 @@ import { import {getGpuFilterProps, getDatasetFieldIndexForFilter} from './gpu-filter-utils'; -import {Layer} from '@kepler.gl/layers'; +import { Layer } from '@kepler.gl/layers'; import { generateHashId, getSortingFunction, timeToUnixMilli, createDataContainer, + DataForm, diffFilters, filterDataByFilterTypes, FilterResult, @@ -147,8 +148,13 @@ class KeplerTable { // return this; // } - // @ts-expect-error - const dataContainer = createDataContainer(data.rows, {fields: data.fields}); + const isArrow = info?.format === 'arrow'; + const dataContainer = createDataContainer( + isArrow ? data.rawData._children : data.rows, { + // @ts-expect-error + fields: data.fields, + inputDataFormat: isArrow ? DataForm.COLS_ARRAY : DataForm.ROWS_ARRAY + }); const datasetInfo = { id: generateHashId(4), diff --git a/src/types/actions.d.ts b/src/types/actions.d.ts index 8c96a77962..59160d2dad 100644 --- a/src/types/actions.d.ts +++ b/src/types/actions.d.ts @@ -45,6 +45,7 @@ export type ProtoDataset = { id?: string; }[]; rows: any[][]; + rawData?: any; }; // table-injected metadata diff --git a/src/utils/src/arrow-data-container.ts b/src/utils/src/arrow-data-container.ts new file mode 100644 index 0000000000..f4bc5c1580 --- /dev/null +++ b/src/utils/src/arrow-data-container.ts @@ -0,0 +1,186 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import {Column as ArrowColumn} from 'apache-arrow'; +import {DataRow, SharedRowOptions} from './data-row'; +import {Field} from '@kepler.gl/types'; +import {DataContainerInterface, RangeOptions} from './data-container-interface'; + +type ArrowDataContainerInput = { + cols: ArrowColumn[]; + fields?: Field[]; +}; + +/** + * @param dataContainer + * @param sharedRow + */ +function* rowsIterator(dataContainer: DataContainerInterface, sharedRow: SharedRowOptions) { + const numRows = dataContainer.numRows(); + for (let rowIndex = 0; rowIndex < numRows; ++rowIndex) { + yield dataContainer.row(rowIndex, sharedRow); + } +} + +/** + * @param dataContainer + * @param columnIndex + */ +function* columnIterator(dataContainer: DataContainerInterface, columnIndex: number) { + const numRows = dataContainer.numRows(); + for (let rowIndex = 0; rowIndex < numRows; ++rowIndex) { + yield dataContainer.valueAt(rowIndex, columnIndex); + } +} + +/** + * A data container where all data is stored in raw Arrow table + */ +export class ArrowDataContainer implements DataContainerInterface { + _cols: ArrowColumn[]; + _numColumns: number; + _numRows: number; + + constructor(data: ArrowDataContainerInput) { + if (!data.cols) { + throw Error('ArrowDataContainer: no columns provided'); + } + + if (!Array.isArray(data.cols)) { + throw Error("ArrowDataContainer: columns object isn't an array"); + } + + this._cols = data.cols; + this._numColumns = data.cols.length; + this._numRows = data.cols[0].length; + } + + numRows(): number { + return this._numRows; + } + + numColumns(): number { + return this._numColumns; + } + + valueAt(rowIndex: number, columnIndex: number): any { + return this._cols[columnIndex].get(rowIndex); + } + + row(rowIndex: number, sharedRow?: SharedRowOptions): DataRow { + const tSharedRow = DataRow.createSharedRow(sharedRow); + if (tSharedRow) { + tSharedRow.setSource(this, rowIndex); + return tSharedRow; + } + + return new DataRow(this, rowIndex); + } + + rowAsArray(rowIndex: number): any[] { + return this._cols.map(col => col.get(rowIndex)); + } + + rows(sharedRow: SharedRowOptions) { + const tSharedRow = DataRow.createSharedRow(sharedRow); + return rowsIterator(this, tSharedRow); + } + + column(columnIndex: number) { + return columnIterator(this, columnIndex); + } + + getColumn(columnIndex: number): ArrowColumn { + return this._cols[columnIndex]; + } + + flattenData(): any[][] { + const data: any[][] = []; + for (let i = 0; i < this._numRows; ++i) { + data.push(this.rowAsArray(i)); + } + return data; + } + + getPlainIndex(): number[] { + return [...Array(this._numRows).keys()]; + } + + map( + func: (row: DataRow, index: number) => T, + sharedRow?: SharedRowOptions, + options: RangeOptions = {} + ): T[] { + const tSharedRow = DataRow.createSharedRow(sharedRow); + + const {start = 0, end = this.numRows()} = options; + const endRow = Math.min(this.numRows(), end); + + const out: T[] = []; + for (let rowIndex = start; rowIndex < endRow; ++rowIndex) { + const row = this.row(rowIndex, tSharedRow); + out.push(func(row, rowIndex)); + } + return out; + } + + mapIndex( + func: ({index}, dc: DataContainerInterface) => T, + options: RangeOptions = {} + ): T[] { + const {start = 0, end = this.numRows()} = options; + const endRow = Math.min(this.numRows(), end); + + const out: T[] = []; + for (let rowIndex = start; rowIndex < endRow; ++rowIndex) { + out.push(func({index: rowIndex}, this)); + } + return out; + } + + find( + func: (row: DataRow, index: number) => boolean, + sharedRow?: SharedRowOptions + ): DataRow | undefined { + const tSharedRow = DataRow.createSharedRow(sharedRow); + + for (let rowIndex = 0; rowIndex < this._numRows; ++rowIndex) { + const row = this.row(rowIndex, tSharedRow); + if (func(row, rowIndex)) { + return row; + } + } + return undefined; + } + + reduce( + func: (acc: T, row: DataRow, index: number) => T, + initialValue: T, + sharedRow?: SharedRowOptions + ): T { + const tSharedRow = DataRow.createSharedRow(sharedRow); + + for (let rowIndex = 0; rowIndex < this._numRows; ++rowIndex) { + const row = this.row(rowIndex, tSharedRow); + initialValue = func(initialValue, row, rowIndex); + } + return initialValue; + } +} diff --git a/src/utils/src/arrow-utils.ts b/src/utils/src/arrow-utils.ts index 48c996e96d..bbd5d5a34f 100644 --- a/src/utils/src/arrow-utils.ts +++ b/src/utils/src/arrow-utils.ts @@ -18,37 +18,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {ListVector, FloatVector} from 'apache-arrow'; -import Console from 'global/console'; -import normalize from '@mapbox/geojson-normalize'; -import {parseSync} from '@loaders.gl/core'; -import {WKBLoader, WKTLoader} from '@loaders.gl/wkt'; -import {binaryToGeometry} from '@loaders.gl/gis'; - -import { - Feature, - MultiPolygon, - Position, - Polygon, - MultiPoint, - Point, - MultiLineString, - LineString -} from 'geojson'; - -export enum FeatureTypes { - Point = 'Point', - MultiPoint = 'MultiPoint', - LineString = 'LineString', - MultiLineString = 'MultiLineString', - Polygon = 'Polygon', - MultiPolygon = 'MultiPolygon' -} - -export type RawArrowFeature = { - encoding?: string; - data: any; -}; +import {ListVector, Float64Vector, Column as ArrowColumn} from 'apache-arrow'; +import {BinaryFeatures} from '@loaders.gl/schema'; export enum GEOARROW_ENCODINGS { MULTI_POLYGON = 'geoarrow.multipolygon', @@ -56,212 +27,207 @@ export enum GEOARROW_ENCODINGS { MULTI_LINESTRING = 'geoarrow.multilinestring', LINESTRING = 'geoarrow.linestring', MULTI_POINT = 'geoarrow.multipoint', - POINT = 'geoarrow.point', - WKB = 'wkb', - WKT = 'wkt' + POINT = 'geoarrow.point' } /** - * convert Arrow MultiPolygon to geojson Feature + * get geoarrow encoding from geoarrow column */ -function arrowMultiPolygonToFeature(arrowMultiPolygon: ListVector): MultiPolygon { - const multiPolygon: Position[][][] = []; - for (let m = 0; m < arrowMultiPolygon.length; m++) { - const arrowPolygon = arrowMultiPolygon.get(m); - const polygon: Position[][] = []; - for (let i = 0; arrowPolygon && i < arrowPolygon?.length; i++) { - const arrowRing = arrowPolygon?.get(i); - const ring: Position[] = []; - for (let j = 0; arrowRing && j < arrowRing.length; j++) { - const arrowCoord = arrowRing.get(j); - const coord: Position = Array.from(arrowCoord); - ring.push(coord); - } - polygon.push(ring); - } - multiPolygon.push(polygon); +function getGeoArrowEncoding(column: ArrowColumn): string { + const {metadata} = column; + if (metadata && metadata.get('ARROW:extension:name')) { + return metadata.get('ARROW:extension:name') || ''; } - const geometry: MultiPolygon = { - type: FeatureTypes.MultiPolygon, - coordinates: multiPolygon - }; - return geometry; + return ''; } -/** - * convert Arrow Polygon to geojson Feature - */ -function arrowPolygonToFeature(arrowPolygon: ListVector): Polygon { - const polygon: Position[][] = []; - for (let i = 0; arrowPolygon && i < arrowPolygon.length; i++) { - const arrowRing = arrowPolygon.get(i); - const ring: Position[] = []; - for (let j = 0; arrowRing && j < arrowRing.length; j++) { - const arrowCoord = arrowRing.get(j); - const coords: Position = Array.from(arrowCoord); - ring.push(coords); +function updateBoundsFromGeoArrowSamples( + flatCoords: Float64Array, + nDim: number, + bounds: [number, number, number, number], + sampleSize: number = 1000 +) { + const numberOfFeatures = flatCoords.length / nDim; + const sampleStep = Math.max(Math.floor(numberOfFeatures / sampleSize), 1); + + for (let i = 0; i < numberOfFeatures; i += sampleStep) { + const lng = flatCoords[i * nDim]; + const lat = flatCoords[i * nDim + 1]; + if (lng < bounds[0]) { + bounds[0] = lng; } - polygon.push(ring); - } - const geometry: Polygon = { - type: FeatureTypes.Polygon, - coordinates: polygon - }; - return geometry; -} - -/** - * convert Arrow MultiPoint to geojson MultiPoint - */ -function arrowMultiPointToFeature(arrowMultiPoint: ListVector): MultiPoint { - const multiPoint: Position[] = []; - for (let i = 0; arrowMultiPoint && i < arrowMultiPoint.length; i++) { - const arrowPoint = arrowMultiPoint.get(i); - if (arrowPoint) { - const coord: Position = Array.from(arrowPoint); - multiPoint.push(coord); + if (lat < bounds[1]) { + bounds[1] = lat; + } + if (lng > bounds[2]) { + bounds[2] = lng; + } + if (lat > bounds[3]) { + bounds[3] = lat; } } - const geometry: MultiPoint = { - type: FeatureTypes.MultiPoint, - coordinates: multiPoint - }; - return geometry; } -/** - * convert Arrow Point to geojson Point - */ -function arrowPointToFeature(arrowPoint: FloatVector): Point { - const point: Position = Array.from(arrowPoint.values); - const geometry: Point = { - type: FeatureTypes.Point, - coordinates: point - }; - return geometry; -} +const BINARY_GEOMETRY_TEMPLATE = { + globalFeatureIds: {value: new Uint32Array(0), size: 1}, + positions: {value: new Float32Array(0), size: 2}, + properties: [], + numericProps: {}, + featureIds: {value: new Uint32Array(0), size: 1} +}; -/** - * convert Arrow MultiLineString to geojson MultiLineString - */ -function arrowMultiLineStringToFeature(arrowMultiLineString: ListVector): MultiLineString { - const multiLineString: Position[][] = []; - for (let i = 0; arrowMultiLineString && i < arrowMultiLineString.length; i++) { - const arrowLineString = arrowMultiLineString.get(i); - const lineString: Position[] = []; - for (let j = 0; arrowLineString && j < arrowLineString.length; j++) { - const arrowCoord = arrowLineString.get(j); - if (arrowCoord) { - const coords: Position = Array.from(arrowCoord); - lineString.push(coords); - } - } - multiLineString.push(lineString); - } - const geometry: MultiLineString = { - type: FeatureTypes.MultiLineString, - coordinates: multiLineString +function getBinaryPolygonsFromChunk(chunk: ListVector, geoEncoding: string) { + const isMultiPolygon = geoEncoding === GEOARROW_ENCODINGS.MULTI_POLYGON; + + const polygonData = isMultiPolygon ? chunk.getChildAt(0) : chunk; + const ringData = polygonData?.getChildAt(0) as ListVector; + const pointData = ringData?.getChildAt(0); + const coordData = pointData?.getChildAt(0) as ListVector; + + const nDim = pointData?.type.listSize || 2; + const geomOffset = ringData?.valueOffsets; + const flatCoordinateArray = coordData.values as Float64Array; + + return { + flatCoordinateArray, + nDim, + geomOffset }; - return geometry; } -/** - * convert Arrow LineString to geojson LineString - */ -function arrowLineStringToFeature(arrowLineString: ListVector): LineString { - const lineString: Position[] = []; - for (let i = 0; arrowLineString && i < arrowLineString.length; i++) { - const arrowCoord = arrowLineString.get(i); - if (arrowCoord) { - const coords: Position = Array.from(arrowCoord); - lineString.push(coords); - } - } - const geometry: LineString = { - type: FeatureTypes.LineString, - coordinates: lineString +function getBinaryLinesFromChunk(chunk: ListVector, geoEncoding: string) { + const isMultiLineString = geoEncoding === GEOARROW_ENCODINGS.MULTI_LINESTRING; + + const lineData = (isMultiLineString ? chunk.getChildAt(0) : chunk) as ListVector; + const pointData = lineData?.getChildAt(0); + const coordData = pointData?.getChildAt(0) as Float64Vector; + + const nDim = pointData?.type.listSize || 2; + const geomOffset = lineData?.valueOffsets; + const flatCoordinateArray = coordData.values as Float64Array; + + return { + flatCoordinateArray, + nDim, + geomOffset }; - return geometry; } -/** - * convert Arrow wkb to geojson Geometry - */ -function arrowWkbToFeature(arrowWkb: Uint8Array): Feature | null { - const binaryGeo = parseSync(arrowWkb, WKBLoader); - const geometry = binaryToGeometry(binaryGeo); - const normalized = normalize(geometry); +function getBinaryPointsFromChunk(chunk: ListVector, geoEncoding: string) { + const isMultiPoint = geoEncoding === GEOARROW_ENCODINGS.MULTI_POINT; - if (!normalized || !Array.isArray(normalized.features)) { - // fail to normalize geojson - return null; - } + const pointData = (isMultiPoint ? chunk.getChildAt(0) : chunk) as ListVector; + const coordData = pointData?.getChildAt(0) as ListVector; - return normalized.features[0]; -} + const nDim = pointData?.type.listSize || 2; + const geomOffset = pointData?.valueOffsets; + const flatCoordinateArray = coordData.values as Float64Array; -/** - * convert Arrow wkt to geojson Geometry - */ -function arrowWktToFeature(arrowWkt: string): Feature | null { - const geometry = parseSync(arrowWkt, WKTLoader); - const normalized = normalize(geometry); + return { + flatCoordinateArray, + nDim, + geomOffset + }; +} - if (!normalized || !Array.isArray(normalized.features)) { - // fail to normalize geojson - return null; +function getBinaryGeometriesFromChunk(chunk: ListVector, geoEncoding: string) { + if (geoEncoding === GEOARROW_ENCODINGS.POINT || geoEncoding === GEOARROW_ENCODINGS.MULTI_POINT) { + return getBinaryPointsFromChunk(chunk, geoEncoding); + } else if ( + geoEncoding === GEOARROW_ENCODINGS.LINESTRING || + geoEncoding === GEOARROW_ENCODINGS.MULTI_LINESTRING + ) { + return getBinaryLinesFromChunk(chunk, geoEncoding); + } else if ( + geoEncoding === GEOARROW_ENCODINGS.POLYGON || + geoEncoding === GEOARROW_ENCODINGS.MULTI_POLYGON + ) { + return getBinaryPolygonsFromChunk(chunk, geoEncoding); } - - return normalized.features[0]; + throw Error('invalid geoarrow encoding'); } /** - * parse geometry from arrow data that is returned from processArrowData() - * - * @param rawData the raw geometry data returned from processArrowData, which is an object with two properties: encoding and data - * @see processArrowData - * @returns + * get binary geometries from geoarrow polygon column */ -export function parseGeometryFromArrow(rawData: RawArrowFeature): Feature | null { - const encoding = rawData.encoding?.toLowerCase(); - const data = rawData.data; - if (!encoding || !data) return null; - - let geometry; +export function getBinaryGeometriesFromGeoArrowPolygon( + geoColumn: ArrowColumn +): { + binaryGeometries: BinaryFeatures[]; + bounds: [number, number, number, number]; + featureTypes: {polygon: boolean; point: boolean; line: boolean}; +} { + const geoEncoding = getGeoArrowEncoding(geoColumn); + const featureTypes = { + polygon: + geoEncoding === GEOARROW_ENCODINGS.MULTI_POLYGON || + geoEncoding === GEOARROW_ENCODINGS.POLYGON, + point: + geoEncoding === GEOARROW_ENCODINGS.MULTI_LINESTRING || + geoEncoding === GEOARROW_ENCODINGS.LINESTRING, + line: geoEncoding === GEOARROW_ENCODINGS.MULTI_POINT || geoEncoding === GEOARROW_ENCODINGS.POINT + }; - switch (encoding) { - case GEOARROW_ENCODINGS.MULTI_POLYGON: - geometry = arrowMultiPolygonToFeature(data); - break; - case GEOARROW_ENCODINGS.POLYGON: - geometry = arrowPolygonToFeature(data); - break; - case GEOARROW_ENCODINGS.MULTI_POINT: - geometry = arrowMultiPointToFeature(data); - break; - case GEOARROW_ENCODINGS.POINT: - geometry = arrowPointToFeature(data); - break; - case GEOARROW_ENCODINGS.MULTI_LINESTRING: - geometry = arrowMultiLineStringToFeature(data); - break; - case GEOARROW_ENCODINGS.LINESTRING: - geometry = arrowLineStringToFeature(data); - break; - case GEOARROW_ENCODINGS.WKB: { - return arrowWkbToFeature(data); - } - case GEOARROW_ENCODINGS.WKT: { - return arrowWktToFeature(data); + const bounds: [number, number, number, number] = [Infinity, Infinity, -Infinity, -Infinity]; + const chunks = geoColumn.chunks; + let globalFeatureIdOffset = 0; + const binaryGeometries: BinaryFeatures[] = []; + + for (let c = 0; c < chunks.length; c++) { + const geometries = chunks[c] as ListVector; + const {flatCoordinateArray, nDim, geomOffset} = getBinaryGeometriesFromChunk( + geometries, + geoEncoding + ); + + const numOfFeatures = flatCoordinateArray.length / nDim; + const featureIds = new Uint32Array(numOfFeatures); + for (let i = 0; i < geomOffset.length; i++) { + for (let j = geomOffset[i]; j < geomOffset[i + 1]; j++) { + featureIds[j] = i; + } } - default: { - Console.error('GeoArrow encoding not supported'); - return null; + const globalFeatureIds = new Uint32Array(numOfFeatures); + for (let i = 0; i < geomOffset.length; i++) { + for (let j = geomOffset[i]; j < geomOffset[i + 1]; j++) { + globalFeatureIds[j] = i + globalFeatureIdOffset; + } } + globalFeatureIdOffset += geometries.length; + + const binaryContent = { + globalFeatureIds: {value: globalFeatureIds, size: 1}, + positions: { + value: flatCoordinateArray, + size: nDim + }, + featureIds: {value: featureIds, size: 1} + }; + + // TODO: deck.gl defines the BinaryFeatures structure must have points, lines, polygons even if they are empty + binaryGeometries.push({ + points: { + type: 'Point', + ...BINARY_GEOMETRY_TEMPLATE, + ...(featureTypes.point ? binaryContent : {}) + }, + lines: { + type: 'LineString', + ...BINARY_GEOMETRY_TEMPLATE, + ...(featureTypes.line ? binaryContent : {}), + pathIndices: {value: featureTypes.line ? geomOffset : new Uint16Array(0), size: 1}, + }, + polygons: { + type: 'Polygon', + ...BINARY_GEOMETRY_TEMPLATE, + ...(featureTypes.polygon ? binaryContent : {}), + polygonIndices: {value: featureTypes.polygon ? geomOffset: new Uint16Array(0), size: 1}, + primitivePolygonIndices: {value: featureTypes.polygon ? geomOffset: new Uint16Array(0), size: 1}, + } + }); + + updateBoundsFromGeoArrowSamples(flatCoordinateArray, nDim, bounds); } - return { - type: 'Feature', - geometry, - properties: {} - }; + + return {binaryGeometries, bounds, featureTypes}; } diff --git a/src/utils/src/data-container-interface.ts b/src/utils/src/data-container-interface.ts index 76afd09ca7..74c4cf359f 100644 --- a/src/utils/src/data-container-interface.ts +++ b/src/utils/src/data-container-interface.ts @@ -60,6 +60,13 @@ export interface DataContainerInterface { */ column(columnIndex: number): Generator; + /** + * Returns the column object at the specified index. + * @param columnIndex Column index. + * @returns The column object at the specified index. + */ + getColumn(columnIndex: number): any; + /** * Returns contents of the data container as a two-dimensional array. * @returns Data. diff --git a/src/utils/src/data-container-utils.ts b/src/utils/src/data-container-utils.ts index 1172554fb7..ab2d45e6ab 100644 --- a/src/utils/src/data-container-utils.ts +++ b/src/utils/src/data-container-utils.ts @@ -18,6 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +import {ArrowDataContainer} from './arrow-data-container'; import {RowDataContainer} from './row-data-container'; import {IndexedDataContainer} from './indexed-data-container'; @@ -30,7 +31,8 @@ export type DataContainerOptions = { }; export const DataForm = { - ROWS_ARRAY: 'ROWS_ARRAY' + ROWS_ARRAY: 'ROWS_ARRAY', + COLS_ARRAY: 'COLS_ARRAY' }; const defaultOptions: DataContainerOptions = { @@ -51,6 +53,8 @@ export function createDataContainer( if (options.inputDataFormat === DataForm.ROWS_ARRAY) { return new RowDataContainer({rows: data, fields: options.fields}); + } else if (options.inputDataFormat === DataForm.COLS_ARRAY) { + return new ArrowDataContainer({cols: data, fields: options.fields}); } throw Error('Failed to create a data container: not implemented format'); diff --git a/src/utils/src/dataset-utils.ts b/src/utils/src/dataset-utils.ts index b33ce6140a..fb0cb4c62c 100644 --- a/src/utils/src/dataset-utils.ts +++ b/src/utils/src/dataset-utils.ts @@ -279,7 +279,7 @@ export function validateInputData(data: Record): ProcessorResul return null; } - const {fields, rows} = data; + const {fields, rows, ...rest} = data; // check if all fields has name, format and type const allValid = fields.every((f, i) => { @@ -315,7 +315,7 @@ export function validateInputData(data: Record): ProcessorResul }); if (allValid) { - return {rows, fields}; + return {rows, fields, ...rest}; } // if any field has missing type, recalculate it for everyone diff --git a/src/utils/src/index.ts b/src/utils/src/index.ts index e43a19c4d7..e1f36630a8 100644 --- a/src/utils/src/index.ts +++ b/src/utils/src/index.ts @@ -107,7 +107,7 @@ export {transformRequest, isStyleUsingMapboxTiles} from './map-style-utils/mapbo // Map export * from './map-utils'; -export {createDataContainer, createIndexedDataContainer, getSampleData as getSampleContainerData} from './data-container-utils'; +export {createDataContainer, createIndexedDataContainer, getSampleData as getSampleContainerData, DataForm} from './data-container-utils'; export type {DataContainerInterface} from './data-container-interface'; export type {FilterResult, FilterChanged, dataValueAccessor} from './filter-utils' export * from "./filter-utils"; From 3087f03b6dd763e4aeec0fb1435d2ac44e9d7999 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Wed, 18 Oct 2023 00:05:23 -0700 Subject: [PATCH 17/29] add hover on arrowlayer --- src/components/src/map-container.tsx | 4 +- src/constants/src/default-settings.ts | 3 +- src/layers/src/arrow-layer/arrow-layer.ts | 116 ++++---- src/layers/src/base-layer.ts | 1 + src/layers/src/geojson-layer/geojson-layer.ts | 19 +- src/processors/src/data-processor.ts | 2 +- src/table/src/kepler-table.ts | 6 +- src/utils/src/arrow-utils.ts | 248 +++++++++++++++++- 8 files changed, 319 insertions(+), 80 deletions(-) diff --git a/src/components/src/map-container.tsx b/src/components/src/map-container.tsx index 5728a7192c..f60261fd22 100644 --- a/src/components/src/map-container.tsx +++ b/src/components/src/map-container.tsx @@ -744,7 +744,7 @@ export default function MapContainerFactory( mapboxApiAccessToken, mapboxApiUrl, layersForDeck, - editorInfo: false + editorInfo: primaryMap ? { editor, editorMenuActive, @@ -940,7 +940,7 @@ export default function MapContainerFactory( // TODO this should be part of onLayerHover arguments, investigate // @ts-ignore (does not fail with local yarn-test) data.mapIndex = index; - + console.log(data); this.props.visStateActions.onLayerHover(data); }, DEBOUNCE_MOUSE_MOVE_PROPAGATE); diff --git a/src/constants/src/default-settings.ts b/src/constants/src/default-settings.ts index fa4ca6734c..d4e4120032 100644 --- a/src/constants/src/default-settings.ts +++ b/src/constants/src/default-settings.ts @@ -430,7 +430,8 @@ export const ALL_FIELD_TYPES = keyMirror({ timestamp: null, point: null, array: null, - object: null + object: null, + geoarrow: null }); // Data Table diff --git a/src/layers/src/arrow-layer/arrow-layer.ts b/src/layers/src/arrow-layer/arrow-layer.ts index abe5b6a129..4f892069bc 100644 --- a/src/layers/src/arrow-layer/arrow-layer.ts +++ b/src/layers/src/arrow-layer/arrow-layer.ts @@ -18,71 +18,47 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import uniq from 'lodash.uniq'; -import {DATA_TYPES} from 'type-analyzer'; -import {Feature} from 'geojson'; - import {BinaryFeatures} from '@loaders.gl/schema'; import {GeoJsonLayer as DeckGLGeoJsonLayer} from '@deck.gl/layers'; -import { - GEOJSON_FIELDS, - HIGHLIGH_COLOR_3D, - CHANNEL_SCALES, - ColorRange, - LAYER_VIS_CONFIGS -} from '@kepler.gl/constants'; -import { - VisConfigNumber, - VisConfigColorSelect, - VisConfigColorRange, - VisConfigRange, - VisConfigBoolean, - Merge, - RGBColor -} from '@kepler.gl/types'; +import {HIGHLIGH_COLOR_3D} from '@kepler.gl/constants'; import {KeplerTable} from '@kepler.gl/table'; -import { DataContainerInterface, getBinaryGeometriesFromGeoArrowPolygon } from '@kepler.gl/utils'; - -import Layer, { - colorMaker, - LayerBaseConfig, - LayerBaseConfigPartial, - LayerColorConfig, - LayerColumn, - LayerHeightConfig, - LayerRadiusConfig, - LayerSizeConfig, - LayerStrokeColorConfig -} from '../base-layer'; import { - getGeojsonDataMaps, - getGeojsonBounds, - getGeojsonFeatureTypes, - GeojsonDataMaps -} from '../geojson-layer/geojson-utils'; -import GeoJsonLayer, {SUPPORTED_ANALYZER_TYPES} from '../geojson-layer/geojson-layer'; + DataContainerInterface, + getBinaryGeometriesFromGeoArrowPolygon, + parseGeometryFromArrow +} from '@kepler.gl/utils'; +import {Merge} from '@kepler.gl/types'; + +import {LayerColumn, LayerBaseConfig} from '../base-layer'; +import GeoJsonLayer, { + SUPPORTED_ANALYZER_TYPES, + GeoJsonLayerVisConfig, + GeoJsonLayerVisualChannelConfig +} from '../geojson-layer/geojson-layer'; export default class ArrowLayer extends GeoJsonLayer { - dataToFeature: BinaryFeatures[]; + binaryFeatures: BinaryFeatures[]; + dataContainer: DataContainerInterface | null; // constructor constructor(props) { super(props); - this.dataToFeature = []; + this.dataContainer = null; + this.binaryFeatures = []; } - static findDefaultLayerProps({label, metadata, fields = []}: KeplerTable) { - const geojsonColumns = fields - .filter(f => f.type === 'geojson' && SUPPORTED_ANALYZER_TYPES[f.analyzerType]) + static findDefaultLayerProps({label, fields = []}: KeplerTable) { + const geoarrowColumns = fields + .filter(f => f.type === 'geoarrow' && SUPPORTED_ANALYZER_TYPES[f.analyzerType]) .map(f => f.name); const defaultColumns = { - geojson: uniq([...GEOJSON_FIELDS.geojson, ...geojsonColumns]) + geojson: geoarrowColumns }; const foundColumns = this.findDefaultColumnField(defaultColumns, fields); - if (!foundColumns || !foundColumns.length || metadata.format !== 'arrow') { + if (!foundColumns || !foundColumns.length) { return {props: []}; } @@ -106,13 +82,19 @@ export default class ArrowLayer extends GeoJsonLayer { return 'GeoArrow'; } + get requiredLayerColumns() { + return ['geojson']; + } + calculateDataAttribute({dataContainer, filteredIndex}, getPosition) { // TODO: filter arrow table using predicate // filteredIndex.map(i => this.dataToFeature[i]).filter(d => d); - return this.dataToFeature; + this.dataContainer = dataContainer; + return this.binaryFeatures; } updateLayerMeta(dataContainer: DataContainerInterface) { + this.dataContainer = dataContainer; const {geojson} = this.config.columns; const geoColumn = dataContainer.getColumn(geojson.fieldIdx); @@ -120,12 +102,49 @@ export default class ArrowLayer extends GeoJsonLayer { const {binaryGeometries, bounds, featureTypes} = getBinaryGeometriesFromGeoArrowPolygon( geoColumn ); - this.dataToFeature = binaryGeometries; + this.binaryFeatures = binaryGeometries; const fixedRadius = false; this.updateMeta({bounds, fixedRadius, featureTypes}); } + isLayerHovered(objectInfo): boolean { + // there could be multiple deck.gl layers created from multiple chunks in arrow table + // the objectInfo.layer id should be `${this.id}-${i}` + if (objectInfo?.picked) { + const deckLayerId = objectInfo?.layer?.props?.id; + console.log(deckLayerId); + return deckLayerId.startsWith(this.id); + } + return false; + } + + hasHoveredObject(objectInfo) { + // hover object returns the index of the object in the data array + if (this.isLayerHovered(objectInfo) && objectInfo.index >= 0 && this.dataContainer) { + console.time('getHoverData'); + const {geojson} = this.config.columns; + const col = this.dataContainer.getColumn(geojson.fieldIdx); + const rawGeometry = col.get(objectInfo.index); + const hoveredFeature = parseGeometryFromArrow({ + encoding: col.metadata?.get('ARROW:extension:name'), + data: rawGeometry + }); + console.timeEnd('getHoverData'); + return hoveredFeature; + } + return null; + } + + getHoverData(object, dataContainer) { + // index of dataContainer is saved to feature.properties + const index = object; + if (index >= 0) { + return dataContainer.row(index); + } + return null; + } + renderLayer(opts) { const {data, gpuFilter, objectHovered, mapState, interactionConfig} = opts; @@ -155,6 +174,7 @@ export default class ArrowLayer extends GeoJsonLayer { const pickable = interactionConfig.tooltip.enabled; const hoveredObject = this.hasHoveredObject(objectHovered); + console.log(hoveredObject); const deckLayers = data.data.map((d, i) => { return new DeckGLGeoJsonLayer({ diff --git a/src/layers/src/base-layer.ts b/src/layers/src/base-layer.ts index 2541e98018..654bfd1ddf 100644 --- a/src/layers/src/base-layer.ts +++ b/src/layers/src/base-layer.ts @@ -1256,6 +1256,7 @@ class Layer { } hasHoveredObject(objectInfo) { + console.log('objectInfo.object', objectInfo?.object); return this.isLayerHovered(objectInfo) && objectInfo.object ? objectInfo.object : null; } diff --git a/src/layers/src/geojson-layer/geojson-layer.ts b/src/layers/src/geojson-layer/geojson-layer.ts index c387b902dd..97514fb96b 100644 --- a/src/layers/src/geojson-layer/geojson-layer.ts +++ b/src/layers/src/geojson-layer/geojson-layer.ts @@ -152,7 +152,7 @@ export type GeoJsonLayerVisConfig = { wireframe: boolean; }; -type GeoJsonLayerVisualChannelConfig = LayerColorConfig & +export type GeoJsonLayerVisualChannelConfig = LayerColorConfig & LayerStrokeColorConfig & LayerSizeConfig & LayerHeightConfig & @@ -168,7 +168,7 @@ export type GeoJsonLayerMeta = { fixedRadius?: boolean; }; -export const geoJsonRequiredColumns: ['geojson'] = ['geojson']; +export const geoJsonRequiredColumns = ['geojson']; export const featureAccessor = ({geojson}: GeoJsonLayerColumnsConfig) => ( dc: DataContainerInterface ) => d => dc.valueAt(d.index, geojson.fieldIdx); @@ -276,7 +276,7 @@ export default class GeoJsonLayer extends Layer { }; } - static findDefaultLayerProps({label, metadata, fields = []}: KeplerTable) { + static findDefaultLayerProps({label, fields = []}: KeplerTable) { const geojsonColumns = fields .filter(f => f.type === 'geojson' && SUPPORTED_ANALYZER_TYPES[f.analyzerType]) .map(f => f.name); @@ -286,7 +286,7 @@ export default class GeoJsonLayer extends Layer { }; const foundColumns = this.findDefaultColumnField(defaultColumns, fields); - if (!foundColumns || !foundColumns.length || metadata.format === 'arrow') { + if (!foundColumns || !foundColumns.length) { return {props: []}; } @@ -398,17 +398,6 @@ export default class GeoJsonLayer extends Layer { return this; } - hasLayerData(layerData) { - if (!layerData) { - return false; - } - return Boolean( - layerData.data && - (layerData.data.length || - ('points' in layerData.data && 'polygons' in layerData.data && 'lines' in layerData.data)) - ); - } - renderLayer(opts) { const {data, gpuFilter, objectHovered, mapState, interactionConfig} = opts; diff --git a/src/processors/src/data-processor.ts b/src/processors/src/data-processor.ts index bd8098d7ee..c8eef471bb 100644 --- a/src/processors/src/data-processor.ts +++ b/src/processors/src/data-processor.ts @@ -437,7 +437,7 @@ export function processArrowTable(arrowTable: ApacheArrowTable): ProcessorResult displayName: field.name, format: '', fieldIdx: index, - type: isGeometryColumn ? ALL_FIELD_TYPES.geojson : arrowDataTypeToFieldType(field.type), + type: isGeometryColumn ? ALL_FIELD_TYPES.geoarrow: arrowDataTypeToFieldType(field.type), analyzerType: isGeometryColumn ? AnalyzerDATA_TYPES.GEOMETRY : arrowDataTypeToAnalyzerDataType(field.type), diff --git a/src/table/src/kepler-table.ts b/src/table/src/kepler-table.ts index 99708b268a..7f04a400f8 100644 --- a/src/table/src/kepler-table.ts +++ b/src/table/src/kepler-table.ts @@ -149,8 +149,10 @@ class KeplerTable { // } const isArrow = info?.format === 'arrow'; - const dataContainer = createDataContainer( - isArrow ? data.rawData._children : data.rows, { + const dataContainerData = isArrow + ? [...Array(data.rawData?.numCols || 0).keys()].map(i => data.rawData.getColumnAt(i)) + : data.rows + const dataContainer = createDataContainer(dataContainerData, { // @ts-expect-error fields: data.fields, inputDataFormat: isArrow ? DataForm.COLS_ARRAY : DataForm.ROWS_ARRAY diff --git a/src/utils/src/arrow-utils.ts b/src/utils/src/arrow-utils.ts index bbd5d5a34f..761e30cdca 100644 --- a/src/utils/src/arrow-utils.ts +++ b/src/utils/src/arrow-utils.ts @@ -18,8 +18,27 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {ListVector, Float64Vector, Column as ArrowColumn} from 'apache-arrow'; +import {ListVector, FloatVector, Float64Vector, Column as ArrowColumn} from 'apache-arrow'; +import normalize from '@mapbox/geojson-normalize'; import {BinaryFeatures} from '@loaders.gl/schema'; +import {parseSync} from '@loaders.gl/core'; +import {WKBLoader, WKTLoader} from '@loaders.gl/wkt'; +import {binaryToGeometry} from '@loaders.gl/gis'; +import { + Feature, + MultiPolygon, + Position, + Polygon, + MultiPoint, + Point, + MultiLineString, + LineString +} from 'geojson'; + +type RawArrowFeature = { + encoding?: string; + data: any; +}; export enum GEOARROW_ENCODINGS { MULTI_POLYGON = 'geoarrow.multipolygon', @@ -27,7 +46,9 @@ export enum GEOARROW_ENCODINGS { MULTI_LINESTRING = 'geoarrow.multilinestring', LINESTRING = 'geoarrow.linestring', MULTI_POINT = 'geoarrow.multipoint', - POINT = 'geoarrow.point' + POINT = 'geoarrow.point', + WKB = 'geoarrow.wkb', + WKT = 'geoarrow.wkt' } /** @@ -180,18 +201,19 @@ export function getBinaryGeometriesFromGeoArrowPolygon( geoEncoding ); - const numOfFeatures = flatCoordinateArray.length / nDim; - const featureIds = new Uint32Array(numOfFeatures); - for (let i = 0; i < geomOffset.length; i++) { - for (let j = geomOffset[i]; j < geomOffset[i + 1]; j++) { + const numOfVertices = flatCoordinateArray.length / nDim; + const featureIds = new Uint32Array(numOfVertices); + for (let i = 0; i < geometries.length - 1; i++) { + const startIdx = geomOffset[geometries.valueOffsets[i]]; + const endIdx = geomOffset[geometries.valueOffsets[i + 1]]; + for (let j = startIdx; j < endIdx; j++) { featureIds[j] = i; } } - const globalFeatureIds = new Uint32Array(numOfFeatures); - for (let i = 0; i < geomOffset.length; i++) { - for (let j = geomOffset[i]; j < geomOffset[i + 1]; j++) { - globalFeatureIds[j] = i + globalFeatureIdOffset; - } + + const globalFeatureIds = new Uint32Array(numOfVertices); + for (let i = 0; i < numOfVertices; i++) { + globalFeatureIds[i] = featureIds[i] + globalFeatureIdOffset; } globalFeatureIdOffset += geometries.length; @@ -231,3 +253,207 @@ export function getBinaryGeometriesFromGeoArrowPolygon( return {binaryGeometries, bounds, featureTypes}; } + +/** + * convert Arrow MultiPolygon to geojson Feature + */ +function arrowMultiPolygonToFeature(arrowMultiPolygon: ListVector): MultiPolygon { + const multiPolygon: Position[][][] = []; + for (let m = 0; m < arrowMultiPolygon.length; m++) { + const arrowPolygon = arrowMultiPolygon.get(m); + const polygon: Position[][] = []; + for (let i = 0; arrowPolygon && i < arrowPolygon?.length; i++) { + const arrowRing = arrowPolygon?.get(i); + const ring: Position[] = []; + for (let j = 0; arrowRing && j < arrowRing.length; j++) { + const arrowCoord = arrowRing.get(j); + const coord: Position = Array.from(arrowCoord); + ring.push(coord); + } + polygon.push(ring); + } + multiPolygon.push(polygon); + } + const geometry: MultiPolygon = { + type: 'MultiPolygon', + coordinates: multiPolygon + }; + return geometry; +} + +/** + * convert Arrow Polygon to geojson Feature + */ +function arrowPolygonToFeature(arrowPolygon: ListVector): Polygon { + const polygon: Position[][] = []; + for (let i = 0; arrowPolygon && i < arrowPolygon.length; i++) { + const arrowRing = arrowPolygon.get(i); + const ring: Position[] = []; + for (let j = 0; arrowRing && j < arrowRing.length; j++) { + const arrowCoord = arrowRing.get(j); + const coords: Position = Array.from(arrowCoord); + ring.push(coords); + } + polygon.push(ring); + } + const geometry: Polygon = { + type: 'Polygon', + coordinates: polygon + }; + return geometry; +} + +/** + * convert Arrow MultiPoint to geojson MultiPoint + */ +function arrowMultiPointToFeature(arrowMultiPoint: ListVector): MultiPoint { + const multiPoint: Position[] = []; + for (let i = 0; arrowMultiPoint && i < arrowMultiPoint.length; i++) { + const arrowPoint = arrowMultiPoint.get(i); + if (arrowPoint) { + const coord: Position = Array.from(arrowPoint); + multiPoint.push(coord); + } + } + const geometry: MultiPoint = { + type: 'MultiPoint', + coordinates: multiPoint + }; + return geometry; +} + +/** + * convert Arrow Point to geojson Point + */ +function arrowPointToFeature(arrowPoint: FloatVector): Point { + const point: Position = Array.from(arrowPoint.values); + const geometry: Point = { + type: 'Point', + coordinates: point + }; + return geometry; +} + +/** + * convert Arrow MultiLineString to geojson MultiLineString + */ +function arrowMultiLineStringToFeature(arrowMultiLineString: ListVector): MultiLineString { + const multiLineString: Position[][] = []; + for (let i = 0; arrowMultiLineString && i < arrowMultiLineString.length; i++) { + const arrowLineString = arrowMultiLineString.get(i); + const lineString: Position[] = []; + for (let j = 0; arrowLineString && j < arrowLineString.length; j++) { + const arrowCoord = arrowLineString.get(j); + if (arrowCoord) { + const coords: Position = Array.from(arrowCoord); + lineString.push(coords); + } + } + multiLineString.push(lineString); + } + const geometry: MultiLineString = { + type: 'MultiLineString', + coordinates: multiLineString + }; + return geometry; +} + +/** + * convert Arrow LineString to geojson LineString + */ +function arrowLineStringToFeature(arrowLineString: ListVector): LineString { + const lineString: Position[] = []; + for (let i = 0; arrowLineString && i < arrowLineString.length; i++) { + const arrowCoord = arrowLineString.get(i); + if (arrowCoord) { + const coords: Position = Array.from(arrowCoord); + lineString.push(coords); + } + } + const geometry: LineString = { + type: 'LineString', + coordinates: lineString + }; + return geometry; +} + +/** + * convert Arrow wkb to geojson Geometry + */ +function arrowWkbToFeature(arrowWkb: Uint8Array): Feature | null { + const binaryGeo = parseSync(arrowWkb, WKBLoader); + const geometry = binaryToGeometry(binaryGeo); + const normalized = normalize(geometry); + + if (!normalized || !Array.isArray(normalized.features)) { + // fail to normalize geojson + return null; + } + + return normalized.features[0]; +} + +/** + * convert Arrow wkt to geojson Geometry + */ +function arrowWktToFeature(arrowWkt: string): Feature | null { + const geometry = parseSync(arrowWkt, WKTLoader); + const normalized = normalize(geometry); + + if (!normalized || !Array.isArray(normalized.features)) { + // fail to normalize geojson + return null; + } + + return normalized.features[0]; +} + +/** + * parse geometry from arrow data that is returned from processArrowData() + * + * @param rawData the raw geometry data returned from processArrowData, which is an object with two properties: encoding and data + * @see processArrowData + * @returns + */ +export function parseGeometryFromArrow(rawData: RawArrowFeature): Feature | null { + const encoding = rawData.encoding?.toLowerCase(); + const data = rawData.data; + if (!encoding || !data) return null; + + let geometry; + + switch (encoding) { + case GEOARROW_ENCODINGS.MULTI_POLYGON: + geometry = arrowMultiPolygonToFeature(data); + break; + case GEOARROW_ENCODINGS.POLYGON: + geometry = arrowPolygonToFeature(data); + break; + case GEOARROW_ENCODINGS.MULTI_POINT: + geometry = arrowMultiPointToFeature(data); + break; + case GEOARROW_ENCODINGS.POINT: + geometry = arrowPointToFeature(data); + break; + case GEOARROW_ENCODINGS.MULTI_LINESTRING: + geometry = arrowMultiLineStringToFeature(data); + break; + case GEOARROW_ENCODINGS.LINESTRING: + geometry = arrowLineStringToFeature(data); + break; + case GEOARROW_ENCODINGS.WKB: { + return arrowWkbToFeature(data); + } + case GEOARROW_ENCODINGS.WKT: { + return arrowWktToFeature(data); + } + default: { + throw Error('GeoArrow encoding not supported'); + } + } + return { + type: 'Feature', + geometry, + properties: {} + }; +} From 10fe864cfe31f4813e589815f49bc1510c6d8f1d Mon Sep 17 00:00:00 2001 From: Xun Li Date: Wed, 18 Oct 2023 00:28:02 -0700 Subject: [PATCH 18/29] fix table for geoarrow --- src/components/src/map-container.tsx | 1 - src/constants/src/default-settings.ts | 15 +++++++++++++++ src/layers/src/arrow-layer/arrow-layer.ts | 19 +++++++------------ src/layers/src/geojson-layer/geojson-layer.ts | 4 +++- src/reducers/src/interaction-utils.ts | 1 + src/utils/src/data-utils.ts | 1 + 6 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/components/src/map-container.tsx b/src/components/src/map-container.tsx index f60261fd22..26866bd6f3 100644 --- a/src/components/src/map-container.tsx +++ b/src/components/src/map-container.tsx @@ -940,7 +940,6 @@ export default function MapContainerFactory( // TODO this should be part of onLayerHover arguments, investigate // @ts-ignore (does not fail with local yarn-test) data.mapIndex = index; - console.log(data); this.props.visStateActions.onLayerHover(data); }, DEBOUNCE_MOUSE_MOVE_PROPAGATE); diff --git a/src/constants/src/default-settings.ts b/src/constants/src/default-settings.ts index d4e4120032..bf0c593095 100644 --- a/src/constants/src/default-settings.ts +++ b/src/constants/src/default-settings.ts @@ -512,6 +512,10 @@ export const FIELD_TYPE_DISPLAY = { label: 'geo', color: BLUE2 }, + [ALL_FIELD_TYPES.geoarrow]: { + label: 'geo', + color: BLUE2 + }, [ALL_FIELD_TYPES.integer]: { label: 'int', color: YELLOW @@ -746,6 +750,17 @@ export const FIELD_OPTS = { tooltip: [] } }, + [ALL_FIELD_TYPES.geoarrow]: { + type: 'geometry', + scale: { + ...notSupportedScaleOpts, + ...notSupportAggrOpts + }, + format: { + legend: d => '...', + tooltip: [] + } + }, [ALL_FIELD_TYPES.object]: { type: 'numerical', scale: {}, diff --git a/src/layers/src/arrow-layer/arrow-layer.ts b/src/layers/src/arrow-layer/arrow-layer.ts index 4f892069bc..284fe6b51d 100644 --- a/src/layers/src/arrow-layer/arrow-layer.ts +++ b/src/layers/src/arrow-layer/arrow-layer.ts @@ -27,14 +27,8 @@ import { getBinaryGeometriesFromGeoArrowPolygon, parseGeometryFromArrow } from '@kepler.gl/utils'; -import {Merge} from '@kepler.gl/types'; -import {LayerColumn, LayerBaseConfig} from '../base-layer'; -import GeoJsonLayer, { - SUPPORTED_ANALYZER_TYPES, - GeoJsonLayerVisConfig, - GeoJsonLayerVisualChannelConfig -} from '../geojson-layer/geojson-layer'; +import GeoJsonLayer, {SUPPORTED_ANALYZER_TYPES} from '../geojson-layer/geojson-layer'; export default class ArrowLayer extends GeoJsonLayer { binaryFeatures: BinaryFeatures[]; @@ -113,7 +107,6 @@ export default class ArrowLayer extends GeoJsonLayer { // the objectInfo.layer id should be `${this.id}-${i}` if (objectInfo?.picked) { const deckLayerId = objectInfo?.layer?.props?.id; - console.log(deckLayerId); return deckLayerId.startsWith(this.id); } return false; @@ -122,7 +115,6 @@ export default class ArrowLayer extends GeoJsonLayer { hasHoveredObject(objectInfo) { // hover object returns the index of the object in the data array if (this.isLayerHovered(objectInfo) && objectInfo.index >= 0 && this.dataContainer) { - console.time('getHoverData'); const {geojson} = this.config.columns; const col = this.dataContainer.getColumn(geojson.fieldIdx); const rawGeometry = col.get(objectInfo.index); @@ -130,8 +122,12 @@ export default class ArrowLayer extends GeoJsonLayer { encoding: col.metadata?.get('ARROW:extension:name'), data: rawGeometry }); - console.timeEnd('getHoverData'); - return hoveredFeature; + return { + ...hoveredFeature, + properties: { + index: objectInfo.index + } + }; } return null; } @@ -174,7 +170,6 @@ export default class ArrowLayer extends GeoJsonLayer { const pickable = interactionConfig.tooltip.enabled; const hoveredObject = this.hasHoveredObject(objectHovered); - console.log(hoveredObject); const deckLayers = data.data.map((d, i) => { return new DeckGLGeoJsonLayer({ diff --git a/src/layers/src/geojson-layer/geojson-layer.ts b/src/layers/src/geojson-layer/geojson-layer.ts index 97514fb96b..112e060675 100644 --- a/src/layers/src/geojson-layer/geojson-layer.ts +++ b/src/layers/src/geojson-layer/geojson-layer.ts @@ -178,6 +178,8 @@ export const defaultElevation = 500; export const defaultLineWidth = 1; export const defaultRadius = 1; +const defaultThresholdOfBigDataSet = 500000; + export default class GeoJsonLayer extends Layer { declare config: GeoJsonLayerConfig; declare visConfigSettings: GeoJsonVisConfigSettings; @@ -387,7 +389,7 @@ export default class GeoJsonLayer extends Layer { // set both fill and stroke to true return this.updateLayerVisConfig({ filled: true, - stroked: false, + stroked: dataContainer.numRows() < defaultThresholdOfBigDataSet, strokeColor: colorMaker.next().value }); } else if (featureTypes && featureTypes.point) { diff --git a/src/reducers/src/interaction-utils.ts b/src/reducers/src/interaction-utils.ts index cfbf83e6eb..64d7a339a8 100644 --- a/src/reducers/src/interaction-utils.ts +++ b/src/reducers/src/interaction-utils.ts @@ -88,6 +88,7 @@ function autoFindTooltipFields(fields, maxDefaultTooltips) { .split(' ') .every(seg => !ptFields.includes(seg)) && type !== ALL_FIELD_TYPES.geojson && + type !== ALL_FIELD_TYPES.geoarrow && type !== 'object' ); diff --git a/src/utils/src/data-utils.ts b/src/utils/src/data-utils.ts index e46ec7b2fd..de9af612bb 100644 --- a/src/utils/src/data-utils.ts +++ b/src/utils/src/data-utils.ts @@ -273,6 +273,7 @@ export const FIELD_DISPLAY_FORMAT: { : Array.isArray(d) ? `[${String(d)}]` : '', + [ALL_FIELD_TYPES.geoarrow]: d => d, [ALL_FIELD_TYPES.object]: JSON.stringify, [ALL_FIELD_TYPES.array]: JSON.stringify }; From 60de67b9af72dd9a8b77154a9329e364e26b6fd5 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Wed, 18 Oct 2023 17:09:31 -0700 Subject: [PATCH 19/29] support filtering --- src/layers/src/arrow-layer/arrow-layer.ts | 41 +++++++++++++++++++++-- src/layers/src/base-layer.ts | 1 - src/utils/src/arrow-utils.ts | 9 +++-- src/utils/src/dataset-utils.ts | 8 +++-- 4 files changed, 51 insertions(+), 8 deletions(-) diff --git a/src/layers/src/arrow-layer/arrow-layer.ts b/src/layers/src/arrow-layer/arrow-layer.ts index 284fe6b51d..8dd4e4f8e5 100644 --- a/src/layers/src/arrow-layer/arrow-layer.ts +++ b/src/layers/src/arrow-layer/arrow-layer.ts @@ -24,7 +24,7 @@ import {HIGHLIGH_COLOR_3D} from '@kepler.gl/constants'; import {KeplerTable} from '@kepler.gl/table'; import { DataContainerInterface, - getBinaryGeometriesFromGeoArrowPolygon, + getBinaryGeometriesFromArrow, parseGeometryFromArrow } from '@kepler.gl/utils'; @@ -87,13 +87,49 @@ export default class ArrowLayer extends GeoJsonLayer { return this.binaryFeatures; } + formatLayerData(datasets, oldLayerData) { + if (this.config.dataId === null) { + return {}; + } + const {gpuFilter, dataContainer} = datasets[this.config.dataId]; + + // get data from calculateDataAttribute + const {data} = this.updateData(datasets, oldLayerData); + + // deck.gl geojson-layer will use binaryToFeatureForAccesor(data, index) + // to get feature from binary data, and the properties of the feature + // {index: i} can be used, see + // + const customFilterValueAccessor = (dc, d, fieldIndex) => { + return dc.valueAt(d.properties.index, fieldIndex); + }; + const indexAccessor = f => { + return f.properties.index; + }; + + const dataAccessor = dc => d => { + return {index: d.properties.index}; + }; + const accessors = this.getAttributeAccessors({dataAccessor, dataContainer}); + + // return layerData + return { + data, + getFilterValue: gpuFilter.filterValueAccessor(dataContainer)( + indexAccessor, + customFilterValueAccessor + ), + ...accessors + }; + } + updateLayerMeta(dataContainer: DataContainerInterface) { this.dataContainer = dataContainer; const {geojson} = this.config.columns; const geoColumn = dataContainer.getColumn(geojson.fieldIdx); // create binary data from arrow data for GeoJsonLayer - const {binaryGeometries, bounds, featureTypes} = getBinaryGeometriesFromGeoArrowPolygon( + const {binaryGeometries, bounds, featureTypes} = getBinaryGeometriesFromArrow( geoColumn ); this.binaryFeatures = binaryGeometries; @@ -114,6 +150,7 @@ export default class ArrowLayer extends GeoJsonLayer { hasHoveredObject(objectInfo) { // hover object returns the index of the object in the data array + // NOTE: this could be done in Deck.gl getPickingInfo(params) and binaryToGeojson() if (this.isLayerHovered(objectInfo) && objectInfo.index >= 0 && this.dataContainer) { const {geojson} = this.config.columns; const col = this.dataContainer.getColumn(geojson.fieldIdx); diff --git a/src/layers/src/base-layer.ts b/src/layers/src/base-layer.ts index 654bfd1ddf..2541e98018 100644 --- a/src/layers/src/base-layer.ts +++ b/src/layers/src/base-layer.ts @@ -1256,7 +1256,6 @@ class Layer { } hasHoveredObject(objectInfo) { - console.log('objectInfo.object', objectInfo?.object); return this.isLayerHovered(objectInfo) && objectInfo.object ? objectInfo.object : null; } diff --git a/src/utils/src/arrow-utils.ts b/src/utils/src/arrow-utils.ts index 761e30cdca..c030a7ee96 100644 --- a/src/utils/src/arrow-utils.ts +++ b/src/utils/src/arrow-utils.ts @@ -171,7 +171,7 @@ function getBinaryGeometriesFromChunk(chunk: ListVector, geoEncoding: string) { /** * get binary geometries from geoarrow polygon column */ -export function getBinaryGeometriesFromGeoArrowPolygon( +export function getBinaryGeometriesFromArrow( geoColumn: ArrowColumn ): { binaryGeometries: BinaryFeatures[]; @@ -215,7 +215,6 @@ export function getBinaryGeometriesFromGeoArrowPolygon( for (let i = 0; i < numOfVertices; i++) { globalFeatureIds[i] = featureIds[i] + globalFeatureIdOffset; } - globalFeatureIdOffset += geometries.length; const binaryContent = { globalFeatureIds: {value: globalFeatureIds, size: 1}, @@ -223,9 +222,13 @@ export function getBinaryGeometriesFromGeoArrowPolygon( value: flatCoordinateArray, size: nDim }, - featureIds: {value: featureIds, size: 1} + featureIds: {value: featureIds, size: 1}, + properties: [...Array(geometries.length).keys()].map(i => ({index: i + globalFeatureIdOffset})), }; + // TODO: check if chunks are sequentially accessed + globalFeatureIdOffset += geometries.length; + // TODO: deck.gl defines the BinaryFeatures structure must have points, lines, polygons even if they are empty binaryGeometries.push({ points: { diff --git a/src/utils/src/dataset-utils.ts b/src/utils/src/dataset-utils.ts index fb0cb4c62c..a834e74ee7 100644 --- a/src/utils/src/dataset-utils.ts +++ b/src/utils/src/dataset-utils.ts @@ -468,8 +468,12 @@ export function getFieldsFromData(data: RowData, fieldOrder: string[]): Field[] const name = fieldByIndex[index]; const fieldMeta = metadata.find(m => m.key === field); - let type = fieldMeta.type; - const format = fieldMeta.format; + + // fieldMeta could be undefined if the field has no data and Analyzer.computeColMeta + // will dump the field. In this case, we will simply assign the field type to STRING + // since dropping the column in the RowData could be expensive + let type = fieldMeta?.type || 'STRING'; + const format = fieldMeta?.format || ''; // check if string is hex wkb if (type === AnalyzerDATA_TYPES.STRING) { From 1344eb3572c1424bf45e42c8b37becb9ae2b3bd1 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Wed, 18 Oct 2023 20:47:46 -0700 Subject: [PATCH 20/29] fix polygon with hole --- src/layers/src/arrow-layer/arrow-layer.ts | 10 +- src/processors/src/data-processor.ts | 5 +- src/utils/src/arrow-utils.ts | 162 +++++++++++++--------- 3 files changed, 107 insertions(+), 70 deletions(-) diff --git a/src/layers/src/arrow-layer/arrow-layer.ts b/src/layers/src/arrow-layer/arrow-layer.ts index 8dd4e4f8e5..ed3c268fcb 100644 --- a/src/layers/src/arrow-layer/arrow-layer.ts +++ b/src/layers/src/arrow-layer/arrow-layer.ts @@ -23,6 +23,7 @@ import {GeoJsonLayer as DeckGLGeoJsonLayer} from '@deck.gl/layers'; import {HIGHLIGH_COLOR_3D} from '@kepler.gl/constants'; import {KeplerTable} from '@kepler.gl/table'; import { + GEOARROW_COLUMN_METADATA_KEY, DataContainerInterface, getBinaryGeometriesFromArrow, parseGeometryFromArrow @@ -98,8 +99,7 @@ export default class ArrowLayer extends GeoJsonLayer { // deck.gl geojson-layer will use binaryToFeatureForAccesor(data, index) // to get feature from binary data, and the properties of the feature - // {index: i} can be used, see - // + // {index: i} can be used for gpu filter const customFilterValueAccessor = (dc, d, fieldIndex) => { return dc.valueAt(d.properties.index, fieldIndex); }; @@ -129,9 +129,7 @@ export default class ArrowLayer extends GeoJsonLayer { const geoColumn = dataContainer.getColumn(geojson.fieldIdx); // create binary data from arrow data for GeoJsonLayer - const {binaryGeometries, bounds, featureTypes} = getBinaryGeometriesFromArrow( - geoColumn - ); + const {binaryGeometries, bounds, featureTypes} = getBinaryGeometriesFromArrow(geoColumn); this.binaryFeatures = binaryGeometries; const fixedRadius = false; @@ -156,7 +154,7 @@ export default class ArrowLayer extends GeoJsonLayer { const col = this.dataContainer.getColumn(geojson.fieldIdx); const rawGeometry = col.get(objectInfo.index); const hoveredFeature = parseGeometryFromArrow({ - encoding: col.metadata?.get('ARROW:extension:name'), + encoding: col.metadata?.get(GEOARROW_COLUMN_METADATA_KEY), data: rawGeometry }); return { diff --git a/src/processors/src/data-processor.ts b/src/processors/src/data-processor.ts index c8eef471bb..74f65ec2ca 100644 --- a/src/processors/src/data-processor.ts +++ b/src/processors/src/data-processor.ts @@ -18,7 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {Table as ApacheArrowTable, Field as ArrowField, Column as ArrowColumn} from 'apache-arrow'; +import {Table as ApacheArrowTable, Field as ArrowField} from 'apache-arrow'; import {csvParseRows} from 'd3-dsv'; import {Console} from 'global/console'; import {DATA_TYPES as AnalyzerDATA_TYPES} from 'type-analyzer'; @@ -31,6 +31,7 @@ import { } from '@kepler.gl/constants'; import {ProcessorResult, Field} from '@kepler.gl/types'; import { + GEOARROW_COLUMN_METADATA_KEY, arrowDataTypeToAnalyzerDataType, arrowDataTypeToFieldType, notNullorUndefined, @@ -430,7 +431,7 @@ export function processArrowTable(arrowTable: ApacheArrowTable): ProcessorResult arrowTable.schema.fields.forEach((field: ArrowField, index: number) => { const isGeometryColumn = geometryColumns[field.name] !== undefined || - field.metadata.get('ARROW:extension:name')?.startsWith('geoarrow'); + field.metadata.get(GEOARROW_COLUMN_METADATA_KEY)?.startsWith('geoarrow'); fields.push({ name: field.name, id: field.name, diff --git a/src/utils/src/arrow-utils.ts b/src/utils/src/arrow-utils.ts index c030a7ee96..7f0859872e 100644 --- a/src/utils/src/arrow-utils.ts +++ b/src/utils/src/arrow-utils.ts @@ -51,17 +51,27 @@ export enum GEOARROW_ENCODINGS { WKT = 'geoarrow.wkt' } +export const GEOARROW_COLUMN_METADATA_KEY = 'ARROW:extension:name'; + /** * get geoarrow encoding from geoarrow column */ function getGeoArrowEncoding(column: ArrowColumn): string { const {metadata} = column; - if (metadata && metadata.get('ARROW:extension:name')) { - return metadata.get('ARROW:extension:name') || ''; + if (metadata && metadata.get(GEOARROW_COLUMN_METADATA_KEY)) { + return metadata.get(GEOARROW_COLUMN_METADATA_KEY) || ''; } return ''; } +/** + * update bounds from geoarrow samples + * + * @param flatCoords the flattend coordinates array from one chunk of geoarrow column + * @param nDim the number of dimensions of the coordinates + * @param bounds the bounds to be updated + * @param sampleSize how many samples to be used to update the bounds, default is 1000 per chunk + */ function updateBoundsFromGeoArrowSamples( flatCoords: Float64Array, nDim: number, @@ -89,6 +99,7 @@ function updateBoundsFromGeoArrowSamples( } } +// binary geometry template, see deck.gl BinaryGeometry const BINARY_GEOMETRY_TEMPLATE = { globalFeatureIds: {value: new Uint32Array(0), size: 1}, positions: {value: new Float32Array(0), size: 2}, @@ -97,6 +108,12 @@ const BINARY_GEOMETRY_TEMPLATE = { featureIds: {value: new Uint32Array(0), size: 1} }; +/** + * get binary polygons from geoarrow polygon column + * @param chunk the data of one chunk of geoarrow polygon column + * @param geoEncoding the geo encoding of the geoarrow polygon column + * @returns + */ function getBinaryPolygonsFromChunk(chunk: ListVector, geoEncoding: string) { const isMultiPolygon = geoEncoding === GEOARROW_ENCODINGS.MULTI_POLYGON; @@ -109,10 +126,18 @@ function getBinaryPolygonsFromChunk(chunk: ListVector, geoEncoding: string) { const geomOffset = ringData?.valueOffsets; const flatCoordinateArray = coordData.values as Float64Array; + // polygonIndicies can be computed as: + // [geomOffset[chunk.valueOffsets[0]], geomOffset[chunk.valueOffsets[1]]]; + const geometryIndicies = new Uint16Array(chunk.length + 1); + for (let i = 0; i < chunk.length; i++) { + geometryIndicies[i] = geomOffset[chunk.valueOffsets[i]]; + } + geometryIndicies[chunk.length] = flatCoordinateArray.length / nDim; return { flatCoordinateArray, nDim, - geomOffset + geomOffset, + geometryIndicies }; } @@ -126,11 +151,13 @@ function getBinaryLinesFromChunk(chunk: ListVector, geoEncoding: string) { const nDim = pointData?.type.listSize || 2; const geomOffset = lineData?.valueOffsets; const flatCoordinateArray = coordData.values as Float64Array; + const geometryIndicies = new Uint16Array(chunk.length); return { flatCoordinateArray, nDim, - geomOffset + geomOffset, + geometryIndicies }; } @@ -143,11 +170,13 @@ function getBinaryPointsFromChunk(chunk: ListVector, geoEncoding: string) { const nDim = pointData?.type.listSize || 2; const geomOffset = pointData?.valueOffsets; const flatCoordinateArray = coordData.values as Float64Array; + const geometryIndicies = new Uint16Array(chunk.length); return { flatCoordinateArray, nDim, - geomOffset + geomOffset, + geometryIndicies }; } @@ -169,7 +198,7 @@ function getBinaryGeometriesFromChunk(chunk: ListVector, geoEncoding: string) { } /** - * get binary geometries from geoarrow polygon column + * get binary geometries from geoarrow column */ export function getBinaryGeometriesFromArrow( geoColumn: ArrowColumn @@ -189,14 +218,14 @@ export function getBinaryGeometriesFromArrow( line: geoEncoding === GEOARROW_ENCODINGS.MULTI_POINT || geoEncoding === GEOARROW_ENCODINGS.POINT }; - const bounds: [number, number, number, number] = [Infinity, Infinity, -Infinity, -Infinity]; const chunks = geoColumn.chunks; + const bounds: [number, number, number, number] = [Infinity, Infinity, -Infinity, -Infinity]; let globalFeatureIdOffset = 0; const binaryGeometries: BinaryFeatures[] = []; for (let c = 0; c < chunks.length; c++) { const geometries = chunks[c] as ListVector; - const {flatCoordinateArray, nDim, geomOffset} = getBinaryGeometriesFromChunk( + const {flatCoordinateArray, nDim, geomOffset, geometryIndicies} = getBinaryGeometriesFromChunk( geometries, geoEncoding ); @@ -229,7 +258,7 @@ export function getBinaryGeometriesFromArrow( // TODO: check if chunks are sequentially accessed globalFeatureIdOffset += geometries.length; - // TODO: deck.gl defines the BinaryFeatures structure must have points, lines, polygons even if they are empty + // NOTE: deck.gl defines the BinaryFeatures structure must have points, lines, polygons even if they are empty binaryGeometries.push({ points: { type: 'Point', @@ -240,14 +269,20 @@ export function getBinaryGeometriesFromArrow( type: 'LineString', ...BINARY_GEOMETRY_TEMPLATE, ...(featureTypes.line ? binaryContent : {}), - pathIndices: {value: featureTypes.line ? geomOffset : new Uint16Array(0), size: 1}, + pathIndices: {value: featureTypes.line ? geomOffset : new Uint16Array(0), size: 1} }, polygons: { type: 'Polygon', ...BINARY_GEOMETRY_TEMPLATE, ...(featureTypes.polygon ? binaryContent : {}), - polygonIndices: {value: featureTypes.polygon ? geomOffset: new Uint16Array(0), size: 1}, - primitivePolygonIndices: {value: featureTypes.polygon ? geomOffset: new Uint16Array(0), size: 1}, + polygonIndices: { + value: featureTypes.polygon ? geometryIndicies : new Uint16Array(0), + size: 1 + }, + primitivePolygonIndices: { + value: featureTypes.polygon ? geomOffset : new Uint16Array(0), + size: 1 + } } }); @@ -257,6 +292,59 @@ export function getBinaryGeometriesFromArrow( return {binaryGeometries, bounds, featureTypes}; } +/** + * parse geometry from arrow data that is returned from processArrowData() + * NOTE: this function could be duplicated with the binaryToFeature() in deck.gl, + * it is currently only used for picking because currently deck.gl returns only the index of the feature + * So the following functions could be deprecated once deck.gl returns the feature directly for binary geojson layer + * + * @param rawData the raw geometry data returned from processArrowData, which is an object with two properties: encoding and data + * @see processArrowData + * @returns Feature or null + */ +export function parseGeometryFromArrow(rawData: RawArrowFeature): Feature | null { + const encoding = rawData.encoding?.toLowerCase(); + const data = rawData.data; + if (!encoding || !data) return null; + + let geometry; + + switch (encoding) { + case GEOARROW_ENCODINGS.MULTI_POLYGON: + geometry = arrowMultiPolygonToFeature(data); + break; + case GEOARROW_ENCODINGS.POLYGON: + geometry = arrowPolygonToFeature(data); + break; + case GEOARROW_ENCODINGS.MULTI_POINT: + geometry = arrowMultiPointToFeature(data); + break; + case GEOARROW_ENCODINGS.POINT: + geometry = arrowPointToFeature(data); + break; + case GEOARROW_ENCODINGS.MULTI_LINESTRING: + geometry = arrowMultiLineStringToFeature(data); + break; + case GEOARROW_ENCODINGS.LINESTRING: + geometry = arrowLineStringToFeature(data); + break; + case GEOARROW_ENCODINGS.WKB: { + return arrowWkbToFeature(data); + } + case GEOARROW_ENCODINGS.WKT: { + return arrowWktToFeature(data); + } + default: { + throw Error('GeoArrow encoding not supported'); + } + } + return { + type: 'Feature', + geometry, + properties: {} + }; +} + /** * convert Arrow MultiPolygon to geojson Feature */ @@ -410,53 +498,3 @@ function arrowWktToFeature(arrowWkt: string): Feature | null { return normalized.features[0]; } - -/** - * parse geometry from arrow data that is returned from processArrowData() - * - * @param rawData the raw geometry data returned from processArrowData, which is an object with two properties: encoding and data - * @see processArrowData - * @returns - */ -export function parseGeometryFromArrow(rawData: RawArrowFeature): Feature | null { - const encoding = rawData.encoding?.toLowerCase(); - const data = rawData.data; - if (!encoding || !data) return null; - - let geometry; - - switch (encoding) { - case GEOARROW_ENCODINGS.MULTI_POLYGON: - geometry = arrowMultiPolygonToFeature(data); - break; - case GEOARROW_ENCODINGS.POLYGON: - geometry = arrowPolygonToFeature(data); - break; - case GEOARROW_ENCODINGS.MULTI_POINT: - geometry = arrowMultiPointToFeature(data); - break; - case GEOARROW_ENCODINGS.POINT: - geometry = arrowPointToFeature(data); - break; - case GEOARROW_ENCODINGS.MULTI_LINESTRING: - geometry = arrowMultiLineStringToFeature(data); - break; - case GEOARROW_ENCODINGS.LINESTRING: - geometry = arrowLineStringToFeature(data); - break; - case GEOARROW_ENCODINGS.WKB: { - return arrowWkbToFeature(data); - } - case GEOARROW_ENCODINGS.WKT: { - return arrowWktToFeature(data); - } - default: { - throw Error('GeoArrow encoding not supported'); - } - } - return { - type: 'Feature', - geometry, - properties: {} - }; -} From b36bf6ac2b9deb8ea8129531690e073e5aacb18a Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 19 Oct 2023 00:20:09 -0700 Subject: [PATCH 21/29] support point arrow --- src/utils/src/arrow-utils.ts | 80 +++++++++++++++++++++++++----------- 1 file changed, 55 insertions(+), 25 deletions(-) diff --git a/src/utils/src/arrow-utils.ts b/src/utils/src/arrow-utils.ts index 7f0859872e..4357dc971c 100644 --- a/src/utils/src/arrow-utils.ts +++ b/src/utils/src/arrow-utils.ts @@ -18,7 +18,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {ListVector, FloatVector, Float64Vector, Column as ArrowColumn} from 'apache-arrow'; +import { + ListVector, + FloatVector, + Float64Vector, + Column as ArrowColumn, + FixedSizeListVector +} from 'apache-arrow'; import normalize from '@mapbox/geojson-normalize'; import {BinaryFeatures} from '@loaders.gl/schema'; import {parseSync} from '@loaders.gl/core'; @@ -126,14 +132,24 @@ function getBinaryPolygonsFromChunk(chunk: ListVector, geoEncoding: string) { const geomOffset = ringData?.valueOffsets; const flatCoordinateArray = coordData.values as Float64Array; - // polygonIndicies can be computed as: - // [geomOffset[chunk.valueOffsets[0]], geomOffset[chunk.valueOffsets[1]]]; const geometryIndicies = new Uint16Array(chunk.length + 1); for (let i = 0; i < chunk.length; i++) { geometryIndicies[i] = geomOffset[chunk.valueOffsets[i]]; } geometryIndicies[chunk.length] = flatCoordinateArray.length / nDim; + + const numOfVertices = flatCoordinateArray.length / nDim; + const featureIds = new Uint32Array(numOfVertices); + for (let i = 0; i < chunk.length - 1; i++) { + const startIdx = geomOffset[chunk.valueOffsets[i]]; + const endIdx = geomOffset[chunk.valueOffsets[i + 1]]; + for (let j = startIdx; j < endIdx; j++) { + featureIds[j] = i; + } + } + return { + featureIds, flatCoordinateArray, nDim, geomOffset, @@ -151,9 +167,20 @@ function getBinaryLinesFromChunk(chunk: ListVector, geoEncoding: string) { const nDim = pointData?.type.listSize || 2; const geomOffset = lineData?.valueOffsets; const flatCoordinateArray = coordData.values as Float64Array; - const geometryIndicies = new Uint16Array(chunk.length); + const geometryIndicies = new Uint16Array(0); + + const numOfVertices = flatCoordinateArray.length / nDim; + const featureIds = new Uint32Array(numOfVertices); + for (let i = 0; i < chunk.length - 1; i++) { + const startIdx = geomOffset[chunk.valueOffsets[i]]; + const endIdx = geomOffset[chunk.valueOffsets[i + 1]]; + for (let j = startIdx; j < endIdx; j++) { + featureIds[j] = i; + } + } return { + featureIds, flatCoordinateArray, nDim, geomOffset, @@ -164,18 +191,24 @@ function getBinaryLinesFromChunk(chunk: ListVector, geoEncoding: string) { function getBinaryPointsFromChunk(chunk: ListVector, geoEncoding: string) { const isMultiPoint = geoEncoding === GEOARROW_ENCODINGS.MULTI_POINT; - const pointData = (isMultiPoint ? chunk.getChildAt(0) : chunk) as ListVector; + const pointData = (isMultiPoint ? chunk.getChildAt(0) : chunk) as FixedSizeListVector; const coordData = pointData?.getChildAt(0) as ListVector; const nDim = pointData?.type.listSize || 2; - const geomOffset = pointData?.valueOffsets; const flatCoordinateArray = coordData.values as Float64Array; - const geometryIndicies = new Uint16Array(chunk.length); + const geometryIndicies = new Uint16Array(0); + + const numOfVertices = flatCoordinateArray.length / nDim; + const featureIds = new Uint32Array(numOfVertices); + for (let i = 0; i < chunk.length; i++) { + featureIds[i] = i; + } return { + featureIds, flatCoordinateArray, nDim, - geomOffset, + geomOffset: new Uint16Array(0), geometryIndicies }; } @@ -213,9 +246,10 @@ export function getBinaryGeometriesFromArrow( geoEncoding === GEOARROW_ENCODINGS.MULTI_POLYGON || geoEncoding === GEOARROW_ENCODINGS.POLYGON, point: + geoEncoding === GEOARROW_ENCODINGS.MULTI_POINT || geoEncoding === GEOARROW_ENCODINGS.POINT, + line: geoEncoding === GEOARROW_ENCODINGS.MULTI_LINESTRING || - geoEncoding === GEOARROW_ENCODINGS.LINESTRING, - line: geoEncoding === GEOARROW_ENCODINGS.MULTI_POINT || geoEncoding === GEOARROW_ENCODINGS.POINT + geoEncoding === GEOARROW_ENCODINGS.LINESTRING }; const chunks = geoColumn.chunks; @@ -225,21 +259,15 @@ export function getBinaryGeometriesFromArrow( for (let c = 0; c < chunks.length; c++) { const geometries = chunks[c] as ListVector; - const {flatCoordinateArray, nDim, geomOffset, geometryIndicies} = getBinaryGeometriesFromChunk( - geometries, - geoEncoding - ); + const { + featureIds, + flatCoordinateArray, + nDim, + geomOffset, + geometryIndicies + } = getBinaryGeometriesFromChunk(geometries, geoEncoding); const numOfVertices = flatCoordinateArray.length / nDim; - const featureIds = new Uint32Array(numOfVertices); - for (let i = 0; i < geometries.length - 1; i++) { - const startIdx = geomOffset[geometries.valueOffsets[i]]; - const endIdx = geomOffset[geometries.valueOffsets[i + 1]]; - for (let j = startIdx; j < endIdx; j++) { - featureIds[j] = i; - } - } - const globalFeatureIds = new Uint32Array(numOfVertices); for (let i = 0; i < numOfVertices; i++) { globalFeatureIds[i] = featureIds[i] + globalFeatureIdOffset; @@ -252,7 +280,9 @@ export function getBinaryGeometriesFromArrow( size: nDim }, featureIds: {value: featureIds, size: 1}, - properties: [...Array(geometries.length).keys()].map(i => ({index: i + globalFeatureIdOffset})), + properties: [...Array(geometries.length).keys()].map(i => ({ + index: i + globalFeatureIdOffset + })) }; // TODO: check if chunks are sequentially accessed @@ -276,7 +306,7 @@ export function getBinaryGeometriesFromArrow( ...BINARY_GEOMETRY_TEMPLATE, ...(featureTypes.polygon ? binaryContent : {}), polygonIndices: { - value: featureTypes.polygon ? geometryIndicies : new Uint16Array(0), + value: featureTypes.polygon ? geomOffset : new Uint16Array(0), size: 1 }, primitivePolygonIndices: { From b4d77aec83fc408eda85b66c18ccafff43a07c40 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 19 Oct 2023 00:49:24 -0700 Subject: [PATCH 22/29] support linestring --- src/utils/src/arrow-utils.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/utils/src/arrow-utils.ts b/src/utils/src/arrow-utils.ts index 4357dc971c..aa52b65612 100644 --- a/src/utils/src/arrow-utils.ts +++ b/src/utils/src/arrow-utils.ts @@ -167,13 +167,14 @@ function getBinaryLinesFromChunk(chunk: ListVector, geoEncoding: string) { const nDim = pointData?.type.listSize || 2; const geomOffset = lineData?.valueOffsets; const flatCoordinateArray = coordData.values as Float64Array; + const geometryIndicies = new Uint16Array(0); const numOfVertices = flatCoordinateArray.length / nDim; const featureIds = new Uint32Array(numOfVertices); - for (let i = 0; i < chunk.length - 1; i++) { - const startIdx = geomOffset[chunk.valueOffsets[i]]; - const endIdx = geomOffset[chunk.valueOffsets[i + 1]]; + for (let i = 0; i < chunk.length; i++) { + const startIdx = geomOffset[i]; + const endIdx = geomOffset[i + 1]; for (let j = startIdx; j < endIdx; j++) { featureIds[j] = i; } @@ -259,13 +260,10 @@ export function getBinaryGeometriesFromArrow( for (let c = 0; c < chunks.length; c++) { const geometries = chunks[c] as ListVector; - const { - featureIds, - flatCoordinateArray, - nDim, - geomOffset, - geometryIndicies - } = getBinaryGeometriesFromChunk(geometries, geoEncoding); + const {featureIds, flatCoordinateArray, nDim, geomOffset} = getBinaryGeometriesFromChunk( + geometries, + geoEncoding + ); const numOfVertices = flatCoordinateArray.length / nDim; const globalFeatureIds = new Uint32Array(numOfVertices); @@ -306,6 +304,8 @@ export function getBinaryGeometriesFromArrow( ...BINARY_GEOMETRY_TEMPLATE, ...(featureTypes.polygon ? binaryContent : {}), polygonIndices: { + // TODO why deck.gl's tessellatePolygon performance is not good when using geometryIndicies + // even when there is no hole in any polygon value: featureTypes.polygon ? geomOffset : new Uint16Array(0), size: 1 }, From d285c6642ddd370f1e7a1e4c1557820bd42f1d3e Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 19 Oct 2023 14:20:32 -0700 Subject: [PATCH 23/29] add gpu filter --- .../src/geojson-layer/filter-arrow-layer.ts | 50 +++++++++++++++++++ .../src/geojson-layer/filter-shader-module.ts | 39 +++++++++++++++ src/deckgl-layers/src/index.ts | 1 + src/layers/src/arrow-layer/arrow-layer.ts | 30 +++++++++-- src/utils/src/arrow-utils.ts | 2 +- 5 files changed, 118 insertions(+), 4 deletions(-) create mode 100644 src/deckgl-layers/src/geojson-layer/filter-arrow-layer.ts create mode 100644 src/deckgl-layers/src/geojson-layer/filter-shader-module.ts diff --git a/src/deckgl-layers/src/geojson-layer/filter-arrow-layer.ts b/src/deckgl-layers/src/geojson-layer/filter-arrow-layer.ts new file mode 100644 index 0000000000..18cb80be96 --- /dev/null +++ b/src/deckgl-layers/src/geojson-layer/filter-arrow-layer.ts @@ -0,0 +1,50 @@ +import {Layer, LayerExtension} from '@deck.gl/core'; +import {LayerContext} from '@deck.gl/core/lib/layer'; +import GL from '@luma.gl/constants'; + +import shaderModule from './filter-shader-module'; + +const defaultProps = { + getFiltered: {type: 'accessor', value: 1} +}; + +export type FilterArrowExtensionProps = { + getFiltered?: () => number; +}; + +// Write an extension to filter arrow layer: +// an instanced attribute 'instanceFiltered' is added to the layer to indicate whether the feature has been Filtered +// the shader module is modified to discard the feature if instanceFiltered is 0 +// the accessor getFiltered is used to get the value of instanceFiltered based on filteredIndex in Arrowlayer +export default class FilterArrowExtension extends LayerExtension { + static defaultProps = defaultProps; + static extensionName = 'FilterArrowExtension'; + + getShaders(extension: any) { + return { + modules: [shaderModule], + defines: {} + }; + } + + initializeState(this: Layer, context: LayerContext, extension: this) { + const attributeManager = this.getAttributeManager(); + if (attributeManager) { + attributeManager.add({ + filtered: { + size: 1, + type: GL.FLOAT, + accessor: 'getFiltered', + shaderAttributes: { + filtered: { + divisor: 0 + }, + instanceFiltered: { + divisor: 1 + } + } + } + }); + } + } +} diff --git a/src/deckgl-layers/src/geojson-layer/filter-shader-module.ts b/src/deckgl-layers/src/geojson-layer/filter-shader-module.ts new file mode 100644 index 0000000000..5e5755eda1 --- /dev/null +++ b/src/deckgl-layers/src/geojson-layer/filter-shader-module.ts @@ -0,0 +1,39 @@ +import {project} from '@deck.gl/core'; + +const vs = ` + #ifdef NON_INSTANCED_MODEL + #define FILTER_ARROW_ATTRIB filtered + #else + #define FILTER_ARROW_ATTRIB instanceFiltered + #endif + attribute float FILTER_ARROW_ATTRIB; +`; + +const fs = ``; + +const inject = { + 'vs:#decl': ` + varying float is_filtered; + `, + 'vs:#main-end': ` + is_filtered = FILTER_ARROW_ATTRIB; + `, + 'fs:#decl': ` + varying float is_filtered; + `, + 'fs:DECKGL_FILTER_COLOR': ` + // abandon the fragments if it is not filtered + if (is_filtered == 0.) { + discard; + } + ` +}; + +export default { + name: 'filter-arrow', + dependencies: [project], + vs: vs, + fs: fs, + inject: inject, + getUniforms: () => {} +} diff --git a/src/deckgl-layers/src/index.ts b/src/deckgl-layers/src/index.ts index 459c283ede..bcec4e74eb 100644 --- a/src/deckgl-layers/src/index.ts +++ b/src/deckgl-layers/src/index.ts @@ -9,6 +9,7 @@ export {default as EnhancedGridLayer} from './grid-layer/enhanced-cpu-grid-layer export {default as EnhancedHexagonLayer} from './hexagon-layer/enhanced-hexagon-layer'; export {default as EnhancedLineLayer} from './line-layer/line-layer'; export {default as SvgIconLayer} from './svg-icon-layer/svg-icon-layer'; +export {default as FilterArrowExtension} from './geojson-layer/filter-arrow-layer'; export * from './layer-utils/shader-utils'; diff --git a/src/layers/src/arrow-layer/arrow-layer.ts b/src/layers/src/arrow-layer/arrow-layer.ts index ed3c268fcb..79b65f9033 100644 --- a/src/layers/src/arrow-layer/arrow-layer.ts +++ b/src/layers/src/arrow-layer/arrow-layer.ts @@ -28,12 +28,14 @@ import { getBinaryGeometriesFromArrow, parseGeometryFromArrow } from '@kepler.gl/utils'; - +import {FilterArrowExtension} from '@kepler.gl/deckgl-layers'; import GeoJsonLayer, {SUPPORTED_ANALYZER_TYPES} from '../geojson-layer/geojson-layer'; export default class ArrowLayer extends GeoJsonLayer { binaryFeatures: BinaryFeatures[]; dataContainer: DataContainerInterface | null; + filteredIndex: Uint8ClampedArray | null; + filteredIndexTrigger: number[]; // constructor constructor(props) { @@ -41,6 +43,8 @@ export default class ArrowLayer extends GeoJsonLayer { this.dataContainer = null; this.binaryFeatures = []; + this.filteredIndex = null; + this.filteredIndexTrigger = []; } static findDefaultLayerProps({label, fields = []}: KeplerTable) { @@ -84,6 +88,17 @@ export default class ArrowLayer extends GeoJsonLayer { calculateDataAttribute({dataContainer, filteredIndex}, getPosition) { // TODO: filter arrow table using predicate // filteredIndex.map(i => this.dataToFeature[i]).filter(d => d); + // filter arrow table by values and make a partial copy of the raw table could be expensive + // so we will use filteredIndex to create an attribute e.g. filtered (bool) for deck.gl layer + if (!this.filteredIndex) { + this.filteredIndex = new Uint8ClampedArray(dataContainer.numRows()); + } + this.filteredIndex.fill(0); + for (let i = 0; i < filteredIndex.length; ++i) { + this.filteredIndex[filteredIndex[i]] = 1; + } + + this.filteredIndexTrigger = filteredIndex; this.dataContainer = dataContainer; return this.binaryFeatures; } @@ -99,7 +114,7 @@ export default class ArrowLayer extends GeoJsonLayer { // deck.gl geojson-layer will use binaryToFeatureForAccesor(data, index) // to get feature from binary data, and the properties of the feature - // {index: i} can be used for gpu filter + // e.g. properties: {index: i} can be used for gpu filter const customFilterValueAccessor = (dc, d, fieldIndex) => { return dc.valueAt(d.properties.index, fieldIndex); }; @@ -110,6 +125,11 @@ export default class ArrowLayer extends GeoJsonLayer { const dataAccessor = dc => d => { return {index: d.properties.index}; }; + + const isFilteredAccessor = d => { + return this.filteredIndex ? this.filteredIndex[d.properties.index] : 1; + }; + const accessors = this.getAttributeAccessors({dataAccessor, dataContainer}); // return layerData @@ -119,6 +139,7 @@ export default class ArrowLayer extends GeoJsonLayer { indexAccessor, customFilterValueAccessor ), + getFiltered: isFilteredAccessor, ...accessors }; } @@ -132,6 +153,7 @@ export default class ArrowLayer extends GeoJsonLayer { const {binaryGeometries, bounds, featureTypes} = getBinaryGeometriesFromArrow(geoColumn); this.binaryFeatures = binaryGeometries; + // since there is no feature.properties.radius, we set fixedRadius to false const fixedRadius = false; this.updateMeta({bounds, fixedRadius, featureTypes}); } @@ -195,7 +217,8 @@ export default class ArrowLayer extends GeoJsonLayer { const updateTriggers = { ...this.getVisualChannelUpdateTriggers(), - getFilterValue: gpuFilter.filterValueUpdateTriggers + getFilterValue: gpuFilter.filterValueUpdateTriggers, + getFiltered: this.filteredIndexTrigger }; const defaultLayerProps = this.getDefaultDeckLayerProps(opts); @@ -225,6 +248,7 @@ export default class ArrowLayer extends GeoJsonLayer { capRounded: true, jointRounded: true, updateTriggers, + extensions: [...defaultLayerProps.extensions, new FilterArrowExtension()], _subLayerProps: { ...(featureTypes?.polygon ? {'polygons-stroke': opaOverwrite} : {}), ...(featureTypes?.line ? {linestrings: opaOverwrite} : {}), diff --git a/src/utils/src/arrow-utils.ts b/src/utils/src/arrow-utils.ts index aa52b65612..c932610d4e 100644 --- a/src/utils/src/arrow-utils.ts +++ b/src/utils/src/arrow-utils.ts @@ -82,7 +82,7 @@ function updateBoundsFromGeoArrowSamples( flatCoords: Float64Array, nDim: number, bounds: [number, number, number, number], - sampleSize: number = 1000 + sampleSize: number = 100 ) { const numberOfFeatures = flatCoords.length / nDim; const sampleStep = Math.max(Math.floor(numberOfFeatures / sampleSize), 1); From 10f0d27ad96222473a7fcaa48a4803f43a5b0623 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 19 Oct 2023 14:30:16 -0700 Subject: [PATCH 24/29] clean up --- .../src/geojson-layer/filter-arrow-layer.ts | 12 +++++++----- .../src/geojson-layer/filter-shader-module.ts | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/deckgl-layers/src/geojson-layer/filter-arrow-layer.ts b/src/deckgl-layers/src/geojson-layer/filter-arrow-layer.ts index 18cb80be96..12e6907dfa 100644 --- a/src/deckgl-layers/src/geojson-layer/filter-arrow-layer.ts +++ b/src/deckgl-layers/src/geojson-layer/filter-arrow-layer.ts @@ -4,18 +4,20 @@ import GL from '@luma.gl/constants'; import shaderModule from './filter-shader-module'; +const VALUE_FILTERED = 1; + const defaultProps = { - getFiltered: {type: 'accessor', value: 1} + getFiltered: {type: 'accessor', value: VALUE_FILTERED} }; export type FilterArrowExtensionProps = { getFiltered?: () => number; }; -// Write an extension to filter arrow layer: -// an instanced attribute 'instanceFiltered' is added to the layer to indicate whether the feature has been Filtered -// the shader module is modified to discard the feature if instanceFiltered is 0 -// the accessor getFiltered is used to get the value of instanceFiltered based on filteredIndex in Arrowlayer +// A simple extension to filter arrow layer based on the CPU filteredIndex, so we can avoid filtering on the raw Arrow table. +// Specifically, an attribute `filtered` is added to the layer to indicate whether the feature has been Filtered +// the shader module is modified to discard the feature if filtered value is 0 +// the accessor getFiltered is used to get the value of `filtered` based on eht value `filteredIndex` in Arrowlayer export default class FilterArrowExtension extends LayerExtension { static defaultProps = defaultProps; static extensionName = 'FilterArrowExtension'; diff --git a/src/deckgl-layers/src/geojson-layer/filter-shader-module.ts b/src/deckgl-layers/src/geojson-layer/filter-shader-module.ts index 5e5755eda1..2270e180fc 100644 --- a/src/deckgl-layers/src/geojson-layer/filter-shader-module.ts +++ b/src/deckgl-layers/src/geojson-layer/filter-shader-module.ts @@ -36,4 +36,4 @@ export default { fs: fs, inject: inject, getUniforms: () => {} -} +}; From 97872772e1d398c1a1040b19d43e5622fb2d643c Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 19 Oct 2023 14:56:01 -0700 Subject: [PATCH 25/29] clean after rebase --- package.json | 1 - src/components/package.json | 2 +- src/components/src/map-container.tsx | 1 + src/constants/package.json | 6 ++-- src/layers/package.json | 2 +- src/layers/src/geojson-layer/geojson-utils.ts | 21 ++++++++++---- src/processors/src/data-processor.ts | 2 +- src/reducers/package.json | 28 +++++++++---------- src/table/src/kepler-table.ts | 5 ++-- 9 files changed, 39 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 603417731b..b484785b10 100644 --- a/package.json +++ b/package.json @@ -239,7 +239,6 @@ "lodash": "4.17.19", "minimist": "1.2.3", "node-fetch": "2.6.1", - "puppeteer": "^18.2.1", "tough-cookie": "4.0.0" }, "peerDependencies": { diff --git a/src/components/package.json b/src/components/package.json index 4ae2260b62..03f00ac282 100644 --- a/src/components/package.json +++ b/src/components/package.json @@ -65,8 +65,8 @@ "@types/lodash.throttle": "^4.1.7", "@types/lodash.uniq": "^4.5.7", "@types/lodash.uniqby": "^4.7.7", - "@types/react": "^18.0.28", "@types/react-copy-to-clipboard": "^5.0.2", + "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", "@types/react-lifecycles-compat": "^3.0.1", "@types/react-map-gl": "^6.1.3", diff --git a/src/components/src/map-container.tsx b/src/components/src/map-container.tsx index 26866bd6f3..2ebc5af3c2 100644 --- a/src/components/src/map-container.tsx +++ b/src/components/src/map-container.tsx @@ -940,6 +940,7 @@ export default function MapContainerFactory( // TODO this should be part of onLayerHover arguments, investigate // @ts-ignore (does not fail with local yarn-test) data.mapIndex = index; + this.props.visStateActions.onLayerHover(data); }, DEBOUNCE_MOUSE_MOVE_PROPAGATE); diff --git a/src/constants/package.json b/src/constants/package.json index 471b378c83..8c2434713d 100644 --- a/src/constants/package.json +++ b/src/constants/package.json @@ -1,7 +1,7 @@ { "name": "@kepler.gl/constants", "author": "Shan He ", - "version": "3.0.0-alpha.0", + "version": "3.0.0-alpha.1", "description": "kepler.gl constants used by kepler.gl components, actions and reducers", "license": "MIT", "main": "dist/index.js", @@ -30,9 +30,7 @@ "umd" ], "dependencies": { - "@dnd-kit/core": "^6.0.8", - "@dnd-kit/modifiers": "^6.0.1", - "@kepler.gl/types": "3.0.0-alpha.0", + "@kepler.gl/types": "3.0.0-alpha.1", "@types/d3-scale": "^3.2.2", "@types/keymirror": "^0.1.1", "colorbrewer": "^1.5.0", diff --git a/src/layers/package.json b/src/layers/package.json index ad18d80d5b..bd16e31026 100644 --- a/src/layers/package.json +++ b/src/layers/package.json @@ -48,8 +48,8 @@ "@loaders.gl/wkt": "^3.4.14", "@luma.gl/constants": "^8.5.19", "@mapbox/geojson-normalize": "0.0.1", - "@nebula.gl/edit-modes": "1.0.2-alpha.1", "@nebula.gl/layers": "1.0.2-alpha.1", + "@nebula.gl/edit-modes": "1.0.2-alpha.1", "@turf/bbox": "^6.0.1", "@turf/helpers": "^6.1.4", "@types/geojson": "^7946.0.7", diff --git a/src/layers/src/geojson-layer/geojson-utils.ts b/src/layers/src/geojson-layer/geojson-utils.ts index 8de540ab49..b86d1c0784 100644 --- a/src/layers/src/geojson-layer/geojson-utils.ts +++ b/src/layers/src/geojson-layer/geojson-utils.ts @@ -22,19 +22,31 @@ import normalize from '@mapbox/geojson-normalize'; import bbox from '@turf/bbox'; import {parseSync} from '@loaders.gl/core'; import {WKBLoader, WKTLoader} from '@loaders.gl/wkt'; -import {binaryToGeometry} from '@loaders.gl/gis'; +import { binaryToGeometry } from '@loaders.gl/gis'; + import {Feature, BBox} from 'geojson'; -import {getSampleData, FeatureTypes} from '@kepler.gl/utils'; +import {getSampleData} from '@kepler.gl/utils'; export type GetFeature = (d: any) => Feature; export type GeojsonDataMaps = Array; +/* eslint-disable */ +// TODO: Re-enable eslint when we upgrade to handle enums and type maps +export enum FeatureTypes { + Point = 'Point', + MultiPoint = 'MultiPoint', + LineString = 'LineString', + MultiLineString = 'MultiLineString', + Polygon = 'Polygon', + MultiPolygon = 'MultiPolygon' +} + type FeatureTypeMap = { [key in FeatureTypes]: boolean; }; -export function parseGeoJsonRawFeature(rawFeature: {} | Feature): Feature | null { - if (rawFeature && typeof rawFeature === 'object') { +export function parseGeoJsonRawFeature(rawFeature: unknown): Feature | null { + if (typeof rawFeature === 'object') { // Support GeoJson feature as object // probably need to normalize it as well const normalized = normalize(rawFeature); @@ -61,7 +73,6 @@ export function parseGeoJsonRawFeature(rawFeature: {} | Feature): Feature | null return null; } - /** * Parse raw data to GeoJson feature * @param dataContainer diff --git a/src/processors/src/data-processor.ts b/src/processors/src/data-processor.ts index 74f65ec2ca..76a67ab1b9 100644 --- a/src/processors/src/data-processor.ts +++ b/src/processors/src/data-processor.ts @@ -256,7 +256,7 @@ export function parseCsvRowsByFieldType( * } * })); */ -export function processRowObject(rawData: object[]): ProcessorResult { +export function processRowObject(rawData: unknown[]): ProcessorResult { if (!Array.isArray(rawData)) { return null; } else if (!rawData.length) { diff --git a/src/reducers/package.json b/src/reducers/package.json index 7ac461f0ce..1cc5d3e935 100644 --- a/src/reducers/package.json +++ b/src/reducers/package.json @@ -1,7 +1,7 @@ { "name": "@kepler.gl/reducers", "author": "Shan He ", - "version": "3.0.0-alpha.0", + "version": "3.0.0-alpha.1", "description": "kepler.gl constants used by kepler.gl components, actions and reducers", "license": "MIT", "main": "dist/index.js", @@ -30,19 +30,19 @@ "umd" ], "dependencies": { - "@dnd-kit/sortable": "^7.0.2", - "@kepler.gl/actions": "3.0.0-alpha.0", - "@kepler.gl/cloud-providers": "3.0.0-alpha.0", - "@kepler.gl/constants": "3.0.0-alpha.0", - "@kepler.gl/deckgl-layers": "3.0.0-alpha.0", - "@kepler.gl/layers": "3.0.0-alpha.0", - "@kepler.gl/localization": "3.0.0-alpha.0", - "@kepler.gl/processors": "3.0.0-alpha.0", - "@kepler.gl/schemas": "3.0.0-alpha.0", - "@kepler.gl/table": "3.0.0-alpha.0", - "@kepler.gl/tasks": "3.0.0-alpha.0", - "@kepler.gl/types": "3.0.0-alpha.0", - "@kepler.gl/utils": "3.0.0-alpha.0", + "@kepler.gl/actions": "3.0.0-alpha.1", + "@kepler.gl/cloud-providers": "3.0.0-alpha.1", + "@kepler.gl/constants": "3.0.0-alpha.1", + "@kepler.gl/deckgl-layers": "3.0.0-alpha.1", + "@kepler.gl/layers": "3.0.0-alpha.1", + "@kepler.gl/effects": "3.0.0-alpha.1", + "@kepler.gl/localization": "3.0.0-alpha.1", + "@kepler.gl/processors": "3.0.0-alpha.1", + "@kepler.gl/schemas": "3.0.0-alpha.1", + "@kepler.gl/table": "3.0.0-alpha.1", + "@kepler.gl/tasks": "3.0.0-alpha.1", + "@kepler.gl/types": "3.0.0-alpha.1", + "@kepler.gl/utils": "3.0.0-alpha.1", "@loaders.gl/loader-utils": "^3.4.14", "@types/lodash.clonedeep": "^4.5.7", "@types/lodash.flattendeep": "^4.4.7", diff --git a/src/table/src/kepler-table.ts b/src/table/src/kepler-table.ts index 7f04a400f8..800e9d1587 100644 --- a/src/table/src/kepler-table.ts +++ b/src/table/src/kepler-table.ts @@ -41,7 +41,7 @@ import { import {getGpuFilterProps, getDatasetFieldIndexForFilter} from './gpu-filter-utils'; -import { Layer } from '@kepler.gl/layers'; +import {Layer} from '@kepler.gl/layers'; import { generateHashId, getSortingFunction, @@ -148,7 +148,8 @@ class KeplerTable { // return this; // } - const isArrow = info?.format === 'arrow'; + // TODO: detect if the data is an arrow table + const isArrow = data.rawData && data.rawData.schema && data.rawData.schema.fields; const dataContainerData = isArrow ? [...Array(data.rawData?.numCols || 0).keys()].map(i => data.rawData.getColumnAt(i)) : data.rows From 01c8757946fcb306ce61df96195071b2ac2b5079 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 19 Oct 2023 15:01:04 -0700 Subject: [PATCH 26/29] wip --- src/components/package.json | 4 ++-- src/effects/package.json | 8 ++++---- src/layers/package.json | 2 +- src/reducers/package.json | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/package.json b/src/components/package.json index 03f00ac282..f0ca0a3f4b 100644 --- a/src/components/package.json +++ b/src/components/package.json @@ -39,8 +39,8 @@ "@kepler.gl/actions": "3.0.0-alpha.1", "@kepler.gl/cloud-providers": "3.0.0-alpha.1", "@kepler.gl/constants": "3.0.0-alpha.1", - "@kepler.gl/layers": "3.0.0-alpha.1", "@kepler.gl/effects": "3.0.0-alpha.1", + "@kepler.gl/layers": "3.0.0-alpha.1", "@kepler.gl/localization": "3.0.0-alpha.1", "@kepler.gl/processors": "3.0.0-alpha.1", "@kepler.gl/reducers": "3.0.0-alpha.1", @@ -65,8 +65,8 @@ "@types/lodash.throttle": "^4.1.7", "@types/lodash.uniq": "^4.5.7", "@types/lodash.uniqby": "^4.7.7", - "@types/react-copy-to-clipboard": "^5.0.2", "@types/react": "^18.0.28", + "@types/react-copy-to-clipboard": "^5.0.2", "@types/react-dom": "^18.0.11", "@types/react-lifecycles-compat": "^3.0.1", "@types/react-map-gl": "^6.1.3", diff --git a/src/effects/package.json b/src/effects/package.json index 24d0474067..6a917ee8a4 100644 --- a/src/effects/package.json +++ b/src/effects/package.json @@ -30,12 +30,12 @@ "umd" ], "dependencies": { - "suncalc": "^1.9.0", "@deck.gl/core": "^8.9.12", - "@luma.gl/shadertools": "^8.5.19", - "@kepler.gl/utils": "3.0.0-alpha.1", "@kepler.gl/constants": "3.0.0-alpha.1", - "@kepler.gl/types": "3.0.0-alpha.1" + "@kepler.gl/types": "3.0.0-alpha.1", + "@kepler.gl/utils": "3.0.0-alpha.1", + "@luma.gl/shadertools": "^8.5.19", + "suncalc": "^1.9.0" }, "nyc": { "sourceMap": false, diff --git a/src/layers/package.json b/src/layers/package.json index bd16e31026..ad18d80d5b 100644 --- a/src/layers/package.json +++ b/src/layers/package.json @@ -48,8 +48,8 @@ "@loaders.gl/wkt": "^3.4.14", "@luma.gl/constants": "^8.5.19", "@mapbox/geojson-normalize": "0.0.1", - "@nebula.gl/layers": "1.0.2-alpha.1", "@nebula.gl/edit-modes": "1.0.2-alpha.1", + "@nebula.gl/layers": "1.0.2-alpha.1", "@turf/bbox": "^6.0.1", "@turf/helpers": "^6.1.4", "@types/geojson": "^7946.0.7", diff --git a/src/reducers/package.json b/src/reducers/package.json index 1cc5d3e935..4486a64bd0 100644 --- a/src/reducers/package.json +++ b/src/reducers/package.json @@ -34,8 +34,8 @@ "@kepler.gl/cloud-providers": "3.0.0-alpha.1", "@kepler.gl/constants": "3.0.0-alpha.1", "@kepler.gl/deckgl-layers": "3.0.0-alpha.1", - "@kepler.gl/layers": "3.0.0-alpha.1", "@kepler.gl/effects": "3.0.0-alpha.1", + "@kepler.gl/layers": "3.0.0-alpha.1", "@kepler.gl/localization": "3.0.0-alpha.1", "@kepler.gl/processors": "3.0.0-alpha.1", "@kepler.gl/schemas": "3.0.0-alpha.1", From 16d3f2d940081790c6ec5b3618f9784d472fe120 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 19 Oct 2023 15:58:30 -0700 Subject: [PATCH 27/29] wip --- src/utils/package.json | 1 + src/utils/src/data-container-interface.ts | 2 +- yarn.lock | 127 +++++++++++++++++++++- 3 files changed, 127 insertions(+), 3 deletions(-) diff --git a/src/utils/package.json b/src/utils/package.json index e01ec0dd62..cabf43d2cd 100644 --- a/src/utils/package.json +++ b/src/utils/package.json @@ -30,6 +30,7 @@ "umd" ], "dependencies": { + "apache-arrow": "^4.0.0", "@kepler.gl/constants": "3.0.0-alpha.1", "@kepler.gl/types": "3.0.0-alpha.1", "@luma.gl/constants": "^8.5.19", diff --git a/src/utils/src/data-container-interface.ts b/src/utils/src/data-container-interface.ts index 74c4cf359f..e0f32b2a61 100644 --- a/src/utils/src/data-container-interface.ts +++ b/src/utils/src/data-container-interface.ts @@ -65,7 +65,7 @@ export interface DataContainerInterface { * @param columnIndex Column index. * @returns The column object at the specified index. */ - getColumn(columnIndex: number): any; + getColumn?(columnIndex: number): any; /** * Returns contents of the data container as a two-dimensional array. diff --git a/yarn.lock b/yarn.lock index f52df80b00..63b1ce58b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3421,6 +3421,11 @@ resolved "https://registry.yarnpkg.com/@types/exenv/-/exenv-1.2.0.tgz#84ff936feeafc917c3c66f80b43e917f56eed00b" integrity sha512-kSyh9q6bvrOGEnJ9X9Io5gjXaakcSRQTax/Nj2ZKJHuOZ7bH4uvUgLyXA9uV2QBCP7+T8KS0JHbPfP1/79ckKw== +"@types/flatbuffers@^1.10.0": + version "1.10.2" + resolved "https://registry.yarnpkg.com/@types/flatbuffers/-/flatbuffers-1.10.2.tgz#2f53f10e48d198f5a50776434489fb4837775854" + integrity sha512-kdf6SlDXrW8LvG9Sw0S5y6Goy4qvJUlDLilqV4ZMNVUyP0Oz0jjriac8bDM66YupE4qKyjK2RPzfi05ku/OFiQ== + "@types/geojson@*", "@types/geojson@^7946.0.7": version "7946.0.7" resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.7.tgz#c8fa532b60a0042219cdf173ca21a975ef0666ad" @@ -3701,6 +3706,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.0.tgz#acaa89247afddc7967e9902fd11761dadea1a555" integrity sha512-j2tekvJCO7j22cs+LO6i0kRPhmQ9MXaPZ55TzOc1lzkN5b6BWqq4AFjl04s1oRRQ1v5rSe+KEvnLUSTonuls/A== +"@types/node@^14.14.37": + version "14.18.63" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.63.tgz#1788fa8da838dbb5f9ea994b834278205db6ca2b" + integrity sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ== + "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" @@ -3872,6 +3882,11 @@ dependencies: "@types/react-test-renderer" "*" +"@types/text-encoding-utf-8@^1.0.1": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@types/text-encoding-utf-8/-/text-encoding-utf-8-1.0.4.tgz#50d23b1dc9f0003514b515c9010102e30c01dc18" + integrity sha512-IM0hR5Gr7AeA+tvMTwbClGT97Ym7o17ussTo4Vj9FW4t4/FZ6eFISQxAtpHUqTJDSERT8zwL51HIzeIc7ovQMQ== + "@types/tough-cookie@*": version "4.0.3" resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.3.tgz#3d06b6769518450871fbc40770b7586334bdfd90" @@ -4529,6 +4544,22 @@ anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" +apache-arrow@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/apache-arrow/-/apache-arrow-4.0.1.tgz#62e58caa46a6a41966478a19c492380c9efb1d66" + integrity sha512-DyF7GXCbSjsw4P5C8b+qW7OnJKa6w9mJI0mhV0+EfZbVZCmhfiF6ffqcnrI/kzBrRqn9hH/Ft9n5+m4DTbBJpg== + dependencies: + "@types/flatbuffers" "^1.10.0" + "@types/node" "^14.14.37" + "@types/text-encoding-utf-8" "^1.0.1" + command-line-args "5.1.1" + command-line-usage "6.1.1" + flatbuffers "1.12.0" + json-bignum "^0.0.3" + pad-left "^2.1.0" + text-encoding-utf-8 "^1.0.2" + tslib "^2.2.0" + append-buffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/append-buffer/-/append-buffer-1.0.2.tgz#d8220cf466081525efea50614f3de6514dfa58f1" @@ -4597,6 +4628,16 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= +array-back@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-3.1.0.tgz#b8859d7a508871c9a7b2cf42f99428f65e96bfb0" + integrity sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q== + +array-back@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-4.0.2.tgz#8004e999a6274586beeb27342168652fdb89fa1e" + integrity sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg== + array-buffer-byte-length@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" @@ -6059,6 +6100,26 @@ comma-separated-tokens@^1.0.1: resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== +command-line-args@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-5.1.1.tgz#88e793e5bb3ceb30754a86863f0401ac92fd369a" + integrity sha512-hL/eG8lrll1Qy1ezvkant+trihbGnaKaeEjj6Scyr3DN+RC7iQ5Rz84IeLERfAWDGo0HBSNAakczwgCilDXnWg== + dependencies: + array-back "^3.0.1" + find-replace "^3.0.0" + lodash.camelcase "^4.3.0" + typical "^4.0.0" + +command-line-usage@6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/command-line-usage/-/command-line-usage-6.1.1.tgz#c908e28686108917758a49f45efb4f02f76bc03f" + integrity sha512-F59pEuAR9o1SF/bD0dQBDluhpT4jJQNWUHEuVBqpDmCUo6gPjCi+m9fCWnWZVR/oG6cMTUms4h+3NPl74wGXvA== + dependencies: + array-back "^4.0.1" + chalk "^2.4.2" + table-layout "^1.0.1" + typical "^5.2.0" + commander@2, commander@^2.18.0, commander@^2.19.0, commander@^2.20.0, commander@^2.9.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -6857,7 +6918,7 @@ deep-equal@^2.0.5: which-collection "^1.0.1" which-typed-array "^1.1.9" -deep-extend@^0.6.0: +deep-extend@^0.6.0, deep-extend@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== @@ -8537,6 +8598,13 @@ find-cache-dir@^3.2.0, find-cache-dir@^3.3.1: make-dir "^3.0.2" pkg-dir "^4.1.0" +find-replace@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" + integrity sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ== + dependencies: + array-back "^3.0.1" + find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" @@ -8587,6 +8655,11 @@ flat-cache@^3.0.4: flatted "^3.1.0" rimraf "^3.0.2" +flatbuffers@1.12.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/flatbuffers/-/flatbuffers-1.12.0.tgz#72e87d1726cb1b216e839ef02658aa87dcef68aa" + integrity sha512-c7CZADjRcl6j0PlvFy0ZqXQ67qSEZfrVPynmnL+2zPc+NtMvrF8Y0QceMo7QqnSPc7+uWjUIAbvCQ5WIKlMVdQ== + flatted@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" @@ -11288,6 +11361,11 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= +json-bignum@^0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/json-bignum/-/json-bignum-0.0.3.tgz#41163b50436c773d82424dbc20ed70db7604b8d7" + integrity sha512-2WHyXj3OfHSgNyuzDbSxI1w2jgw5gkWSWhS7Qg4bWXx1nLk3jnbwfUeS0PSba3IzpTUWdHxBieELUzXRjQB2zg== + json-loader@^0.5.4: version "0.5.7" resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" @@ -13151,6 +13229,13 @@ package-json@^2.0.0: registry-url "^3.0.3" semver "^5.1.0" +pad-left@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/pad-left/-/pad-left-2.1.0.tgz#16e6a3b2d44a8e138cb0838cc7cb403a4fc9e994" + integrity sha512-HJxs9K9AztdIQIAIa/OIazRAUW/L6B9hbQDxO4X07roW3eo9XqZc2ur9bn1StH9CnbbI9EgvejHQX7CBpCF1QA== + dependencies: + repeat-string "^1.5.4" + pako@~1.0.5: version "1.0.11" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" @@ -14636,6 +14721,11 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" +reduce-flatten@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" + integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== + reduce-reducers@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/reduce-reducers/-/reduce-reducers-0.4.3.tgz#8e052618801cd8fc2714b4915adaa8937eb6d66c" @@ -16532,6 +16622,16 @@ syntax-error@^1.1.1: dependencies: acorn-node "^1.2.0" +table-layout@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-1.0.2.tgz#c4038a1853b0136d63365a734b6931cf4fad4a04" + integrity sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A== + dependencies: + array-back "^4.0.1" + deep-extend "~0.6.0" + typical "^5.2.0" + wordwrapjs "^4.0.0" + table@^5.2.3: version "5.4.6" resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" @@ -16675,6 +16775,11 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" +text-encoding-utf-8@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz#585b62197b0ae437e3c7b5d0af27ac1021e10d13" + integrity sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg== + text-encoding@0.6.4: version "0.6.4" resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" @@ -16951,7 +17056,7 @@ tslib@^2.0.3: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== -tslib@^2.4.0: +tslib@^2.2.0, tslib@^2.4.0: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== @@ -17120,6 +17225,16 @@ typescript@4.5.5: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== +typical@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" + integrity sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw== + +typical@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" + integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== + ua-parser-js@^0.7.18: version "0.7.33" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.33.tgz#1d04acb4ccef9293df6f70f2c3d22f3030d8b532" @@ -18160,6 +18275,14 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= +wordwrapjs@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-4.0.1.tgz#d9790bccfb110a0fc7836b5ebce0937b37a8b98f" + integrity sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA== + dependencies: + reduce-flatten "^2.0.0" + typical "^5.2.0" + worker-farm@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" From 35903247c5cbb67fb6848a9824dd868291a196d1 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 19 Oct 2023 16:34:39 -0700 Subject: [PATCH 28/29] wip --- babel.config.js | 1 + package.json | 1 + .../src/geojson-layer/filter-arrow-layer.ts | 4 +- yarn.lock | 64 ++++++++++++++++++- 4 files changed, 67 insertions(+), 3 deletions(-) diff --git a/babel.config.js b/babel.config.js index d5c563db0b..a5eed4ad41 100644 --- a/babel.config.js +++ b/babel.config.js @@ -27,6 +27,7 @@ const PRESETS = ['@babel/preset-env', '@babel/preset-react', '@babel/preset-type const PLUGINS = [ ['@babel/plugin-transform-typescript', {isTSX: true, allowDeclareFields: true}], '@babel/plugin-transform-modules-commonjs', + '@babel/plugin-transform-class-properties', '@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-export-namespace-from', '@babel/plugin-proposal-optional-chaining', diff --git a/package.json b/package.json index b484785b10..d27076dc60 100644 --- a/package.json +++ b/package.json @@ -130,6 +130,7 @@ "@babel/plugin-proposal-class-properties": "^7.12.1", "@babel/plugin-proposal-export-namespace-from": "^7.12.1", "@babel/plugin-proposal-optional-chaining": "^7.12.1", + "@babel/plugin-transform-class-properties": "^7.12.1", "@babel/plugin-transform-modules-commonjs": "^7.12.1", "@babel/plugin-transform-runtime": "^7.12.1", "@babel/plugin-transform-typescript": "^7.16.8", diff --git a/src/deckgl-layers/src/geojson-layer/filter-arrow-layer.ts b/src/deckgl-layers/src/geojson-layer/filter-arrow-layer.ts index 12e6907dfa..10768e2c7f 100644 --- a/src/deckgl-layers/src/geojson-layer/filter-arrow-layer.ts +++ b/src/deckgl-layers/src/geojson-layer/filter-arrow-layer.ts @@ -14,7 +14,9 @@ export type FilterArrowExtensionProps = { getFiltered?: () => number; }; -// A simple extension to filter arrow layer based on the CPU filteredIndex, so we can avoid filtering on the raw Arrow table. +// TODO: this should be in deck.gl extensions +// A simple extension to filter arrow layer based on the result of CPU filteredIndex, +// so we can avoid filtering on the raw Arrow table and recreating geometry attributes. // Specifically, an attribute `filtered` is added to the layer to indicate whether the feature has been Filtered // the shader module is modified to discard the feature if filtered value is 0 // the accessor getFiltered is used to get the value of `filtered` based on eht value `filteredIndex` in Arrowlayer diff --git a/yarn.lock b/yarn.lock index 63b1ce58b3..cf7e8f2770 100644 --- a/yarn.lock +++ b/yarn.lock @@ -158,6 +158,13 @@ dependencies: "@babel/types" "^7.16.7" +"@babel/helper-annotate-as-pure@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" + integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== + dependencies: + "@babel/types" "^7.22.5" + "@babel/helper-builder-binary-assignment-operator-visitor@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.12.13.tgz#6bc20361c88b0a74d05137a65cac8d3cbf6f61fc" @@ -211,6 +218,21 @@ "@babel/helper-replace-supers" "^7.16.7" "@babel/helper-split-export-declaration" "^7.16.7" +"@babel/helper-create-class-features-plugin@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz#97a61b385e57fe458496fad19f8e63b63c867de4" + integrity sha512-jKkwA59IXcvSaiK2UN45kKwSC9o+KuoXsBDvHvU/7BecYIp8GQ2UwrVvFgJASUT+hBnwJx6MhvMCuMzwZZ7jlg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-member-expression-to-functions" "^7.22.15" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + semver "^6.3.1" + "@babel/helper-create-regexp-features-plugin@^7.12.13": version "7.12.17" resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.17.tgz#a2ac87e9e319269ac655b8d4415e94d38d663cb7" @@ -240,7 +262,7 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-environment-visitor@^7.22.20": +"@babel/helper-environment-visitor@^7.22.20", "@babel/helper-environment-visitor@^7.22.5": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== @@ -270,7 +292,7 @@ "@babel/template" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/helper-function-name@^7.23.0": +"@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== @@ -328,6 +350,13 @@ dependencies: "@babel/types" "^7.16.7" +"@babel/helper-member-expression-to-functions@^7.22.15": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz#9263e88cc5e41d39ec18c9a3e0eced59a3e7d366" + integrity sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA== + dependencies: + "@babel/types" "^7.23.0" + "@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.13.12": version "7.13.12" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" @@ -381,6 +410,13 @@ dependencies: "@babel/types" "^7.16.7" +"@babel/helper-optimise-call-expression@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" + integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw== + dependencies: + "@babel/types" "^7.22.5" + "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" @@ -426,6 +462,15 @@ "@babel/traverse" "^7.16.7" "@babel/types" "^7.16.7" +"@babel/helper-replace-supers@^7.22.9": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz#e37d367123ca98fe455a9887734ed2e16eb7a793" + integrity sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-member-expression-to-functions" "^7.22.15" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-simple-access@^7.12.13", "@babel/helper-simple-access@^7.13.12": version "7.13.12" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz#dd6c538afb61819d205a012c31792a39c7a5eaf6" @@ -447,6 +492,13 @@ dependencies: "@babel/types" "^7.12.1" +"@babel/helper-skip-transparent-expression-wrappers@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" + integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q== + dependencies: + "@babel/types" "^7.22.5" + "@babel/helper-split-export-declaration@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" @@ -985,6 +1037,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" +"@babel/plugin-transform-class-properties@^7.12.1": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.5.tgz#97a56e31ad8c9dc06a0b3710ce7803d5a48cca77" + integrity sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-transform-classes@^7.13.0": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz#0265155075c42918bf4d3a4053134176ad9b533b" From 41fb3b1fc5c112420af143bef6cf57789002fff1 Mon Sep 17 00:00:00 2001 From: Xun Li Date: Thu, 19 Oct 2023 19:51:38 -0700 Subject: [PATCH 29/29] wip --- babel.config.js | 1 - package.json | 1 - yarn.lock | 64 ++----------------------------------------------- 3 files changed, 2 insertions(+), 64 deletions(-) diff --git a/babel.config.js b/babel.config.js index a5eed4ad41..d5c563db0b 100644 --- a/babel.config.js +++ b/babel.config.js @@ -27,7 +27,6 @@ const PRESETS = ['@babel/preset-env', '@babel/preset-react', '@babel/preset-type const PLUGINS = [ ['@babel/plugin-transform-typescript', {isTSX: true, allowDeclareFields: true}], '@babel/plugin-transform-modules-commonjs', - '@babel/plugin-transform-class-properties', '@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-export-namespace-from', '@babel/plugin-proposal-optional-chaining', diff --git a/package.json b/package.json index d27076dc60..b484785b10 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,6 @@ "@babel/plugin-proposal-class-properties": "^7.12.1", "@babel/plugin-proposal-export-namespace-from": "^7.12.1", "@babel/plugin-proposal-optional-chaining": "^7.12.1", - "@babel/plugin-transform-class-properties": "^7.12.1", "@babel/plugin-transform-modules-commonjs": "^7.12.1", "@babel/plugin-transform-runtime": "^7.12.1", "@babel/plugin-transform-typescript": "^7.16.8", diff --git a/yarn.lock b/yarn.lock index cf7e8f2770..63b1ce58b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -158,13 +158,6 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-annotate-as-pure@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" - integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== - dependencies: - "@babel/types" "^7.22.5" - "@babel/helper-builder-binary-assignment-operator-visitor@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.12.13.tgz#6bc20361c88b0a74d05137a65cac8d3cbf6f61fc" @@ -218,21 +211,6 @@ "@babel/helper-replace-supers" "^7.16.7" "@babel/helper-split-export-declaration" "^7.16.7" -"@babel/helper-create-class-features-plugin@^7.22.5": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz#97a61b385e57fe458496fad19f8e63b63c867de4" - integrity sha512-jKkwA59IXcvSaiK2UN45kKwSC9o+KuoXsBDvHvU/7BecYIp8GQ2UwrVvFgJASUT+hBnwJx6MhvMCuMzwZZ7jlg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-function-name" "^7.22.5" - "@babel/helper-member-expression-to-functions" "^7.22.15" - "@babel/helper-optimise-call-expression" "^7.22.5" - "@babel/helper-replace-supers" "^7.22.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - semver "^6.3.1" - "@babel/helper-create-regexp-features-plugin@^7.12.13": version "7.12.17" resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.17.tgz#a2ac87e9e319269ac655b8d4415e94d38d663cb7" @@ -262,7 +240,7 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-environment-visitor@^7.22.20", "@babel/helper-environment-visitor@^7.22.5": +"@babel/helper-environment-visitor@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== @@ -292,7 +270,7 @@ "@babel/template" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0": +"@babel/helper-function-name@^7.23.0": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== @@ -350,13 +328,6 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-member-expression-to-functions@^7.22.15": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz#9263e88cc5e41d39ec18c9a3e0eced59a3e7d366" - integrity sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA== - dependencies: - "@babel/types" "^7.23.0" - "@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.13.12": version "7.13.12" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" @@ -410,13 +381,6 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-optimise-call-expression@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" - integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw== - dependencies: - "@babel/types" "^7.22.5" - "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" @@ -462,15 +426,6 @@ "@babel/traverse" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/helper-replace-supers@^7.22.9": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz#e37d367123ca98fe455a9887734ed2e16eb7a793" - integrity sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw== - dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-member-expression-to-functions" "^7.22.15" - "@babel/helper-optimise-call-expression" "^7.22.5" - "@babel/helper-simple-access@^7.12.13", "@babel/helper-simple-access@^7.13.12": version "7.13.12" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz#dd6c538afb61819d205a012c31792a39c7a5eaf6" @@ -492,13 +447,6 @@ dependencies: "@babel/types" "^7.12.1" -"@babel/helper-skip-transparent-expression-wrappers@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" - integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q== - dependencies: - "@babel/types" "^7.22.5" - "@babel/helper-split-export-declaration@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" @@ -1037,14 +985,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-class-properties@^7.12.1": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.5.tgz#97a56e31ad8c9dc06a0b3710ce7803d5a48cca77" - integrity sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.22.5" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-transform-classes@^7.13.0": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz#0265155075c42918bf4d3a4053134176ad9b533b"