Tree::R(3pm)
β¨ NAME β¨
Tree::R β a Perl extension for the R-tree data structure and algorithms π (it's from the User Contributed Perl Documentation collection, iykyk)
π¦ SYNOPSIS π¦
okay bestie, here's the whole vibe, code and all, verbatim:
use Tree::R;
my $rtree = Tree::R->new
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 π
An R-tree is a data structure for storing and indexing and efficiently looking up non-zero-size spatial objects. periodt. that's the whole concept and honestly? iconic. πΈ
π«Ά EXPORT π«Ά
None by default. nope, nada, zero, the module keeps its toys to itself unless you ask. π
β SEE ALSO β
the academic receipts, bestie β this is where the whole algorithm came from:
- 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.
The homepage of this module is on github: https://github.com/ajolma/Tree-R π
π AUTHOR π
Ari Jolma β the main character who wrote this whole thing, we love to see it π
π COPYRIGHT AND LICENSE π
Copyright (C) 2005- by Ari Jolma
This library is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. (yes it's actually free, go off β¨)
π REPOSITORY π
<https://github.com/ajolma/Tree-R>
and that's a wrap, bestie π¦ this page is from perl v5.36.0, dated 2022-10-13, and it lives under Tree::R(3pm) β go build something spatially indexed and gorgeous, no cap π
β¨
π¦ where this page comes from
- ubuntu noble: libtree-r-perl 0.072-3 Β· Artistic-1.0-Perl
- ubuntu resolute: libtree-r-perl 0.072-3 Β· Artistic-1.0-Perl
- ubuntu stonking: libtree-r-perl 0.072-3 Β· Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms