http://qs321.pair.com?node_id=11149859

Aldebaran has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I'm doing what people have to do in mormon country to save their sanity: study the rocks, which turns out to be, by far, the most interesting things in this region. So I came up with a script that was going to tell me something about the Bonneville flood, which I've been digging through the last 30 years of my life without having known it until last year. It is literally true that I brought the internet to Idaho in the form of walking in front of the caterpillar that ripped a channel for the fiberobtic cable from Preston to Spokane. (1989)

For the distance calc, I used geodatasource.com as a source. I supply a date and time that isn't relevant yet but stubbed in to be used eventually. Let me me just trot this thing out: 2.millcreek.pl. It's behaving pretty well, I think. I don't mean to thumb my nose at the metric system by using feet and miles, but it's definitely the parlance of the locals:

```fritz@laptop:~/Documents/gitlab1\$ ./2.millcreek.pl
Subroutine get_logger redefined at ./2.millcreek.pl line 68.
INFO: ./2.millcreek.pl
INFO: pi is 3.14159265358979
INFO: Bonneville max altitude in feet: 5200
INFO:  Boise 43.61  -116.2
INFO: return from the google is 821 meters
INFO: Altitude in feet is 2693.56964
INFO: Difference from max Bonneville elevation is 2506.43036 ft
INFO: ==============
INFO: distance is 240.161359349768 miles
INFO: ==============
INFO:  near sublett 42.3278114  -113.2104084
INFO: return from the google is 1455 meters
INFO: Altitude in feet is 4773.6222
INFO: Difference from max Bonneville elevation is 426.3778 ft
INFO: ==============
INFO: distance is 175.16979925839 miles
INFO: ==============
INFO:  snowville 41.9655701  -112.7105234
INFO: return from the google is 1384 meters
INFO: Altitude in feet is 4540.68256
INFO: Difference from max Bonneville elevation is 659.31744 ft
INFO: ==============
INFO: distance is 35.8058824322112 miles
INFO: ==============
INFO:  juniper 42.152429  -112.9842191
INFO: return from the google is 1577 meters
INFO: Altitude in feet is 5173.88468
INFO: Difference from max Bonneville elevation is 26.1153199999999 ft
INFO: ==============
INFO: distance is 19.0729839145012 miles
INFO: ==============
INFO:  on the outcrop 40.703684  -111.7849951
INFO: return from the google is 1752 meters
INFO: Altitude in feet is 5748.03168
INFO: Difference from max Bonneville elevation is -548.03168 ft
INFO: ==============
INFO: distance is 117.801976807568 miles
INFO: ==============
INFO: return from the google is 1524 meters
INFO: Altitude in feet is 5000.00016
INFO: Difference from max Bonneville elevation is 199.99984 ft
INFO: ==============
INFO: distance is 0.510598364633098 miles
INFO: ==============
INFO:  Mantua 41.5073303  -111.944728
INFO: return from the google is 1582 meters
INFO: Altitude in feet is 5190.28888
INFO: Difference from max Bonneville elevation is 9.71111999999994 ft
INFO: ==============
INFO: distance is 55.8975408837833 miles
INFO: ==============
INFO:  dry creek 41.5501001  -111.9537977
INFO: return from the google is 1810 meters
INFO: Altitude in feet is 5938.3204
INFO: Difference from max Bonneville elevation is -738.3204 ft
INFO: ==============
INFO: distance is 2.99196958759918 miles
INFO: ==============
INFO:  wellsville 41.6365147  -111.9288947
INFO: return from the google is 1376 meters
INFO: Altitude in feet is 4514.43584
INFO: Difference from max Bonneville elevation is 685.56416 ft
INFO: ==============
INFO: distance is 6.1074736112501 miles
INFO: ==============
fritz@laptop:~/Documents/gitlab1\$

So far, so good, and I welcome any style, usage, or numeric improvements. I might have 2 significant figures, but how much width can I fill up? Let's take a look at the dependencies:

```fritz@laptop:~/Documents/gitlab1\$ grep use 2.millcreek.pl
use v5.030;    # strictness implied
use warnings;
use feature qw[ signatures ];
use Data::Dumper;
use DateTime;
use DateTime::Format::ISO8601;
use DateTime::TimeZone;
use Log::Log4perl;
use Try::Tiny;
use LWP::UserAgent;
use HTTP::Request;
use Data::Roundtrip;

I have to use Log4perl to keep this type of data straight, and I use this hack of Log4perl so as to not have a .conf file dependency. Otherwise heavy with a lot of software from bliako. I wouldn't have been able to get these values right in geologic time without bliako's help at this level:

```
# this request was translated from Curl command-line
# by [Corion]'s https://corion.net/curl2lwp.psgi
my \$req = HTTP::Request->new(
'POST' =>
[
'Connection'      => 'keep-alive',
'Accept'          => '*/*',
'Accept-Encoding' => 'gzip, x-gzip, deflate, x-bzip2, bzip2',
'Accept-Language' => 'en-US,en;q=0.5',

#        'Host'            => 'www.mapcoordinates.net:443',
'Referer'    => 'https://www.mapcoordinates.net/en',
'User-Agent' =>
'Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firef
+ox/78.0',
'Content-Type'     => 'application/x-www-form-urlencoded; charse
+t=UTF-8',
'DNT'              => '1',
'Origin'           => 'https://www.mapcoordinates.net',
'X-Requested-With' => 'XMLHttpRequest'
],
);
die "call to HTTP::Request has failed" unless \$req;

What's the problem? 1. These values are ultimately dependent on Google, LLC. I'm happy that I can make use of them at this heartbeat, but I'm looking for other sources.

Q1) Does anyone know of another source for elevations on the interweb, given latitude and longitude? It seems like something more than one crappy company could pull off, in the age of satellites and lidar.

Q2) How do I make make such queries without associating it to my IP address?

## changing tack...

Rather than continuing in this line, let me try to get where I'm going by different methods. As I followed the path of the flood from Brigham City to Pocatello, I realized that I was on US highway 91 the entire time. If I instead had a dataset that represented that path, then I would also have a gradient for the flood. Let me try to represent what I have:

```https://www.google.com/maps/dir/Brigham+City,+UT/Logan,+UT/Preston,+ID
+/Pocatello,+ID/@42.1742739,-113.24861,8z/data=!3m1!4b1!4m26!4m25!1m5!
+1m1!1s0x87537b19bce31079:0xeeb9df2a3b92a006!2m2!1d-112.0155015!2d41.5
+102129!1m5!1m1!1s0x87547de05542a865:0xa9b33d0bcbbebcd5!2m2!1d-111.833
+8359!2d41.7369803!1m5!1m1!1s0x8754f78c7cda6c31:0xf1b3b4fc465a4a3f!2m2
+!1d-111.8766173!2d42.0963133!1m5!1m1!1s0x53554f20d5d09b0d:0x70c6a2484
+ce39b0!2m2!1d-112.4506191!2d42.8621042!3e0