Shapely for Python 3.0
2007-09-06T18:28:57Z | Comments: 3
Shapely is a thin wrapper for libgeos_c. How thin? With help from the 2to3 tool, I ported Shapely to Python 3.0 in less than an hour -- that's how thin. Since distutils and setuptools aren't quite ready to go, you will have to get the code from the lab repository, add it to your path, and import it in place if you want to try it out:
$ svn co http://svn.gispython.org/svn/gispy/Shapely/branches/py3k spy3k $ PYTHONPATH=spy3k /usr/local/py3k/bin/python Python 3.0a1 (py3k, Aug 31 2007, 17:11:43) [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from shapely.geometry import Point >>> p = Point(0.0, 0.0) >>> p.wkt 'POINT (0.0000000000000000 0.0000000000000000)' >>> p.buffer(10.0) <shapely.geometry.polygon.Polygon object at 0xb7ccddec> >>> p.buffer(10.0).area 313.65484905463717
