I am trying to use Geocoding.net to reverse geocode my latitude and longitude to a formatted address.
I want a address from MapQuest and not from other providers like Yahoo, google and bing.
This is my Code:
try
{
IGeocoder geocoder = new MapQuestGeocoder("Fmjtd%7Cluu82q6***********");
var addresses = geocoder.ReverseGeocode(latitude, longitude);
return ("Formatted address : " + addresses.First().FormattedAddress);
}
catch (Exception exception)
{
return exception.Message;
}
This code catches an exception and thorws this error "This key is not authorized for this service."
I know that this error occurs when I try to hit the Enterprise API of Geocoder i.e http://www.mapquestapi.com/geocoding/v1/reverse?key=*******************
For free and open source usage, I should hit this API:
http://open.mapquestapi.com/geocoding/v1/address?key=YOUR-KEY-HERE
How can I do this? Is there any option of passing the POST URL in the constructor itself? Or any other way?
Copyright Notice:Content Author:「writeToBhuwan」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/29548124/mapquest-this-key-is-not-authorized-for-this-service