Geo::Hash(3pm)
NAME π¦β¨
Geo::Hash(3pm) β okay bestie, this is a User Contributed Perl Documentation page. And the module? Geo::Hash β Encode / decode geohash.org locations. That's the whole brief. π
VERSION π
This document describes Geo::Hash version 0.02 β periodt. π«Ά
SYNOPSIS π
okay so like, here's the starter pack:
use Geo::Hash;
my $gh = Geo::Hash->new;
my $hash = $gh->encode( $lat, $lon );
my ( $lat, $lon ) = $gh->decode( $hash );
DESCRIPTION πΈ
Geohash is a latitude/longitude geocode system invented by Gustavo Niemeyer when writing the web service at geohash.org, and put into the public domain. Literally iconic. π
This module encodes and decodes geohash locations. That's its whole main character energy. β¨
See <http://en.wikipedia.org/wiki/Geohash> and <http://geohash.org> for more information. π
INTERFACE π
new πΌ
Create a new Geo::Hash object.
my $gh = Geo::Hash->new;
precision π
Infer a suitable precision (number of character in hash) for a given lat, lon pair.
my $prec = $gh->precision( $lat, $lon );
encode π§
Encode a lat, long pair into a geohash.
my $hash = $gh->encode( $lat, $lon );
You may optionally supply the length of the desired geohash:
# Very precise
my $hash = $gh->encode( $lat, $lon, 10 );
If the precision argument is omitted, precision will be used to provide a default. β¨
decode_to_interval π
Like decode but instead of returning a pair of coordinates returns the interval for each coordinate. This gives some indication of how precisely the original hash specified the location. π«Ά
The return value is a pair of array refs. Each referred to array contains the upper and lower bounds for each coordinate.
my ( $lat_range, $lon_range ) = $gh->decode_to_interval( $hash );
# $lat_range and $lon_range are references to two element arrays
decode πΊοΈ
Decode a geohash into a lat, long pair.
my ( $lat, $lon ) = $gh->decode( $hash );
CONFIGURATION AND ENVIRONMENT π
Geo::Hash requires no configuration files or environment variables. Zero config, zero stress. β¨
DEPENDENCIES π
None. Not a single one. π
INCOMPATIBILITIES π
None reported. We love a peaceful era. ποΈ
BUGS AND LIMITATIONS π
No bugs have been reported. (iykyk, bestie β may it stay that way. π)
Please report any bugs or feature requests to bug-geo-hash@rt.cpan.org, or through the web interface at <http://rt.cpan.org>.
AUTHOR π
Andy Armstrong "<andy@hexten.net>" β hello bestie, what a legend. π
<http://geohash.org/gcwrdtsvrfgr>
LICENCE AND COPYRIGHT π
Copyright (c) 2008, Andy Armstrong "<andy@hexten.net>". π
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. Slay, free software. β¨
okay bye bestie! π This whole thing came from perl v5.36.0, dated 2022-10-13, and the manual page is Geo::Hash(3pm). no cap, love that for us. π«Ά
π¦ where this page comes from
- ubuntu noble: libgeo-hash-perl 0.02-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgeo-hash-perl 0.02-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgeo-hash-perl 0.02-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms