Class for reading and writing Well-Known Text.
Inherits from
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. |
Create a new parser for WKT
Parameters
options {Object} An optional object whose properties will be set on this instance
Returns
{ZOO.Format.WKT} A new WKT parser.
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
{<ZOO.Feature.Vector>|Array} A feature or array of features for GEOMETRYCOLLECTION WKT.
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 features
Returns
{String} The WKT string representation of the input geometries
Return point feature given a point WKT fragment.
Parameters
str {String} A WKT fragment representing the point
Returns
{ZOO.Feature} A point feature
Return a multipoint feature given a multipoint WKT fragment.
Parameters
str {String} A WKT fragment representing the multipoint
Returns
{ZOO.Feature} A multipoint feature
Return a linestring feature given a linestring WKT fragment.
Parameters
str {String} A WKT fragment representing the linestring
Returns
{ZOO.Feature} A linestring feature
Return a multilinestring feature given a multilinestring WKT fragment.
Parameters
str {String} A WKT fragment representing the multilinestring
Returns
{ZOO.Feature} A multilinestring feature
Return a polygon feature given a polygon WKT fragment.
Parameters
str {String} A WKT fragment representing the polygon
Returns
{ZOO.Feature} A polygon feature
Return a multipolygon feature given a multipolygon WKT fragment.
Parameters
str {String} A WKT fragment representing the multipolygon
Returns
{ZOO.Feature} A multipolygon feature
Return an array of features given a geometrycollection WKT fragment.
Parameters
str {String} A WKT fragment representing the geometrycollection
Returns
{Array} An array of ZOO.Feature