hcarter333 / datasette-enrichments-gmap-elevation

Retrieves the elevations of coordinates along a path on Earth
Apache License 2.0
0 stars 0 forks source link

Make experimental chart of returned elevation values #2

Closed hcarter333 closed 5 months ago

hcarter333 commented 5 months ago

Done! (Look towards the bottom of the sheet for the chart.

Here's the jq filter for the results: .results[].elevation Google Earth: image

Sheets graph: image

Request URL minus key: https://maps.googleapis.com/maps/api/elevation/json?path=37.72489522009444%2C-122.42293617440532%7C37.72472947037526%2C-122.42072468451954&samples=200&key=

Automate this a bit more by providing csv with indexes corresponding to meters.

hcarter333 commented 5 months ago

To get csv, then from the comment on stack overflow, use

.results | keys[] as $k | [$k, .[$k].elevation] | @csv

which returns output like

0,123.6165237426758
1,123.4337463378906
2,123.2948989868164
3,123.1553573608398
4,123.0151062011719
5,122.9025802612305
6,122.820442199707
7,122.7372436523438
8,122.6529922485352
9,122.5870056152344
10,122.5324249267578
11,122.4771957397461
12,122.4213104248047
13,122.3989028930664