I am banging my head into my desk trying to figure out how to parse the results from Google Maps to a geocoding request. I need to ultimately grab the location latitude and longitude from this but I am not having much luck. Below is a sample of the info returned by Google. If anyone could provide some guidance, I would appreciate it.
{
"results" : [
{
"address_components" : [
{
"long_name" : "11320",
"short_name" : "11320",
"types" : [ "street_number" ]
},
{
"long_name" : "Pegasus Street",
"short_name" : "Pegasus St",
"types" : [ "route" ]
},
{
"long_name" : "Highland Meadows",
"short_name" : "Highland Meadows",
"types" : [ "neighborhood", "political" ]
},
{
"long_name" : "Dallas",
"short_name" : "Dallas",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Dallas County",
"short_name" : "Dallas County",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "Texas",
"short_name" : "TX",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
},
{
"long_name" : "75238",
"short_name" : "75238",
"types" : [ "postal_code" ]
}
],
"formatted_address" : "11320 Pegasus St, Dallas, TX 75238, USA",
"geometry" : {
"location" : {
"lat" : 32.8747287,
"lng" : -96.6859621
},
"location_type" : "RANGE_INTERPOLATED",
"viewport" : {
"northeast" : {
"lat" : 32.8760776802915,
"lng" : -96.6846131197085
},
"southwest" : {
"lat" : 32.8733797197085,
"lng" : -96.68731108029151
}
}
},
"place_id" : "EicxMTMyMCBQZWdhc3VzIFN0LCBEYWxsYXMsIFRYIDc1MjM4LCBVU0EiGxIZChQKEgmzlF5j6qBOhhET8EBdGhaHrxC4WA",
"types" : [ "street_address" ]
}
],
"status" : "OK"
}