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

NAME

Algorithm::SpatialIndex::Bucket - A container for items

SYNOPSIS

  use Algorithm::SpatialIndex;
  my $idx = Algorithm::SpatialIndex->new(
    strategy => 'QuadTree', # or others
  );

DESCRIPTION

This document describes the minimum API that needs to be implemented for classes that can be used as buckets (more or less: leaf nodes) in the spatial index. See the main documentation in Algorithm::SpatialIndex for an explanation of how alternative bucket implementations can be used.

METHODS

new

Constructor

node_id

Read/write accessor for the id of the node that this bucket corresponds to.

items

Read/write accessor for the array ref (or undef if not initialized) of items in this bucket. An item is defined to be an unblessed array references containing the item id followed by the item coordinates. The type and number of coordinates may depend on the chosen index Strategy. Cf. the strategy's item_coord_types method.

nitems

Returns the number of items in the bucket.

add_items

Given a list of items (array refs with id and coordinates), adds these items to the bucket.

AUTHOR

Steffen Mueller, <smueller@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2010, 2011 by Steffen Mueller

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