Getting the are the ISS is flying over using reverse geocoder

I use the following code in order to get the city the iss is flying over. I used the code from the astro-pi tutorial():

import reverse_geocoder from orbit import ISS coordinates = ISS.coordinates() coordinate_pair = ( coordinates.latitude.degrees, coordinates.longitude.degrees) location = reverse_geocoder.search(coordinate_pair) print(location) 

This is what i get

[OrderedDict([ ('lat', '42.82701'), ('lon', '-75.54462'), ('name', 'Hamilton'), ('admin1', 'New York'), ('admin2', 'Madison County'), ('cc', 'US') ])] 

What kind of data is this ? and how can i for example print out only name and get Hamilton

2

1 Answer

Maurice Meyer helped me solve the issue

print(location[0]['name']) 
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like