PRTree, a Priority R-Tree, a spatial index for java code

 
General
About
License
API

Download
Current version: 1.1
updated: sep 14 2008

Java/6+ only
Download:
prtree-1.1.tar.gz - source
prtree.jar - just binary

C#
prtree_cs.zip - source

Contacts
Robert Olofsson
robo@khelekore.org

  About

PRTree is an implementation of a priority R-Tree, a spatial index. The code is written in java and the jar file is very small, this package does not come with anything extra.

This implementation tries to be memory efficient, one of the things it does it that it does not force you to create an Box or MBR for each object you have in the tree. You provide a class that can provide the bounds of each object when it is needed. This means that you can control how caching of bounds is done.

Example usage:

PRTree<Rectangle2D> tree = new PRTree<Rectangle2D> (new Rectangle2DConverter (), 10); Rectangle2D rx = new Rectangle2D.Double (0, 0, 1, 1); tree.load (Collections.singletonList (rx)); for (Rectangle2D r : tree.find (0, 0, 1, 1)) { System.out.println ("found a rectangle: " + r); }

There is now also a C# port of the code.