ReverseGeocodeAsync only returns a FormattedAddress string
I am looking to extract only the city for a given lat/lng
As seen in this XML:
https://stackoverflow.com/a/3151512/169714
it would have an enumerable of address_component and a type locality which contains the city.
Would be a great addition imho.
I think that the GeoCoding.Core.Address class could use some more properties. GoogleAddress has components and BingAddress several other properties. What are your thoughts on this?
Fixed it by not using the address class but provider specific:
Geocoding.Google.GoogleAddress gAdres = (Geocoding.Google.GoogleAddress)geoGoogle.ReverseGeocodeAsync
and
Geocoding.Microsoft.BingAddress adres = (Geocoding.Microsoft.BingAddress)geoBing.ReverseGeocodeAsync
and for google
string city = gAdres.Components.FirstOrDefault(g => g.Types.Equals("locality")).LongName;
and for microsoft/bing
string city = adres.Locality;