This is moving kind of fast!
Regarding the goal of automating elevations using Datasette and the Google Maps Elevation API. I pulled a QSO out of a hat last night and tried the coordinates between stations in a call to the Google Maps Elevation API.
The URL to use the API looked like this:
https://maps.googleapis.com/maps/api/elevation/json?path=37.7248952%2C-122.4229361%7C37.7247294%2C-122.4207246&samples=200&key=
where the path parameter contains two coordinates separated by %7C (html encoding for the pipe symbol: '|') and commas (aka %2C) define the coordinates of the tx station and the coordinate of a point 200 meters along the path to the rx station, and the samples parameter tells the API how many points to split the path into and return elevations for. It's all documented by Google here.
I was quickly rewarded with data that looked like the following:
{ "results" : [ { "elevation" : 123.6165237426758, "location" : { "lat" : 37.72489522009444, "lng" : -122.4229361744053 }, "resolution" : 9.543951988220215 }, { "elevation" : 123.4337463378906, "location" : { "lat" : 37.72489438728456, "lng" : -122.4229250613661 }, "resolution" : 9.543951988220215 },...
I passed that into a jq filter, (yes it did take a little experimentation and stack overflow), to get data that looked like
0,123.6165237426758
1,123.4337463378906
2,123.2948989868164
3,123.1553573608398
...
For reference, the jq filter I used is
.results | keys[] as $k | [$k, .[$k].elevation] | @csv
I then used to Google Sheets to graph (look towards the bottom of the sheet) the elevation and compared that graph to the Google Earth Pro result for the same QSO.
Not to shabby for a first try:
Google Earth
The same data from the API plotted in Google Sheets
Also cute! ( I think )
Comments
Post a Comment
Please leave your comments on this topic: