Shapely's had a
shape() function that makes geometric objects from
GeoJSON-like mappings for some time. Now, by popular request, is the inverse:
>>> from shapely.geometry import Point, mapping >>> m = mapping(Point(0, 0)) >>> m['type'] 'Point' >>> m['coordinates'] (0.0, 0.0)
The new function operates on any object that provides
[link]. This release also fixes a major bug involving GEOS versions < 3.1 introduced in
1.2.2. You can download an sdist from http://pypi.python.org/pypi/Shapely/. Windows installers should be coming soon.
As I like to remind people every few releases, major portions of this work were supported by a grant (for Pleiades) from the U.S. National Endowment for the Humanities (http://www.neh.gov).
Update (2010-08-22): Win32 and Win-AMD64 installers have been uploaded to the locations above.