[geos-devel] use of STRtree functions in C API

Roger Bivand Roger.Bivand at nhh.no
Tue May 4 09:30:24 EDT 2010


Hi,

I'm investigating the use of STRtree functions in C API to find candidate 
GEOS_MULTIPOLYGON or GEOS_POLYGON objects to test for contiguity, with 
GEOSDisjoint() or GEOSTouches(). I think that I can see how to build the 
tree with envelopes of the polygon objects, using an int ID number as the 
inserted item. However, I'm very unsure how:

extern void GEOS_DLL GEOSSTRtree_query_r(GEOSContextHandle_t handle,
                                          GEOSSTRtree *tree,
                                          const GEOSGeometry *g,
                                          GEOSQueryCallback callback,
                                          void *userdata);

should be understood. The first three arguments appear clear, but neither 
of the remaining two is. userdata out could be a structure with a 
pre-allocated int array long enough to hold any intersected object IDs, 
with an int saying how many are present. Does anyone have any use examples 
of GEOSSTRtree_query in the C API?

Grateful for any pointers,

Roger

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the geos-devel mailing list