# OpenLayers.Format.WKT

Class for reading and writing Well-Known Text. Create a new instance with the OpenLayers.Format.WKT constructor.

#### Inherits from

- OpenLayers.Format

Summary

OpenLayers.Format.WKT | Class for reading and writing Well-Known Text.
Constructor |
OpenLayers.Format.WKT | Create a new parser for WKT
Functions |
read | Deserialize a WKT string and return a vector feature or an array of vector features.
write | Serialize a feature or array of features into a WKT string.
extractGeometry | Entry point to construct the WKT for a single Geometry object.

### Constructor

### OpenLayers.Format.WKT

Create a new parser for WKT

#### Parameters

options | {Object} An optional object whose properties will be set on this instance

#### Returns

{OpenLayers.Format.WKT} A new WKT parser.

### Functions

### read

> read: function( | wkt | )

Deserialize a WKT string and return a vector feature or an array of vector features. Supports WKT for POINT, MULTIPOINT, LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON, and GEOMETRYCOLLECTION.

#### Parameters

wkt | {String} A WKT string

#### Returns

{<OpenLayers.Feature.Vector>|Array} A feature or array of features for GEOMETRYCOLLECTION WKT.

### write

> write: function( | features | )

Serialize a feature or array of features into a WKT string.

#### Parameters

features | {<OpenLayers.Feature.Vector>|Array} A feature or array of features

#### Returns

{String} The WKT string representation of the input geometries

### extractGeometry

> extractGeometry: function( | geometry | )

Entry point to construct the WKT for a single Geometry object.

#### Parameters

geometry | {<OpenLayers.Geometry.Geometry>}

#### Returns

{String} A WKT string of representing the geometry

> read: function( | wkt | )

Deserialize a WKT string and return a vector feature or an array of vector features.

> write: function( | features | )

Serialize a feature or array of features into a WKT string.

> extractGeometry: function( | geometry | )

Entry point to construct the WKT for a single Geometry object.
Create a new parser for WKT
Base class for format reading/writing a variety of formats.
Close