• JMap.Geometry.getFeatureFromWkt

    Returns a GeoJSON feature from a Well-Known Text geometry representation.

    Parameters

    • wkt: string

      a Well-Known Text geometry

    Returns GeoJSON.Feature

    Throws

    if the passed WKT is invalid

    Example

    const wktPolygon = "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))"
    // The method will return a polygon feature
    const polygonFeature = JMap.Geometry.getFeatureFromWkt(wkt)