Discussion:
[Community] Shapely and OSGeo4W?
Sean Gillies
2012-10-30 18:09:56 UTC
Permalink
I'd love to help this Stack Overflow user

http://stackoverflow.com/questions/13144158/python-geos-and-shapely-on-windows-64

but have no Windows machine and no experience with OSGeo4W. Should
Shapely fall back to trying to load a geos_c.dll after this line

https://github.com/sgillies/shapely/blob/master/shapely/geos.py#L71

in case C:\OSGeo4W\bin is in their path?
--
Sean Gillies
Oliver Tonnhofer
2012-10-30 18:40:25 UTC
Permalink
Post by Sean Gillies
I'd love to help this Stack Overflow user
http://stackoverflow.com/questions/13144158/python-geos-and-shapely-on-windows-64
but have no Windows machine and no experience with OSGeo4W. Should
Shapely fall back to trying to load a geos_c.dll after this line
https://github.com/sgillies/shapely/blob/master/shapely/geos.py#L71
in case C:\OSGeo4W\bin is in their path?
Maybe we should extend PATH by OSGEO4W_HOME\bin if OSGEO4W_HOME is set?

Regards,
Oliver
Sean Gillies
2012-10-30 18:43:42 UTC
Permalink
Yes, but then we'd still have to CDLL the right DLL? I'm not sure what
that is and won't be able to test it.
Post by Oliver Tonnhofer
Post by Sean Gillies
I'd love to help this Stack Overflow user
http://stackoverflow.com/questions/13144158/python-geos-and-shapely-on-windows-64
but have no Windows machine and no experience with OSGeo4W. Should
Shapely fall back to trying to load a geos_c.dll after this line
https://github.com/sgillies/shapely/blob/master/shapely/geos.py#L71
in case C:\OSGeo4W\bin is in their path?
Maybe we should extend PATH by OSGEO4W_HOME\bin if OSGEO4W_HOME is set?
Regards,
Oliver
_______________________________________________
Community mailing list
Community at lists.gispython.org
http://lists.gispython.org/mailman/listinfo/community
--
Sean Gillies
Oliver Tonnhofer
2012-10-30 19:50:55 UTC
Permalink
Post by Sean Gillies
Yes, but then we'd still have to CDLL the right DLL? I'm not sure what
that is and won't be able to test it.
ctypes uses the PATH environment on Windows when loading libraries (similar to LD_LIBRARY_PATH on Unix). So it should work, but I can verify that tomorrow.
Oliver Tonnhofer
2012-10-31 09:45:31 UTC
Permalink
Post by Oliver Tonnhofer
Post by Sean Gillies
Yes, but then we'd still have to CDLL the right DLL? I'm not sure what
that is and won't be able to test it.
ctypes uses the PATH environment on Windows when loading libraries (similar to LD_LIBRARY_PATH on Unix). So it should work, but I can verify that tomorrow.
Post by Sean Gillies
from ctypes import CDLL, c_char_p
CDLL('geos.dll')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
Post by Oliver Tonnhofer
Post by Sean Gillies
import os
os.environ['PATH'] += ';z:\\path\\to\\geos'
CDLL('geos.dll')
<CDLL 'geos.dll', handle 6bf80000 at 1765250>
Post by Oliver Tonnhofer
Post by Sean Gillies
geos = CDLL('geos.dll')
geos.GEOSversion.restype = c_char_p
geos.GEOSversion()
'3.3.5-CAPI-1.7.5'

Loading...