Namespace: wkt

H.util.wkt

This namespace contains functionality to process geometries in Well Known Text (WKT) format.

Methods

H.util.wkt.toGeometry (wkt)H.geo.AbstractGeometry static

To create a geometry according to the given Well Known Text (WKT) . It supports the following geometry types:

  • POINT (A value of EMPTY is not supported and results into null)
  • LINESTRING
  • POLYGON
  • MULTIPOINT
  • MULTILINESTRING
  • MULTIPOLYGON

The designator Z and M are supported but only the latitude values (Z) are taken into account, whereas the measure values (M) are discarded.

Name Type Description
wkt string
Throws:

in case of malformed WKT.

Type
H.lang.InvalidArgumentError
Returns:
Type Description
H.geo.AbstractGeometry The resulting geometry
Example
var geoPoint = H.util.wkt.toGeometry('POINT (13.3827 52.5309)');
map.addObject(new H.map.Marker(geoPoint));