Algorithm-SpatialIndex-Storage-Redis
view release on metacpan or search on metacpan
examples/bench.pl view on Meta::CPAN
use strict;
use warnings;
use lib 'lib';
use Algorithm::SpatialIndex;
use Algorithm::SpatialIndex::Storage::Redis;
use lib 't/lib';
use Algorithm::SpatialIndex::Test;
use Algorithm::QuadTree;
use Benchmark qw(cmpthese timethese);
my $redis_cfg = test_redis_config();
die if not $redis_cfg;
# ordered or random or concentrated_random
#my $item_mode = 'ordered';
t/20storage-redis.t view on Meta::CPAN
use strict;
use warnings;
use Test::More;
use Algorithm::SpatialIndex;
my $tlibpath;
BEGIN {
$tlibpath = -d "t" ? "t/lib" : "lib";
}
use lib $tlibpath;
use Algorithm::SpatialIndex::Test;
my $config = test_redis_config();
if (!$config) {
plan skip_all => 'No test config for Redis found';
exit(0);
}
else {
plan tests => 9;
}
t/30strategy-quadtree.t view on Meta::CPAN
use strict;
use warnings;
use Test::More;
use Algorithm::SpatialIndex;
my $tlibpath;
BEGIN {
$tlibpath = -d "t" ? "t/lib" : "lib";
}
use lib $tlibpath;
use Algorithm::SpatialIndex::Test;
my $cfg = test_redis_config();
if (!$cfg) {
plan skip_all => "Need redis config for testing redis backend";
exit(0);
}
else {
plan tests => 70;
}
t/40strategy-octtree.t view on Meta::CPAN
use strict;
use warnings;
use Test::More;
use Algorithm::SpatialIndex;
my $tlibpath;
BEGIN {
$tlibpath = -d "t" ? "t/lib" : "lib";
}
use lib $tlibpath;
use Algorithm::SpatialIndex::Test;
my $cfg = test_redis_config();
if (!$cfg) {
plan skip_all => "Need redis config for testing redis backend";
exit(0);
}
else {
plan tests => 90;
}
t/60max_depth.t view on Meta::CPAN
use strict;
use warnings;
use Test::More tests => 2;
use Algorithm::SpatialIndex;
my $tlibpath;
BEGIN {
$tlibpath = -d "t" ? "t/lib" : "lib";
}
use lib $tlibpath;
my @limits = qw(0 0 1 1);
my $index = Algorithm::SpatialIndex->new(
strategy => 'QuadTree',
storage => 'Memory',
limit_x_low => $limits[0],
limit_y_low => $limits[1],
limit_x_up => $limits[2],
limit_y_up => $limits[3],
bucket_size => 2,
( run in 0.377 second using v1.01-cache-2.11-cpan-87723dcf8b7 )