develooper Front page | perl.beginners | Postings from August 2019

Geo::WebService::Elevation::USGS

Thread Next
From:
Mike
Date:
August 27, 2019 00:49
Subject:
Geo::WebService::Elevation::USGS
Message ID:
b849d477-bbda-a8fb-927b-2432fdaf51c3@mflan.com

If there is anybody on Strawberry Perl, would
you please go to CPAN and install Geo::WebService::Elevation::USGS

Then run this program:

#!/usr/bin/perl

use strict;
use warnings;
use Geo::WebService::Elevation::USGS;

my $latd = '38.72360';
my $longd = '-90.76983';

my $getelev = Geo::WebService::Elevation::USGS->new();

my $elev = $getelev->elevation($latd, $longd)->{Elevation};

print "All done.   Elevation = $elev ft.\n\n";

__END__


I expect you will get this error:
500 Can't connect to ned.usgs.gov:443 (Bad address) at XXXX.pl line 12.


If instead you get the elevation, please let me know.


Then go to USGS.pm, take it off Read Only, and change line 133 from
use constant USGS_URL => 'https://ned.usgs.gov/epqs/pqs.php';
to
use constant USGS_URL => 'https://nationalmap.gov/epqs/pqs.php';

Then run the program and I expect you will get this error:
500 Can't connect to nationalmap.gov:443 (Bad address) at XXXX.pl line 12.

If you get either to run correctly, see if you have
Geo::WebService in your environment variables.


Thank you.


Mike

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About