NAME
Geo::H3::Geo - H3 Geospatial Hexagon Indexing System Geo Object
SYNOPSIS
use Geo::H3::Geo;
my $geo = Geo::H3::Geo->new(lat=>$lat, lon=>$lon); #isa Geo::H3::Geo
my $h3 = $geo->h3($resolution); #isa Geo::H3::Index
my $center = $h3->geo; #isa Geo::H3::Geo
my $lat = $center->lat; #isa double WGS-84 Decimal Degrees
my $lon = $center->lon; #isa double WGS-84 Decimal Degrees
DESCRIPTION
H3 Geospatial Hexagon Indexing System Geo Object exposes the lat and lon properties as WGS-84 Decimal Degrees and converts coordinates to radians in the struct method for passing into theGeo::H3::FFI API as a Geo::H3::FFI::Struct::GeoCoord object.
The methods h3 and distance are wrappers around select Geo::H3::FFI methods.
CONSTRUCTORS
new
my $geo = Geo::H3::Geo->new(lat => $lat, lon => $lon);
PROPERTIES
lat
Returns the latitude in decimal degrees WGS-84
lon
Returns the longitude in decimal degrees WGS-84
METHODS
struct
Returns the Geo object as an FFI::C struct in the Geo::H3::FFI::Struct::GeoCoord namespace for use in the Geo::H3::FFI API.
h3
Indexes the location at the specified resolution, returning the hex object Geo::H3::Index of the cell containing the location.
my $h3 = $geo->h3; #default resolution is 0
my $h3 = $geo->h3(7); #isa Geo::H3::H3Index
Returns undef on error.
distance
Returns in meters the "great circle" or "haversine" distance between pairs of points (lat/lon pairs).
my $distance = $geoA->distance($geoB); #isa Double
SEE ALSO
Geo::H3, Geo::H3::FFI, Geo::H3::Index, Geo::H3::FFI::Struct::GeoCoord
AUTHOR
Michael R. Davis
COPYRIGHT AND LICENSE
MIT License
Copyright (c) 2021 Michael R. Davis