GeoScript

Previous topic

GML

Next topic

WKT

This Page

JSON

geoscript.geom.io.json.readJSON(json)

Reads a geometry a from GeoJSON.

>>> readJSON('{"type":"Point","coordinates":[1,2]}')
POINT (1 2)
geoscript.geom.io.json.writeJSON(g)

Writes a geometry object as GeoJSON.

>>> from geoscript.geom import Point 
>>> str(writeJSON(Point(1,2)))
'{"type":"Point","coordinates":[1,2]}'