# WKTLoader

class in `three-geojson`, extends `GeoJSONLoader`

```js
import { WKTLoader } from 'three-geojson';
```

Loader and parser for the
[WKT](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) format. The
contents are converted to GeoJSON using the
[betterknown](https://github.com/placemark/betterknown) package and then parsed with the
GeoJSONLoader parse function.

Example: Extruding a WKT polygon

```js
import { MeshNormalMaterial } from 'three';
import { WKTLoader } from 'three-geojson';

// scene, camera and renderer are initialized here

const URL = 'https://raw.githubusercontent.com/gkjohnson/three-geojson/main/example/california.wkt';
const result = await new WKTLoader().loadAsync( URL );

const mesh = result.polygons[ 0 ].getMeshObject( { thickness: 1 } );
mesh.material = new MeshNormalMaterial();
mesh.scale.setScalar( 0.3 );
mesh.rotation.x = - Math.PI / 2;
mesh.position.set( 0, 0, 0 );
scene.add( mesh );
```

## Methods

### .loadAsync

```js
.loadAsync( url: string ): Promise<GeoJSONResult>
```

Loads and parses a WKT file.

- `url`, `string`

### .parse

```js
.parse( text: string ): GeoJSONResult
```

Parses WKT content.

- `text`, `string`
