[ckan-dev] Representing GeoSpatial polygons: Which is the right format?

Peder Jakobsen pjakobsen at gmail.com
Tue Apr 2 21:18:44 UTC 2013


Hi, 

The string.Template found in https://github.com/okfn/ckanext-spatial/blob/master/ckanext/spatial/harvesters.py 

produces this json:  {"type": "Polygon", "coordinates": [[[-119.5, 59], [-119.5, 59.25], [-119, 59.25], [-119, 59], [-119.5, 59]]]}

On the other hand, dumping and array of points using the geojson lib   found at https://pypi.python.org/pypi/geojson/1.0 

e.g.   geojson.dumps(geojson.geometry.Polygon(someArrayOfPoints))   produces this:

{"type": "Polygon", "coordinates": ["70.01 -110.27", "70.102 -110.274", "70.10 -110.2", "70.083604 -110.222364", "70.083824 -110.274833"]}

Why the nested lists in the first example, and what is the correct way?

Thanks in advance,

Peder Jakobsen





More information about the ckan-dev mailing list