Python JSON libraries
JavaScript Object Notation (JSON) is rapidly becoming the number one data exchange format across a lot of fields. The lightweight syntax and the similarity to existing data structures in both the JavaScript from which Python borrows some data structures makes it a perfect match for Python.
The following GeoJSON sample document contains a single point:
{ "type": "Feature", "id": "OpenLayers.Feature.Vector_314", "properties": {}, "geometry": { "type": "Point", "coordinates": [ 97.03125, 39.7265625 ] }, "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } } }
This sample is just a simple point with new attributes, which would be stored in the properties
data structure of the geometry. First, we'll compact the sample document into a single string to make it easier to handle:
>>> jsdata = """{ "type": "Feature", "id": "OpenLayers...