示例#1
0
def wkt_to_geojson(wktStr):
    """Return GeoJSON from a WKT string."""
    # Create instances of vectorfeatures WKT/GeoJSON Classes
    inWKT = WKT.WKT()
    outGeoJSON = GeoJSON.GeoJSON()
    # Decode WKT to vectorformats features, and re-encode as GeoJSON
    return outGeoJSON.encode(inWKT.decode(wktStr), to_string=True)