NAME

Geo::Hash::XS - Geo::Hash in XS

SYNOPSIS

my $gh = Geo::Hash::XS->new();
my $hash = $gh->encode( $lat, $lon );  # default precision = 32
my $hash = $gh->encode( $lat, $lon, $precision ); 
my ($lat, $lon) = $gh->decode( $hash );

DESCRIPTION

Geo::Hash::XS encodes and decodes geohash strings, fast.

Currently this module is alpha quality (especially the adjacent() and negihbors() methods, which I just kind of copied the logic from elsewhere). Please submit tests and patches!

METHODS

$gh = Geo::Hash::XS->new()

$hash = $gh->encode($lat, $lon[, $precision])

One notable difference between Geo::Hash::XS and Geo::Hash is that encode() does NOT dynamically adjust the precision when $precision is not given. If not given, $precision is always 32

($lat, $lon) = $gh->decode( $hash )

Decodes $hash to $lat and $lon

adjacent

Please consider this method to be in completely unstable state. Tests and patches welcome.

neighbors

Please consider this method to be in completely unstable state. Tests and patches welcome.

PERFORMANCE

benchmark/encode.pl
precision = 5...
          Rate  perl    xs
perl   13713/s    --  -99%
xs   1120208/s 8069%    --

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html

AUTHOR

Copyright (c) 2010 Daisuke Maki <daisuke@endeworks.jp>

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 55:

'=item' outside of any '=over'

Around line 62:

You forgot a '=back' before '=head1'