NAME

Geo::Code::XYZ - Encode latitude,longitude,elevation into three names and vice versa.

VERSION

Version 1.1

SYNOPSIS

 	use Geo::Code::XYZ;
	my $g = Geo::Code::XYZ->new();
	my $elevation = 0; #default
	my $geocode = $g->geocode(lat=>45.900,lon=>-64.363, el=>$elevation, geoname => 1); #compute the geocode
        my $xy = $g->geocode(gc=>$geocode); #convert the geocode back to latitude,longitude,elevation
        my ($lat,$lon,$el) = @$xy;
        print "The latitude,longitude,elevation of $geocode is ($lat,$lon,$el)\n";
 
        # geoname can take one of four values => {0,1,2,3}. 0 -> Alphanumeric, 1 -> three geonames, 2 -> hybrid string (one geoname and a string), 3 -> numeric code.
                     

DESCRIPTION

Geo::Code::XYZ is the 3d version of the perl5 module Geo::Code. It produces location codes for latitude,longitude,elevation triplets with a resolution of 1 meter for an elevation of up/down to +- 17576 metres (in the three geoname version, geoname => 1, all other options default to elevation = 0).

A set of 146300 geonames has been selected from geonames.org with certain requirements such as: every geoname has phonetic/levenstein distance of at least 2 from every other geoname, the maximum length of e geoname is 12 (to accomodate some long geonames such as VALENCIENNES - however most geonames are no longer than 8 characters), major geonames are prioritized over less known ones to make the set more memorable.

The first geoname is the name of the most prominent location name in the vicinity of the point (for eg, LONDON-ZERO-MAX will be a location near London, UK.) The other two are random geonames or english words of length les than or equal to 9. If the first name is not a geoname, for eg, MAX-ZERO-LONDON, then the location is somewhere in the ocean or the poles, too far from any known geoname. (at least 200 kilometres away from the nearest geoname)

Geocodes that are close to each other will have similar names, for eg: LONDON-LOCKAGE-PUPIL and LONDON-LOCKAGE-PUPPY are about 1 meter away, while LONDON-LOCKBOX-PUPIL and LONDON-LOCKAGE-PUPPY are about 383 meters way.

This module is explained in more detailed on GitHub. View on GitHub.

Online Demo. 3Geonames.org.

Also supported on Geocode.xyz.

METHODS

new

my $g = Geo::Code::XYZ->new();

geocode

my $code = $g->geocode(lat=>45.900,lon=>-64.363, geoname=>1); #if geoname is omited, the default is Alphanumeric Geo::Code. If elevation is omited, it default to 0 (ground level 0). # $code is a scalar containing the geocode

or

my $point = $g->geocode(gc=>'MONCTON-APOCRYPH-MARYSOLEK');

#$point is an array reference containing latitude,longitude,elevation

geocode

REQUIREMENTS

Math::BigInt # lib => 'GMP'; make it run faster

SEE ALSO

https://3geonames.org, https://geocode.xyz

AUTHOR

Ervin Ruci, <eruci at geocode.xyz>

BUGS

Please report any bugs or feature requests to bug-geocode at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geo::Code. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Geo::Code::XYZ

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2019 Ervin Ruci.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.

This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.

This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SEE ALSO Geo::Code Geo::OLC Geohash Geo::What3Words