GIS-Distance-Fast

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


 - Depend on latest GIS::Distance.

0.13 2019-03-17T04:58:20Z

 - Use GIS::Distance's new interface.
 - Lots of documentation edits.

0.12 2019-03-10T06:45:47Z

 - Add GIS::Distance::Fast::ALT formula.
 - Add fabs() to Haversine.
 - Added GIS::Distance::Fast::Null, for measuring distances at the center
   of a singularity.

0.11 2019-03-08T18:35:36Z

 - Performance improvements.
 - Added GIS::Distance::Fast::GreatCircle.
 - Added GIS::Distance::Fast::Polar.

Changes  view on Meta::CPAN

 - Release with Dist::Zilla.

0.06 2010-02-02

 - Require GIS::Distance 0.07 for Any::Moose support.
 - Use Any::Moose.

0.05 2010-01-31

 - Use fabs() instead of abs() in Vincenting calculations.
 - Use higher-precision PI that comes with math.h in all formulas.

0.04 2010-01-30

 - Docs were still stating that Inline::C was being used.
 - Updated to require latest GIS::Distance version.

0.03 2009-07-20

 - Replaced Inline::C with real XS.
 - Add tests for pod, pod coverage, and perl critic.

META.json  view on Meta::CPAN

{
   "abstract" : "C implementation of GIS::Distance formulas.",
   "author" : [
      "Aran Clary Deltac <bluefeet@gmail.com>"
   ],
   "dynamic_config" : 0,
   "generated_by" : "Minilla/v3.1.21",
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",

META.yml  view on Meta::CPAN

---
abstract: 'C implementation of GIS::Distance formulas.'
author:
  - 'Aran Clary Deltac <bluefeet@gmail.com>'
build_requires:
  GIS::Distance: '0.17'
  Test2::V0: '0.000094'
configure_requires:
  Module::Build::Tiny: '0.035'
dynamic_config: 0
generated_by: 'Minilla/v3.1.21, CPAN::Meta::Converter version 2.150010'
license: perl

README.md  view on Meta::CPAN

# NAME

GIS::Distance::Fast - C implementation of GIS::Distance formulas.

# DESCRIPTION

This distribution re-implements some, but not all, of the formulas
that come with [GIS::Distance](https://metacpan.org/pod/GIS%3A%3ADistance) in the C programming language.  C code
is generally much faster than the Perl equivalent.

See ["SPEED" in GIS::Distance](https://metacpan.org/pod/GIS%3A%3ADistance#SPEED) for some benchmarking and how to run your
own benchmarks.

This module need not be used directly.  [GIS::Distance](https://metacpan.org/pod/GIS%3A%3ADistance) will automatically
use the `GIS::Distance::Fast::*` formulas when installed.

# FORMULAS

- [GIS::Distance::Fast::Cosine](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AFast%3A%3ACosine)
- [GIS::Distance::Fast::GreatCircle](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AFast%3A%3AGreatCircle)
- [GIS::Distance::Fast::Haversine](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AFast%3A%3AHaversine)
- [GIS::Distance::Fast::Polar](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AFast%3A%3APolar)
- [GIS::Distance::Fast::Vincenty](https://metacpan.org/pod/GIS%3A%3ADistance%3A%3AFast%3A%3AVincenty)

# SUPPORT

lib/GIS/Distance/Fast.pm  view on Meta::CPAN

    bootstrap GIS::Distance::Fast $VERSION;
};

1;
__END__

=encoding utf8

=head1 NAME

GIS::Distance::Fast - C implementation of GIS::Distance formulas.

=head1 DESCRIPTION

This distribution re-implements some, but not all, of the formulas
that come with L<GIS::Distance> in the C programming language.  C code
is generally much faster than the Perl equivalent.

See L<GIS::Distance/SPEED> for some benchmarking and how to run your
own benchmarks.

This module need not be used directly.  L<GIS::Distance> will automatically
use the C<GIS::Distance::Fast::*> formulas when installed.

=head1 FORMULAS

=over

=item *

L<GIS::Distance::Fast::Cosine>

=item *

lib/GIS/Distance/Fast/ALT.pm  view on Meta::CPAN

__END__

=encoding utf8

=head1 NAME

GIS::Distance::Fast::ALT - C implementation of GIS::Distance::ALT.

=head1 DESCRIPTION

See L<GIS::Distance::ALT> for details about this formula.

The code for this formula was taken from L<Geo::Distance::XS> and
modified to fit.

Normally this module is not used directly.  Instead L<GIS::Distance>
is used which in turn interfaces with the various formula classes.

=head1 SUPPORT

See L<GIS::Distance::Fast/SUPPORT>.

=head1 AUTHORS

See L<GIS::Distance::Fast/AUTHORS>.

=head1 LICENSE

lib/GIS/Distance/Fast/Cosine.pm  view on Meta::CPAN

__END__

=encoding utf8

=head1 NAME

GIS::Distance::Fast::Cosine - C implementation of GIS::Distance::Cosine.

=head1 DESCRIPTION

See L<GIS::Distance::Cosine> for details about this formula.

Normally this module is not used directly.  Instead L<GIS::Distance>
is used which in turn interfaces with the various formula classes.

=head1 SUPPORT

See L<GIS::Distance::Fast/SUPPORT>.

=head1 AUTHORS

See L<GIS::Distance::Fast/AUTHORS>.

=head1 LICENSE

lib/GIS/Distance/Fast/GreatCircle.pm  view on Meta::CPAN

__END__

=encoding utf8

=head1 NAME

GIS::Distance::Fast::GreatCircle - C implementation of GIS::Distance::GreatCircle.

=head1 DESCRIPTION

See L<GIS::Distance::GreatCircle> for details about this formula.

Normally this module is not used directly.  Instead L<GIS::Distance>
is used which in turn interfaces with the various formula classes.

=head1 SUPPORT

See L<GIS::Distance::Fast/SUPPORT>.

=head1 AUTHORS

See L<GIS::Distance::Fast/AUTHORS>.

=head1 LICENSE

lib/GIS/Distance/Fast/Haversine.pm  view on Meta::CPAN

__END__

=encoding utf8

=head1 NAME

GIS::Distance::Fast::Haversine - C implementation of GIS::Distance::Haversine.

=head1 DESCRIPTION

See L<GIS::Distance::Haversine> for details about this formula.

Normally this module is not used directly.  Instead L<GIS::Distance>
is used which in turn interfaces with the various formula classes.

=head1 SUPPORT

See L<GIS::Distance::Fast/SUPPORT>.

=head1 AUTHORS

See L<GIS::Distance::Fast/AUTHORS>.

=head1 LICENSE

lib/GIS/Distance/Fast/Null.pm  view on Meta::CPAN

__END__

=encoding utf8

=head1 NAME

GIS::Distance::Fast::Null - C implementation of GIS::Distance::Null.

=head1 DESCRIPTION

See L<GIS::Distance::Null> for details about this formula.

Normally this module is not used directly.  Instead L<GIS::Distance>
is used which in turn interfaces with the various formula classes.

=head1 SUPPORT

See L<GIS::Distance::Fast/SUPPORT>.

=head1 AUTHORS

See L<GIS::Distance::Fast/AUTHORS>.

=head1 LICENSE

lib/GIS/Distance/Fast/Polar.pm  view on Meta::CPAN

__END__

=encoding utf8

=head1 NAME

GIS::Distance::Fast::Polar - C implementation of GIS::Distance::Polar.

=head1 DESCRIPTION

See L<GIS::Distance::Polar> for details about this formula.

Normally this module is not used directly.  Instead L<GIS::Distance>
is used which in turn interfaces with the various formula classes.

=head1 SUPPORT

See L<GIS::Distance::Fast/SUPPORT>.

=head1 AUTHORS

See L<GIS::Distance::Fast/AUTHORS>.

=head1 LICENSE

lib/GIS/Distance/Fast/Vincenty.pm  view on Meta::CPAN

__END__

=encoding utf8

=head1 NAME

GIS::Distance::Fast::Vincenty - C implementation of GIS::Distance::Vincenty.

=head1 DESCRIPTION

See L<GIS::Distance::Vincenty> for details about this formula.

The results from L<GIS::Distance::Vincenty> versus this module are slightly
different.  I'm still not sure why this is, as the C code is nearly identical to
the Perl code.

Normally this module is not used directly.  Instead L<GIS::Distance>
is used which in turn interfaces with the various formula classes.

=head1 SUPPORT

See L<GIS::Distance::Fast/SUPPORT>.

=head1 AUTHORS

See L<GIS::Distance::Fast/AUTHORS>.

=head1 LICENSE

t/accuracy.t  view on Meta::CPAN

#!/usr/bin/env perl
use 5.008001;
use strictures 2;
use Test2::V0;

use GIS::Distance;

my @coords = ( 34.202361, -118.601875,  37.752258, -122.441254 );
my @formulas = qw( ALT Cosine GreatCircle Haversine Polar Vincenty );
my $gis = GIS::Distance->new();

foreach my $formula (@formulas) {
    my $s_gis = GIS::Distance->new( "GIS::Distance::$formula" );
    my $s_length = $gis->distance( @coords )->km();

    my $f_gis = GIS::Distance->new( "GIS::Distance::Fast::$formula" );
    my $f_length = $gis->distance( @coords )->km();

    is_close( $s_length, $f_length, $formula );
}

done_testing;

sub is_close {
    my ($num1, $num2, $description) = @_;
    my $lossy = $num2 * 0.001;
    if (($num1 > $num2 + $lossy) or ($num1 < $num2 - $lossy)) {
        fail( "$description - $num1 != $num2" );
    }



( run in 0.305 second using v1.01-cache-2.11-cpan-26ccb49234f )