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

Request for elevation along a path isn't working #1

Closed hcarter333 closed 2 months ago

hcarter333 commented 2 months ago

Using the URL instructions at (or trying to) I get

{"results":[],"status":"INVALID_REQUEST"}

Using the documentation example:

https://maps.googleapis.com/maps/api/elevation/json?path=36.578581%2C-118.291994%7C36.23998%2C-116.83171&samples=3&key=YOUR_API_KEY

gives

{
   "results" : 
   [
      {
         "elevation" : 4411.94189453125,
         "location" : 
         {
            "lat" : 36.578581,
            "lng" : -118.291994
         },
         "resolution" : 19.08790397644043
      },
      {
         "elevation" : 1372.8359375,
         "location" : 
         {
            "lat" : 36.41150289067028,
            "lng" : -117.5602607523847
         },
         "resolution" : 9.543951988220215
      },
      {
         "elevation" : -84.51690673828125,
         "location" : 
         {
            "lat" : 36.23998,
            "lng" : -116.83171
         },
         "resolution" : 9.543951988220215
      }
   ],
   "status" : "OK"
}

What happens if I ask for 200 points along the path? I get a lot of point!

So, that's good. Putting in the coordinate for my 200 meter path gives (Putting them in one at a time...) First point is good with second example point. Second point also worked, so it will be time to crack out jq in a minute, but still... What was the issue? Comparing the addresses: My original https://maps.googleapis.com/maps/api/elevation/json?path=37.72489522009444%2C-122.42293617440532%7C37.72472947037526%2C-122.42072468451954&samples=200 https://maps.googleapis.com/maps/api/elevation/json?path=37.72489522009444%2C-122.42293617440532%7C37.72472947037526%2C-122.42072468451954&samples=200 The one that worked is above

hcarter333 commented 2 months ago

And now, my original works, so I guess it's a typo mystery lost to the ages.

Welp, may as well brush up on jq.

hcarter333 commented 2 months ago

Ah, and this is done I guess.