Shapely on Pythonista
Is it possible to get Shapely to work?
I installed and got around the types error - but no further.
Presume it’s because
It’s not pure python?
JonB last edited by
While shapely may be pure python (using ctypes), it depends on GEOS being installed, which is C++. So, unless GEOS was packaged with pythonista (it is not), you cannot use shapely.
Options for this sort of thing include coding in pythonista but running in the cloud -- for instance see the thread about sage cell / sage math. Depending on what you want to achieve, you could run the whole script in the cloud, or create a wrapper to shapely API that sends out shapely commands to a cloud server to do the work, but returns back objects containing results, so it is most likely local. That would involve reimplementing the basic API and wrapper objects so that pythonista autocompletes and otherwise looks identical, but sends out cloud requests. Since shapely is already based on ctypes, so is sort of sending out ctypes requests, it might not be too hard to replace the ctypes calls with cloud calls.... But I guess that is sort of relative.
Thanks for your detailed reply — sounds like it's a little complex for what I want to do.
Am using the library with some drawing code and was hoping I could use my iPad as a mobile coding station — but... guess not now.