UNPKG

@loaders.gl/wkt

Version:

Loader and Writer for the WKT (Well Known Text) Format

29 lines (28 loc) 957 B
// loaders.gl // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors import { VERSION } from "./lib/utils/version.js"; import { parseWKTCRS } from "./lib/parse-wkt-crs.js"; /** * Well-Known text CRS loader * @see OGC Standard: https://www.ogc.org/standards/wkt-crs * @see Wikipedia Page: https://en.wikipedia.org/wiki/Well-known_text_representation_of_coordinate_reference_systems */ export const WKTCRSLoader = { dataType: null, batchType: null, name: 'WKT CRS (Well-Known Text Coordinate Reference System)', id: 'wkt-crs', module: 'wkt-crs', version: VERSION, worker: true, extensions: [], mimeTypes: ['text/plain'], category: 'json', text: true, options: { 'wkt-crs': {} }, parse: async (arrayBuffer, options) => parseWKTCRS(new TextDecoder().decode(arrayBuffer), options?.['wkt-crs']), parseTextSync: (string, options) => parseWKTCRS(string, options?.['wkt-crs']) };