Shapely is to be an LGPL-licensed replacement for PCL's cartography.geometry package. Like its ancestor, it will provide familiar geometry classes with all the spatial operators of GEOS. When done, cartography.geometry can be rewritten as a lightweight layer over the new code. Additionally, Shapely will have a more Pythonic serialization story, and plug and play with other powerful Python packages using the Numpy array interface. Last, but not least, Shapely will be much easier to build, install and deploy.
Shapely serializes and deserializes using the familiar idiom from the pickle module. Here's a pickle stream example (an actual project doctest):
>>> from shapely.geometry import Point >>> import pickle >>> point = Point(0.0, 0.0) >>> data = pickle.dumps(point) >>> pp = pickle.loads(data) >>> pp.equals(point) True
On closer examination, looks like one should be able to add contrib.gis to python path and import contrib.gis.gdal after all.Sean, I've tried to ensure that GeoDjango's external interfaces to GDAL/OGR and GEOS were as loosely coupled as possible. As far as I know, both interfaces are completely independent of Django -- the only requirements are ctypes and a compiled C library of the interface.
Comments are closed after 13 days.
Some rights reserved 2008 by Sean Gillies.
1Re: Shapely Geometries for Python
Bill Thorp, 2007-06-12T02:58:30Z