ZOO.Format.WKT¶
Class for reading and writing Well-Known Text.
Inherits from
Functions and Properties¶
NAME | DESCRIPTION |
---|---|
ZOO.Format.WKT | Create a new parser for WKT |
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. |
extract | Object with properties corresponding to the geometry types. |
parse | Object with properties corresponding to the geometry types. |
parse.point | Return point feature given a point WKT fragment. |
parse.multipoint | Return a multipoint feature given a multipoint WKT fragment. |
parse.linestring | Return a linestring feature given a linestring WKT fragment. |
parse.multilinestring | Return a multilinestring feature given a multilinestring WKT fragment. |
parse.polygon | Return a polygon feature given a polygon WKT fragment. |
parse.multipolygon | Return a multipolygon feature given a multipolygon WKT fragment. |
parse.geometrycollection | Return an array of features given a geometrycollection WKT fragment. |
- ZOO.Format.WKT
Create a new parser for WKT
Parameters
options {Object}
An optional object whose properties will be set on this instanceReturns
{ZOO.Format.WKT} A new WKT parser.
- 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 stringReturns
{<ZOO.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 {<ZOO.Feature.Vector>|Array}
A feature or array of featuresReturns
{String}
The WKT string representation of the input geometries
- extract
- Object with properties corresponding to the geometry types. Property values are functions that do the actual data extraction.
- parse
- Object with properties corresponding to the geometry types. Property values are functions that do the actual parsing.
- parse.point
Return point feature given a point WKT fragment.
Parameters
str {String}
A WKT fragment representing the pointReturns
{ZOO.Feature} A point feature
- parse.multipoint
Return a multipoint feature given a multipoint WKT fragment.
Parameters
str {String}
A WKT fragment representing the multipointReturns
{ZOO.Feature} A multipoint feature
- parse.linestring
Return a linestring feature given a linestring WKT fragment.
Parameters
str {String}
A WKT fragment representing the linestringReturns
{ZOO.Feature} A linestring feature
- parse.multilinestring
Return a multilinestring feature given a multilinestring WKT fragment.
Parameters
str {String}
A WKT fragment representing the multilinestringReturns
{ZOO.Feature} A multilinestring feature
- parse.polygon
Return a polygon feature given a polygon WKT fragment.
Parameters
str {String}
A WKT fragment representing the polygonReturns
{ZOO.Feature} A polygon feature
- parse.multipolygon
Return a multipolygon feature given a multipolygon WKT fragment.
Parameters
str {String}
A WKT fragment representing the multipolygonReturns
{ZOO.Feature} A multipolygon feature
- parse.geometrycollection
Return an array of features given a geometrycollection WKT fragment.
Parameters
str {String}
A WKT fragment representing the geometrycollectionReturns
{Array}
An array of ZOO.Feature