UNPKG

@loaders.gl/wkt

Version:

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

28 lines (27 loc) 1.02 kB
// loaders.gl // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors import { VERSION } from "./lib/utils/version.js"; import { encodeWKTCRS } from "./lib/encode-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 WKTCRSWriter = { 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': {} }, encode: async (wktcrs, options) => new TextEncoder().encode(encodeWKTCRS(wktcrs, options?.['wkt-crs'])), encodeSync: (wktcrs, options) => new TextEncoder().encode(encodeWKTCRS(wktcrs, options?.['wkt-crs'])), encodeTextSync: (wktcrs, options) => encodeWKTCRS(wktcrs, options?.['wkt-crs']) };