Class: Wkt

Wkt. Wkt

new Wkt(initializer) → {Wkt.Wkt}

An object for reading WKT strings and writing geographic features
Parameters:
Name Type Description
initializer String An optional WKT string for immediate read
Properties:
Name Type Description
components Array Holder for atomic geometry objects (internal representation of geometric components)
delimiter String The default delimiter for separating components of atomic geometry (coordinates)
regExes Object Some regular expressions copied from OpenLayers.Format.WKT.js
wrapVerticies Boolean True to wrap vertices in MULTIPOINT geometries; If true: MULTIPOINT((30 10),(10 30),(40 40)); If false: MULTIPOINT(30 10,10 30,40 40)
Source:
Returns:
Type
Wkt.Wkt

Namespaces

extract
ingest

Methods

<static> this.fromObject(obj) → {Wkt.Wkt}

Sets internal geometry (components) from framework geometry (e.g. Google Polygon objects or google.maps.Polygon).
Parameters:
Name Type Description
obj Object The framework-dependent geometry representation
Source:
Returns:
The object itself
Type
Wkt.Wkt

<static> this.isCollection() → {Boolean}

Returns true if the internal geometry is a collection of geometries.
Source:
Returns:
Returns true when it is a collection
Type
Boolean

<static> this.read(wkt) → {Array}

Reads a WKT string, validating and incorporating it.
Parameters:
Name Type Description
wkt String A WKT string
Source:
Returns:
An Array of internal geometry objects
Type
Array

<static> this.sameCoords(a, b) → {Boolean}

Compares two x,y coordinates for equality.
Parameters:
Name Type Description
a Object An object with x and y properties
b Object An object with x and y properties
Source:
Returns:
Type
Boolean

<static> this.toObject(config) → {Object}

Creates external geometry objects based on a plug-in framework's construction methods and available geometry classes.
Parameters:
Name Type Description
config Object An optional framework-dependent properties specification
Source:
Returns:
The framework-dependent geometry representation
Type
Object

<static> this.write(components) → {String}

Writes a WKT string.
Parameters:
Name Type Description
components Array An Array of internal geometry objects
Source:
Returns:
The corresponding WKT representation
Type
String