Class: WKT

SuperMap.Format.WKT

用于读写常见文本的类。通过 SuperMap.Format.WKT 构造器来创建一个新的实例。

new SuperMap.Format.WKT(options)

common/format/WKT.js, line 16
Name Type Description
options Object

可选的选项对象,其属性将被设置到实例。option 具体配置项继承自 SuperMap.Format

Extends

Members

dataObject

当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。

keepDataObject

保持最近读到的数据的引用(通过 属性)。

optionsObject

可选参数。

Methods

inherited destroy()

common/format/Format.js, line 42

销毁该格式类,释放相关资源。

extractGeometry(geometry){string}

common/format/WKT.js, line 336

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

Name Type Description
geometry SuperMap.Geometry
Returns:
Type Description
string A WKT string of representing the geometry

read(wkt){SuperMap.Feature.Vector|Array}

common/format/WKT.js, line 279

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.

Name Type Description
wkt string

A WKT string

Returns:
Type Description
SuperMap.Feature.Vector | Array A feature or array of features for GEOMETRYCOLLECTION WKT.

write(features){string}

common/format/WKT.js, line 304

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

Name Type Description
features SuperMap.Feature.Vector | Array

A feature or array of features

Returns:
Type Description
string The WKT string representation of the input geometries