GeoScript

Previous topic

GML

Next topic

filter

This Page

JSON

geoscript.feature.io.json.writeJSON(f)

Writes a Feature object as GeoJSON.

>>> from geoscript.geom import Point
>>> writeJSON(Feature({'geom':Point(1,1),'name':'one'},'1'))
u'{"type":"Feature","geometry":{"type":"Point","coordinates":[1,1]},"properties":{"name":"one"},"id":"1"}'
geoscript.feature.io.json.readJSON(json)

Reads a Feature object from GeoJSON.

>>> readJSON('{"type":"Feature","geometry":{"type":"Point","coordinates":[1,1]},"properties":{"name":"one"},"id":"1"}')
feature.1 {name: one, geometry: POINT (1 1)}