[geos-devel] Indexing question from a newbie

Martin Davis mbdavis at VividSolutions.com
Fri Jul 7 14:05:09 EDT 2006

Here's the differences between Quadtree and STRtree:

Quadtree is dynamic (items can be added at any time, not just at
construction time, and items can be deleted)
STRtree is static (the tree can be populated with items only once, after
STRtree is faster than Quadtree (up to 2 times or more faster)

As usual, there is a tradeoff between flexibility and efficiency.

There are examples of the use of these classes throughout the GEOS/JTS
code.  In particular (in JTS at least) the unit tests in test.jts.index
should provide some simple examples.

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046

> -----Original Message-----
> From: geos-devel-bounces at geos.refractions.net 
> [mailto:geos-devel-bounces at geos.refractions.net] On Behalf Of 
> Sudipta Sarkar
> Sent: July 7, 2006 9:49 AM
> To: geos-devel at geos.refractions.net
> Subject: [geos-devel] Indexing question from a newbie
> Hi All,
> I am trying to use GEOS to create envelope geometries for a bunch of 
> different tiles and create a spatial index based on these geometries. 
> The purpose is to select features lying within a particular 
> tile based 
> on an initial query on the spatial index of these different 
> tiles. I am 
> a complete newbie to GEOS so was hoping if anyone can suggest as to 
> which index amidst Quadtree and SRTree will work best for my 
> purpose. It 
> will also be helpful if anyone can point me to any example script in 
> C/C++ that uses GEOS to build indexes and query them.
> Any help is appreciated.
> Thanks

More information about the geos-devel mailing list