We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When not doing a geospatial analysis get the city, state, country, prefecture, county, or other meta data fields filled in.
(https://www.geeksforgeeks.org/get-the-city-state-and-country-names-from-latitude-and-longitude-using-python/)
pip install geopy
from geopy.geocoders import Nominatim
geolocator = Nominatim(user_agent="geoapiExercises")
Latitude = "25.594095" Longitude = "85.137566"
location = geolocator.reverse(Latitude+","+Longitude)
print(location)
address = location.raw['address'] print(address)
city = address.get('city', '') state = address.get('state', '') country = address.get('country', '') code = address.get('country_code') zipcode = address.get('postcode') print('City : ',city) print('State : ',state) print('Country : ',country) print('Zip Code : ', zipcode)
The text was updated successfully, but these errors were encountered:
This should be implemented as a separate function so that it can be more flexibly used outside of the PSM meteorological data call.
Sorry, something went wrong.
No branches or pull requests
When not doing a geospatial analysis get the city, state, country, prefecture, county, or other meta data fields filled in.
(https://www.geeksforgeeks.org/get-the-city-state-and-country-names-from-latitude-and-longitude-using-python/)
pip install geopy
import module
from geopy.geocoders import Nominatim
initialize Nominatim API
geolocator = Nominatim(user_agent="geoapiExercises")
Latitude & Longitude input
Latitude = "25.594095"
Longitude = "85.137566"
location = geolocator.reverse(Latitude+","+Longitude)
Display
print(location)
address = location.raw['address']
print(address)
city = address.get('city', '')
state = address.get('state', '')
country = address.get('country', '')
code = address.get('country_code')
zipcode = address.get('postcode')
print('City : ',city)
print('State : ',state)
print('Country : ',country)
print('Zip Code : ', zipcode)
The text was updated successfully, but these errors were encountered: