Tree::R3pm
Perl extension for the r-tree data structure and algorithms
Usage
use Tree::R;my $rtree = Tree::R->newfor 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}
Overview
R-tree is a data structure for storing and indexing and efficiently looking up non-zero-size spatial objects.
Export
None by default.
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.
Repository
<https://github.com/ajolma/Tree-R>
Releases
4 releases since Debian 10 (Buster); the text changed 2 times.