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

Howard Butler hobu.inc at gmail.com
Tue May 4 10:41:35 EDT 2010


On May 4, 2010, at 9:26 AM, Roger Bivand wrote:
> Thanks for the suggestion.
> 
> I'm sorry, but I don't see any documentation whatsoever, after successfully building. So "quite easily" is maybe not my impression, I'm afraid, coming from C and interfacing with R.

If you've coded with GDAL or GEOS' APIs already, "quite easily" still applies, even though yes, there isn't any docs other than the header file at this point.  It is indeed quite easy compared to writing your own C++ classes to implement querying and insertion logic though ;)

> I need GEOS for Touches/Disjoint (topology operations) anyway, so extra dependencies are not a help, rather the opposite.

Indexing is orthogonal to GEOS main geometry algebra operations, IMO.  I don't like that we expose internal indexing stuff publicly because it will limit the library's options to do something different in the future.  That it uses an index to do things internally for things like prepared geometry is an implementation detail.  Small pieces, loosely joined, not giant monoliths (/me stares in GDAL's embedding-every-library-in-the-entire-osgis-ecosystem's direction).  I understand the desire to not have extra dependencies, but if you want a general, programmable rtree, GEOS' isn't it at this time.

To the GEOS devs, is GEOS to be an indexing library too?

> All I need is to identify which bounding boxes (envelopes in GEOM-speak) intersect for a fixed set of objects whose bounding boxes I can compute, and where GEOS is already present and running.

Doesn't GEOS' prepared geometry stuff already do this, or is that not sufficient?  Maybe I don't understand the problem well enough.

>> PS, if you are in the Python world, you can use the Shapely (GEOS wrapper) and Rtree (libspatialindex wrapper) combination to do all kinds of magic quite painlessly.
> 
> No, the R world, additional dependencies are not welcome, believe me. Maybe they provide use examples (all I asked for) ... links?

http://www.google.com/search?q=shapely (1st link, not the pretty pictures :)
http://www.google.com/search?q=rtree (3rd link)




More information about the geos-devel mailing list