I am trying to speed the spatial distance calculation between polygons and points/polygons by calling the GEOS library directly. However I couldn't find any help how to call this function correctly. Can anyone please point me to the location where I can find the reference for this function or point out where I have done incorrectly?
working example:
from shapely.geos import lgeos
points_geom = np.array([x._geom for x in points])
polygons_geom = np.array([x._geom for x in polygons])
lgeos._lgeos.GEOSContains_r(lgeos.geos_handle,polygons_geom[0],points_geom[0])
Not working:
lgeos._lgeos.GEOSDistance_r(lgeos.geos_handle,polygons_geom[0],points_geom[0])
TypeError Traceback (most recent call last)
<ipython-input-138-392cb700cfbc> in <module>()
----> 1 lgeos._lgeos.GEOSDistance_r(lgeos.geos_handle,polygons_geom[0],points_geom[0])
TypeError: this function takes at least 4 arguments (3 given)