| 1 | package Geo::H3::Base; | ||
| 2 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use Geo::H3::FFI; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 5 | |||
| 6 | our $VERSION = '0.04'; | ||
| 7 | our $PACKAGE = __PACKAGE__; | ||
| 8 | |||
| 9 | =head1 NAME | ||
| 10 | |||
| 11 | Geo::H3::Base - H3 Geospatial Hexagon Indexing System | ||
| 12 | |||
| 13 | =head1 SYNOPSIS | ||
| 14 | |||
| 15 | use base qw{Geo::H3::Base}; | ||
| 16 | my $gh3 = Geo::H3->new; | ||
| 17 | |||
| 18 | =head1 DESCRIPTION | ||
| 19 | |||
| 20 | Perl API to the H3 Geospatial Hexagon Indexing System C library using libffi and FFI::Platypus. | ||
| 21 | |||
| 22 | =head1 CONSTRUCTOR | ||
| 23 | |||
| 24 | =head2 new | ||
| 25 | |||
| 26 | my $obj = Package::New->new(key=>$value, ...); | ||
| 27 | |||
| 28 | =cut | ||
| 29 | |||
| 30 | sub new { | ||
| 31 | my $this = shift; | ||
| 32 | my $class = ref($this) ? ref($this) : $this; | ||
| 33 | my $self = {@_}; | ||
| 34 | bless $self, $class; | ||
| 35 | return $self; | ||
| 36 | } | ||
| 37 | |||
| 38 | =head1 OBJECT ACCESSORS | ||
| 39 | |||
| 40 | =head2 ffi | ||
| 41 | |||
| 42 | Returns a L<Geo::H3::FFI> object | ||
| 43 | |||
| 44 | =cut | ||
| 45 | |||
| 46 | sub ffi { | ||
| 47 | my $self = shift; | ||
| 48 | $self->{'ffi'} = Geo::H3::FFI->new unless $self->{'ffi'}; | ||
| 49 | return $self->{'ffi'}; | ||
| 50 | } | ||
| 51 | |||
| 52 | =head1 SEE ALSO | ||
| 53 | |||
| 54 | L<Geo::H3> | ||
| 55 | |||
| 56 | =head1 AUTHOR | ||
| 57 | |||
| 58 | Michael R. Davis | ||
| 59 | |||
| 60 | =head1 COPYRIGHT AND LICENSE | ||
| 61 | |||
| 62 | MIT License | ||
| 63 | |||
| 64 | Copyright (c) 2021 Michael R. Davis | ||
| 65 | |||
| 66 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 67 | of this software and associated documentation files (the "Software"), to deal | ||
| 68 | in the Software without restriction, including without limitation the rights | ||
| 69 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 70 | copies of the Software, and to permit persons to whom the Software is | ||
| 71 | furnished to do so, subject to the following conditions: | ||
| 72 | |||
| 73 | The above copyright notice and this permission notice shall be included in all | ||
| 74 | copies or substantial portions of the Software. | ||
| 75 | |||
| 76 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 77 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 78 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 79 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 80 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 81 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 82 | SOFTWARE. | ||
| 83 | |||
| 84 | =cut | ||
| 85 | |||
| 86 | 1; | ||