NAME
Geo::H3::Index - H3 Geospatial Hexagon Indexing System Index Object
SYNOPSIS
use Geo::H3::Index;
my $h3 = Geo::H3::Index->new(index=$index); #isa Geo::H3::Index
my $center = $h3->geo; #isa Geo::H3::GeoCoord
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 Index Object provides the primary interface for working with H3 Indexes.
CONSTRUCTORS
new
my $geo = Geo::H3::Index->new(index=>$index);
PROPERTIES
index
Returns the H3 index uint64 representation
string
Returns the H3 string representation.
resolution
Returns the resolution of the index.
baseCell
Returns the base cell number of the index.
isValid
Returns non-zero if this is a valid H3 index.
isResClassIII
Returns non-zero if this index has a resolution with Class III orientation.
isPentagon
Returns non-zero if this index represents a pentagonal cell.
maxFaceCount
Returns the maximum number of icosahedron faces the given H3 index may intersect.
area
Returns the area in square meters of this index.
areaApprox
Returns the average area in square meters of indexes at this resolution.
edgeLength
Returns the exact edge length in meters of this index.
edgeLengthApprox
Returns the average edge length in meters of indexes at this resolution.
METHODS
geo
Returns the centroid of the index as a Geo::H3::Geo object.
geoBoundary
Returns the boundary of the index as a Geo::H3::GeoBoundary object
parent
Returns a parent index of this index as a Geo::H3::Index object.
my $parent = $h3->parent; #next larger resolution
my $parent = $h3->parent(1); #isa Geo::H3::Index
children
Returns the children of the index as an array reference of Geo::H3::Index objects.
my $children = $h3->children(12); #isa ARRAY
my $children = $h3->children; #next smaller resolution
centerChild
Returns the center child (finer) index contained by this index at given resolution.
my $centerChild = $index->centerChild; #isa Geo::H3::Index
my $centerChild = $index->centerChild(12); #isa Geo::H3::Index
kRing
Returns k-rings indexes within k distance of the origin index.
my $list $index->kRing($k); #isa ARRAY of L<Geo::H3::Index> objects
kRingDistances
Returns a hash reference where the keys are the H3 index and values are the k distance for the given index and k value.
my $hash = $index->kRingDistances($k);
hexRange
my $indexes = $index->hexRange($k);
hexRangeDistances
Returns a hash reference where the keys are the H3 index and values are the k distance for the given index and k value.
my $hash = $index->hexRangeDistances($k);
hexRing
Returns the hex ring of this index as an array reference of Geo::H3::Index objects
my $hexes = $h3->hexRing; #default k = 1
my $hexes = $h3->hexRing(5); #isa ARRAY
areNeighbors
Returns whether or not the provided H3Indexes are neighbors.
my $areNeighbors = $start_index->areNeighbors($end_index);
line
Returns the indexes starting at this index to the given end index as array reference of Geo::H3::Index objects.
my $list_aref = $start_index->line($end_index);
distance
Returns the distance in grid cells between this index to the given end index.
my $distance = $start_index->distance($end_index);
SEE ALSO
AUTHOR
Michael R. Davis
COPYRIGHT AND LICENSE
MIT License
Copyright (c) 2021 Michael R. Davis
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.