UNPKG

@loaders.gl/shapefile

Version:

Loader for the Shapefile Format

35 lines (34 loc) 1.04 kB
// loaders.gl // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors import { SHP_MAGIC_NUMBER } from "./shp-loader.js"; import { parseShapefile, parseShapefileInBatches } from "./lib/parsers/parse-shapefile.js"; // __VERSION__ is injected by babel-plugin-version-inline // @ts-ignore TS2304: Cannot find name '__VERSION__'. const VERSION = typeof "4.3.3" !== 'undefined' ? "4.3.3" : 'latest'; /** * Shapefile loader * @note Shapefile is multifile format and requires providing additional files */ export const ShapefileLoader = { name: 'Shapefile', id: 'shapefile', module: 'shapefile', version: VERSION, category: 'geometry', extensions: ['shp'], mimeTypes: ['application/octet-stream'], tests: [new Uint8Array(SHP_MAGIC_NUMBER).buffer], options: { shapefile: { shape: 'v3' }, shp: { _maxDimensions: 4 } }, // @ts-expect-error parse: parseShapefile, // @ts-expect-error parseInBatches: parseShapefileInBatches };