@loaders.gl/shapefile
Version:
Loader for the Shapefile Format
35 lines • 1.09 kB
JavaScript
// 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.4.4" !== 'undefined' ? "4.4.4" : '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
};
//# sourceMappingURL=shapefile-loader.js.map