geomet

1.1.0 · active · verified Thu Apr 09

geomet is a pure Python library designed for converting between various common geospatial data formats, including Well-Known Text (WKT), Well-Known Binary (WKB), GeoJSON, and EsriJSON. The current version is 1.1.0, with releases occurring a few times a year, primarily for compatibility updates and bug fixes.

Warnings

Install

Imports

Quickstart

This example demonstrates converting a WKT string into a GeoJSON dictionary and then dumping it back into a GeoJSON string using the `wkt` and `geojson` modules.

from geomet import wkt, geojson

wkt_string = "POINT (30 10)"

# Convert WKT to GeoJSON dictionary
geom_dict = wkt.loads(wkt_string)
print(f"WKT loaded as: {geom_dict}")
# Expected: {'type': 'Point', 'coordinates': (30.0, 10.0)}

# Convert GeoJSON dictionary back to GeoJSON string
json_string = geojson.dumps(geom_dict)
print(f"GeoJSON dumped as: {json_string}")
# Expected: {"type": "Point", "coordinates": [30.0, 10.0]}

view raw JSON →