@loaders.gl/wkt
Version:
Loader and Writer for the WKT (Well Known Text) Format
30 lines (29 loc) • 1.3 kB
TypeScript
import { Geometry } from '@loaders.gl/schema';
export declare const WKT_MAGIC_STRINGS: string[];
export type ParseWKTOptions = {
wkt?: {
/** Whether to add any CRS, if found, as undocumented CRS property on the return geometry */
crs?: boolean;
};
};
/**
* Check if a string is WKT.
* @param input A potential WKT geometry string
* @return `true` if input appears to be a WKT geometry string, `false` otherwise
* @note We only support the "geojson" subset of the OGC simple features standard
* @todo Does not handle leading spaces which appear to be permitted per the spec:
* "A WKT string contains no white space outside of double quotes.
* However padding with white space to improve human readability is permitted;
* the examples of WKT that are included in this document have
* spaces and line feeds inserted to improve clarity. Any padding is stripped out or ignored by parsers."
*/
export declare function isWKT(input: string): boolean;
/**
* Parse WKT and return GeoJSON.
* @param input A WKT geometry string
* @return A GeoJSON geometry object
*
* @note We only support the "geojson" subset of the OGC simple features standard
**/
export declare function parseWKT(input: string, options?: ParseWKTOptions): Geometry;
//# sourceMappingURL=parse-wkt.d.ts.map