Marc Pfister wrote:
> Sean Gillies  wrote:
>> Shapely requires libgeos 2.2.3 or 3.0+. Previous versions have
>> incomplete C APIs and bugs that warrant an upgrade. The upcoming 3.0.3
>> release looks promising, though I don't know when it will start
>> appearing in distros.
> 
> Sean,
> 
> Thanks for getting back to me. Does libgeos 2.2.3 refer to libgeos_c.so
> or libgeos.so? Or both? My laptop has libgeos.so.2.2.3 and
> libgeos_c.so.1.3.3. This is what was installed by running "apt-get
> install libgeos-c1".
> 
> Thanks,
> 
> Marc

Can you try the attached ctypes_declarations.py file for me?

Sean

# Generated by shapely_geos_codegen.py from parts/libgeos/include/geos_c.h

import ctypes

lgeos = lgeos   # reduce pyflakes complaints

lgeos.initGEOS.restype = None

lgeos.finishGEOS.restype = None

lgeos.GEOSversion.restype = ctypes.c_char_p

lgeos.GEOSGeomFromWKT.restype = ctypes.c_void_p
lgeos.GEOSGeomFromWKT.argtypes = [ctypes.c_char_p]

lgeos.GEOSGeomToWKT.restype = ctypes.c_char_p
lgeos.GEOSGeomToWKT.argtypes = [ctypes.c_void_p]

lgeos.GEOS_getWKBOutputDims.restype = ctypes.c_int

lgeos.GEOS_setWKBOutputDims.restype = ctypes.c_int
lgeos.GEOS_setWKBOutputDims.argtypes = [ctypes.c_int]

#lgeos.GEOS_getWKBByteOrder.restype = ctypes.c_int
#lgeos.GEOS_setWKBByteOrder.restype = ctypes.c_int
#lgeos.GEOS_setWKBByteOrder.argtypes = [ctypes.c_int]

lgeos.GEOSGeomFromWKB_buf.restype = ctypes.c_void_p
lgeos.GEOSGeomFromWKB_buf.argtypes = [ctypes.c_void_p, ctypes.c_size_t]

#lgeos.GEOSGeomFromHEX_buf.restype = ctypes.c_void_p
#lgeos.GEOSGeomFromHEX_buf.argtypes = [ctypes.c_void_p, ctypes.c_size_t]

lgeos.GEOSCoordSeq_create.restype = ctypes.c_void_p
lgeos.GEOSCoordSeq_create.argtypes = [ctypes.c_uint, ctypes.c_uint]

lgeos.GEOSCoordSeq_clone.restype = ctypes.c_void_p
lgeos.GEOSCoordSeq_clone.argtypes = [ctypes.c_void_p]

lgeos.GEOSCoordSeq_destroy.restype = None
lgeos.GEOSCoordSeq_destroy.argtypes = [ctypes.c_void_p]

lgeos.GEOSCoordSeq_setX.restype = ctypes.c_int
lgeos.GEOSCoordSeq_setX.argtypes = [ctypes.c_void_p, ctypes.c_uint, ctypes.c_double]

lgeos.GEOSCoordSeq_setY.restype = ctypes.c_int
lgeos.GEOSCoordSeq_setY.argtypes = [ctypes.c_void_p, ctypes.c_uint, ctypes.c_double]

lgeos.GEOSCoordSeq_setZ.restype = ctypes.c_int
lgeos.GEOSCoordSeq_setZ.argtypes = [ctypes.c_void_p, ctypes.c_uint, ctypes.c_double]

lgeos.GEOSCoordSeq_setOrdinate.restype = ctypes.c_int
lgeos.GEOSCoordSeq_setOrdinate.argtypes = [ctypes.c_void_p, ctypes.c_uint, ctypes.c_uint, ctypes.c_double]

lgeos.GEOSCoordSeq_getX.restype = ctypes.c_int
lgeos.GEOSCoordSeq_getX.argtypes = [ctypes.c_void_p, ctypes.c_uint, ctypes.c_void_p]

lgeos.GEOSCoordSeq_getY.restype = ctypes.c_int
lgeos.GEOSCoordSeq_getY.argtypes = [ctypes.c_void_p, ctypes.c_uint, ctypes.c_void_p]

lgeos.GEOSCoordSeq_getZ.restype = ctypes.c_int
lgeos.GEOSCoordSeq_getZ.argtypes = [ctypes.c_void_p, ctypes.c_uint, ctypes.c_void_p]

lgeos.GEOSCoordSeq_getOrdinate.restype = ctypes.c_int
lgeos.GEOSCoordSeq_getOrdinate.argtypes = [ctypes.c_void_p, ctypes.c_uint, ctypes.c_uint, ctypes.c_void_p]

lgeos.GEOSCoordSeq_getSize.restype = ctypes.c_int
lgeos.GEOSCoordSeq_getSize.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSCoordSeq_getDimensions.restype = ctypes.c_int
lgeos.GEOSCoordSeq_getDimensions.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSGeom_createPoint.restype = ctypes.c_void_p
lgeos.GEOSGeom_createPoint.argtypes = [ctypes.c_void_p]

lgeos.GEOSGeom_createLinearRing.restype = ctypes.c_void_p
lgeos.GEOSGeom_createLinearRing.argtypes = [ctypes.c_void_p]

lgeos.GEOSGeom_createLineString.restype = ctypes.c_void_p
lgeos.GEOSGeom_createLineString.argtypes = [ctypes.c_void_p]

lgeos.GEOSGeom_createPolygon.restype = ctypes.c_void_p
lgeos.GEOSGeom_createPolygon.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_uint]

lgeos.GEOSGeom_createCollection.restype = ctypes.c_void_p
lgeos.GEOSGeom_createCollection.argtypes = [ctypes.c_int, ctypes.c_void_p, ctypes.c_uint]

lgeos.GEOSGeom_clone.restype = ctypes.c_void_p
lgeos.GEOSGeom_clone.argtypes = [ctypes.c_void_p]

lgeos.GEOSGeom_destroy.restype = None
lgeos.GEOSGeom_destroy.argtypes = [ctypes.c_void_p]

lgeos.GEOSEnvelope.restype = ctypes.c_void_p
lgeos.GEOSEnvelope.argtypes = [ctypes.c_void_p]

lgeos.GEOSIntersection.restype = ctypes.c_void_p
lgeos.GEOSIntersection.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSBuffer.restype = ctypes.c_void_p
lgeos.GEOSBuffer.argtypes = [ctypes.c_void_p, ctypes.c_double, ctypes.c_int]

lgeos.GEOSConvexHull.restype = ctypes.c_void_p
lgeos.GEOSConvexHull.argtypes = [ctypes.c_void_p]

lgeos.GEOSDifference.restype = ctypes.c_void_p
lgeos.GEOSDifference.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSSymDifference.restype = ctypes.c_void_p
lgeos.GEOSSymDifference.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSBoundary.restype = ctypes.c_void_p
lgeos.GEOSBoundary.argtypes = [ctypes.c_void_p]

lgeos.GEOSUnion.restype = ctypes.c_void_p
lgeos.GEOSUnion.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSPointOnSurface.restype = ctypes.c_void_p
lgeos.GEOSPointOnSurface.argtypes = [ctypes.c_void_p]

lgeos.GEOSGetCentroid.restype = ctypes.c_void_p
lgeos.GEOSGetCentroid.argtypes = [ctypes.c_void_p]

lgeos.GEOSRelate.restype = ctypes.c_char_p
lgeos.GEOSRelate.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSPolygonize.restype = ctypes.c_void_p
lgeos.GEOSPolygonize.argtypes = [ctypes.c_void_p, ctypes.c_uint]

lgeos.GEOSLineMerge.restype = ctypes.c_void_p
lgeos.GEOSLineMerge.argtypes = [ctypes.c_void_p]

#lgeos.GEOSSimplify.restype = ctypes.c_void_p
#lgeos.GEOSSimplify.argtypes = [ctypes.c_void_p, ctypes.c_double]

#lgeos.GEOSTopologyPreserveSimplify.restype = ctypes.c_void_p
#lgeos.GEOSTopologyPreserveSimplify.argtypes = [ctypes.c_void_p, ctypes.c_double]

lgeos.GEOSRelatePattern.restype = ctypes.c_char
lgeos.GEOSRelatePattern.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_char_p]

lgeos.GEOSDisjoint.restype = ctypes.c_int
lgeos.GEOSDisjoint.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSTouches.restype = ctypes.c_int
lgeos.GEOSTouches.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSIntersects.restype = ctypes.c_int
lgeos.GEOSIntersects.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSCrosses.restype = ctypes.c_int
lgeos.GEOSCrosses.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSWithin.restype = ctypes.c_int
lgeos.GEOSWithin.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSContains.restype = ctypes.c_int
lgeos.GEOSContains.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSOverlaps.restype = ctypes.c_int
lgeos.GEOSOverlaps.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSEquals.restype = ctypes.c_int
lgeos.GEOSEquals.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

#lgeos.GEOSEqualsExact.restype = ctypes.c_int
#lgeos.GEOSEqualsExact.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_double]

lgeos.GEOSisEmpty.restype = ctypes.c_int
lgeos.GEOSisEmpty.argtypes = [ctypes.c_void_p]

lgeos.GEOSisValid.restype = ctypes.c_int
lgeos.GEOSisValid.argtypes = [ctypes.c_void_p]

lgeos.GEOSisSimple.restype = ctypes.c_int
lgeos.GEOSisSimple.argtypes = [ctypes.c_void_p]

lgeos.GEOSisRing.restype = ctypes.c_int
lgeos.GEOSisRing.argtypes = [ctypes.c_void_p]

lgeos.GEOSHasZ.restype = ctypes.c_int
lgeos.GEOSHasZ.argtypes = [ctypes.c_void_p]

lgeos.GEOSGeomType.restype = ctypes.c_char_p
lgeos.GEOSGeomType.argtypes = [ctypes.c_void_p]

lgeos.GEOSGeomTypeId.restype = ctypes.c_int
lgeos.GEOSGeomTypeId.argtypes = [ctypes.c_void_p]

lgeos.GEOSGetSRID.restype = ctypes.c_int
lgeos.GEOSGetSRID.argtypes = [ctypes.c_void_p]

lgeos.GEOSSetSRID.restype = None
lgeos.GEOSSetSRID.argtypes = [ctypes.c_void_p, ctypes.c_int]

lgeos.GEOSGetNumGeometries.restype = ctypes.c_int
lgeos.GEOSGetNumGeometries.argtypes = [ctypes.c_void_p]

lgeos.GEOSGetGeometryN.restype = ctypes.c_void_p
lgeos.GEOSGetGeometryN.argtypes = [ctypes.c_void_p, ctypes.c_int]

#lgeos.GEOSNormalize.restype = ctypes.c_int
#lgeos.GEOSNormalize.argtypes = [ctypes.c_void_p]

lgeos.GEOSGetNumInteriorRings.restype = ctypes.c_int
lgeos.GEOSGetNumInteriorRings.argtypes = [ctypes.c_void_p]

lgeos.GEOSGetInteriorRingN.restype = ctypes.c_void_p
lgeos.GEOSGetInteriorRingN.argtypes = [ctypes.c_void_p, ctypes.c_int]

lgeos.GEOSGetExteriorRing.restype = ctypes.c_void_p
lgeos.GEOSGetExteriorRing.argtypes = [ctypes.c_void_p]

lgeos.GEOSGetNumCoordinates.restype = ctypes.c_int
lgeos.GEOSGetNumCoordinates.argtypes = [ctypes.c_void_p]

lgeos.GEOSGeom_getCoordSeq.restype = ctypes.c_void_p
lgeos.GEOSGeom_getCoordSeq.argtypes = [ctypes.c_void_p]

lgeos.GEOSGeom_getDimensions.restype = ctypes.c_int
lgeos.GEOSGeom_getDimensions.argtypes = [ctypes.c_void_p]

lgeos.GEOSArea.restype = ctypes.c_double
lgeos.GEOSArea.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSLength.restype = ctypes.c_int
lgeos.GEOSLength.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

lgeos.GEOSDistance.restype = ctypes.c_int
lgeos.GEOSDistance.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p]

#lgeos.GEOSWKTReader_create.restype = ctypes.c_void_p
#
#lgeos.GEOSWKTReader_destroy.restype = None
#lgeos.GEOSWKTReader_destroy.argtypes = [ctypes.c_void_p]
#
#lgeos.GEOSWKTReader_read.restype = ctypes.c_void_p
#lgeos.GEOSWKTReader_read.argtypes = [ctypes.c_void_p, ctypes.c_char_p]
#
#lgeos.GEOSWKTWriter_create.restype = ctypes.c_void_p
#
#lgeos.GEOSWKTWriter_destroy.restype = None
#lgeos.GEOSWKTWriter_destroy.argtypes = [ctypes.c_void_p]
#
#lgeos.GEOSWKTWriter_write.restype = ctypes.c_char_p
#lgeos.GEOSWKTWriter_write.argtypes = [ctypes.c_void_p, ctypes.c_void_p]
#
#lgeos.GEOSWKBReader_create.restype = ctypes.c_void_p
#
#lgeos.GEOSWKBReader_destroy.restype = None
#lgeos.GEOSWKBReader_destroy.argtypes = [ctypes.c_void_p]
#
#lgeos.GEOSWKBReader_read.restype = ctypes.c_void_p
#lgeos.GEOSWKBReader_read.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t]
#
#lgeos.GEOSWKBReader_readHEX.restype = ctypes.c_void_p
#lgeos.GEOSWKBReader_readHEX.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t]
#
#lgeos.GEOSWKBWriter_create.restype = ctypes.c_void_p
#
#lgeos.GEOSWKBWriter_destroy.restype = None
#lgeos.GEOSWKBWriter_destroy.argtypes = [ctypes.c_void_p]
#
#lgeos.GEOSWKBWriter_getOutputDimension.restype = ctypes.c_int
#lgeos.GEOSWKBWriter_getOutputDimension.argtypes = [ctypes.c_void_p]
#
#lgeos.GEOSWKBWriter_setOutputDimension.restype = None
#lgeos.GEOSWKBWriter_setOutputDimension.argtypes = [ctypes.c_void_p, ctypes.c_int]
#
#lgeos.GEOSWKBWriter_getByteOrder.restype = ctypes.c_int
#lgeos.GEOSWKBWriter_getByteOrder.argtypes = [ctypes.c_void_p]
#
#lgeos.GEOSWKBWriter_setByteOrder.restype = None
#lgeos.GEOSWKBWriter_setByteOrder.argtypes = [ctypes.c_void_p, ctypes.c_int]
#
#lgeos.GEOSWKBWriter_getIncludeSRID.restype = ctypes.c_char
#lgeos.GEOSWKBWriter_getIncludeSRID.argtypes = [ctypes.c_void_p]
#
#lgeos.GEOSWKBWriter_setIncludeSRID.restype = None
#lgeos.GEOSWKBWriter_setIncludeSRID.argtypes = [ctypes.c_void_p, ctypes.c_char]
#
# End generated code

_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to