The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tree::R - Perl extension for the Rtree data structure and algorithms

SYNOPSIS

  use Tree::R;

  my $rtree = new Tree::R;

  for my $object (@objects) {
      my @bbox = $object->bbox(); # (minx,miny,maxx,maxy)
      $rtree->insert($object,@bbox);
  }

  my @point = (123, 456); # (x,y)
  my @results;
  $rtree->query_point(@point,\@results);
  for my $object (@results) {
      # point is in object's bounding box
  }

  my @rect = (123, 456, 789, 1234); # (minx,miny,maxx,maxy)
  @results = ();
  $rtree->query_completely_within_rect(@rect,\@results);
  for my $object (@results) {
      # object is within rectangle
  }

  @results = ();
  $rtree->query_partly_within_rect(@rect,\@results);
  for my $object (@results) {
      # object's bounding box and rectangle overlap
  }

DESCRIPTION

R-tree is a data structure for storing and indexing and efficiently looking up non-zero-size spatial objects.

EXPORT

None by default.

SEE ALSO

A. Guttman: R-trees: a dynamic index structure for spatial indexing. ACM SIGMOD'84, Proc. of Annual Meeting (1984), 47--57.

N. Beckmann, H.-P. Kriegel, R. Schneider & B. Seeger: The R*-tree: an efficient and robust access method for points and rectangles. Proc. of the 1990 ACM SIGMOD Internat. Conf. on Management of Data (1990), 322--331.

This module should be discussed on the freegis-list: http://intevation.de/mailman/listinfo/freegis-list

http://www.tkk.fi/u/jolma/index.html

AUTHOR

Ari Jolma, <ari.jolma at tkk.fi>

COPYRIGHT AND LICENSE

Copyright (C) 2005 by Ari Jolma

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.