Subject: | documentation does not match implementation |
The synopsis showing the usage of GIS::Distance has a couple of issues.
1. Using GIS::Distance without importing a calculation module (i.e. use
GIS::Distance::Halversine) does not work. GIS::Distance::Halversine
must be present for GIS::Distance->new() to execute.
2. The documentation for $gis->distance shows latitude, longitude. The
module actually expects longitude, latitude.
Here is how I think the synopsis should look:
use GIS::Distance;
use GIS::Distance::Haversine;
my $gis = GIS::Distance->new();
$gis->formula( 'Polar' ); # Optional, default is Haversine.
my $distance = $gis->distance( $lon1,$lat1 => $lon2,$lat2 );
print $distance->meters();