Does anyone know of a pure Python (no C or Java dependencies) library for doing geometry operations such as buffer, union, intersects, etc? I'm looking for something that is Google AppEngine compatible.
6 Answers
I don't know about GAE compatibility, but you migh try SymPy for pure math & geometry functions. Otherwise, the only other one I know about is Shapely but it has a libgeos_c dependency which might disqualify it based on your requirements.
UPDATE: Also SymPy is BSD licensed, which might be an important benefit to some devs.
-
Great suggestion. I think this is pure Python and so should be GAE compatible (haven't tested yet). Thanks!– atogleCommented Apr 1, 2011 at 17:17
Planar has very limited support for topology operations (only convex hull and point-in-polygon) but it is pure Python and for some cases it could be useful.
I don't know whether the PY implementation of Geoscript relies on external modules or not! Have a look : http://geoscript.org/py/index.html
-
1It looks like it is for Jython so would require the Java runtime (JRE). Commented Mar 12, 2011 at 15:43
-
I think that all of the GeoScript libs are based off of JTS in some way.– atogleCommented Mar 12, 2011 at 17:55
Py2D is pure python with no external dependencies: https://github.com/sseemayer/Py2D
I believe it has most if not all of the functionality of Shapely/GEOS. But there's a catch. It's designed to be a gaming library so some functions break when you deal with negative coordinates. If you can work around that it's great.
Most of the action is contained in the modules found in the source code directory "Math". I plan to clone it and optimize it for geospatial use one day.
-
"I plan to clone it and optimize it for geospatial use one day." That would be awesome to see! Commented Feb 18, 2014 at 17:59
-
I've used OGR a good bit for scripting but I think that all of the OGR Python libraries are C wrappers. GAE only allows pure Python 3rd party libraries.– atogleCommented Mar 12, 2011 at 17:57