neffo / earth-view-wallpaper-gnome-extension

A beautiful satellite image from Google Earth as your GNOME desktop wallpaper.
https://extensions.gnome.org/extension/1295/google-earth-wallpaper/
GNU General Public License v3.0
67 stars 8 forks source link

The metadata associated with some images is not processed correctly #20

Closed neffo closed 4 years ago

neffo commented 4 years ago

As below, the image metadata is not being populated into the extension location description (except for latitude and longitude). For some images it is correctly loaded however, seems to be associated with the newer images in the dataset.

Possible that the attributes within the json vary depending on the region and this isn't being handled appropriately (some are ignored, some are assumed to always be there). V3 of the Google API appears to have changed the metadata format versus V2, at least for some files.

image

Extension code associated is below:

location = imagejson['region']+', '+imagejson['country']+' ('+imagejson['edition']+')'

JSON snip is below.

https://www.gstatic.com/prettyearth/assets/data/v3/5046.json

{
"id":"5046","lat":45.764096,"lng":-85.045447,"zoom":14,
"geocode":{
  "street_number":"2998",
  "route":"Waugoshance Point Road",
  "locality":"Carp Lake",
  "administrative_area_level_3":"Bliss",
  "administrative_area_level_2":"Emmet County",
  "administrative_area_level_1":"Michigan",
  "country":"United States",
  "postal_code":"49718"},
"attribution":"©2019 Cnes/Spot Image, Maxar Technologies, USDA Farm Service Agency","bounds":[45.749125,-85.079779,45.779063,-85.011115],
...
}
neffo commented 4 years ago

fixed with 31e6fcd