Skip to main content

WKTLoader

From-v2.1

Loader and writer for the Well-known text format for representation of geometry.

LoaderCharacteristic
File Extension.wkt,
File TypeText
File FormatWell Known Text
Data FormatGeometry
Supported APIsload, parse, parseSync
Decoder TypeSynchronous
Worker Thread SupportYes Website shields.io

Usage

import {WKTLoader} from '@loaders.gl/wkt';
import {parseSync} from '@loaders.gl/core';

const data = parseSync('LINESTRING (30 10, 10 30, 40 40)', WKTLoader);
// => {type: 'LineString', coordinates: [[30, 10], [10, 30], [40, 40]]}
import {WKTLoader} from '@loaders.gl/wkt';
import {load} from '@loaders.gl/core';

const data = await load(url, WKTLoader);

Options

N/A

Attribution

The WKTLoader is based on a fork of the Mapbox wellknown module under the ISC license (MIT/BSD 2-clause equivalent).