I want to get the latitude and longitude form the results of google geocoding API, but I don't know how to take out the latitude and longitude out using json. The results of google geocoding is like following:
[{
'address_components': [{
'long_name': 'Macau',
'short_name': 'MO',
'types': ['country', 'locality', 'political']
}],
'formatted_address': 'Macau',
'geometry': {
'bounds': {
'northeast': {
'lat': 22.2170639,
'lng': 113.6127001
},
'southwest': {
'lat': 22.1066001,
'lng': 113.5276053
}
},
'location': {
'lat': 22.198745,
'lng': 113.543873
},
'location_type': 'APPROXIMATE',
'viewport': {
'northeast': {
'lat': 22.2170639,
'lng': 113.6127001
},
'southwest': {
'lat': 22.1066001,
'lng': 113.5276053
}
}
},
'place_id': 'ChIJ88g14uB6ATQR9qyFtCzje8Y',
'types': ['country', 'locality', 'political']
}]
I only want to use:
'location': {
'lat': 22.198745,
'lng': 113.543873
},
and save them in two variables. How can I make it?