Finding a place by adress

Dec 12, 2008 at 4:30 PM
I would be nice and very helpfully if we a place by adress and not only by geocoords.

Thanks,
Erich
Coordinator
Dec 13, 2008 at 9:45 AM
I definitely implement this if google allow this free.
Jan 14, 2009 at 7:52 AM
 I suggest to optimize the search for coordinates at.

public

string MakeGeocoderUrl(string keywords)

 

{

 

//string key = keywords.Replace(' ', '+');

 

 

//return string.Format("http://maps.google.com/maps/geo?q={0}&output=csv", key);

 

 

var _googleUri = "http://maps.google.com/maps/geo?q=";

 

 

// Get your key from: http://www.google.com/apis/maps/signup.html

 

 

var _googleKey = "";

 

 

var _outputType = "csv"; // Available options: csv, xml, kml, json

 

keywords =

HttpUtility.UrlEncode(keywords);

 

 

return String.Format("{0}{1}&output={2}&key={3}", _googleUri, keywords, _outputType, _googleKey);

 

}

 

private

PointLatLng? GetLatLngFromGeocoderUrl(string url)

 

{

 

PointLatLng? ret = null;

 

 

 

var client = new WebClient();

 

 

var geocodeInfo = client.DownloadString(url).Split(',');

 

 

var lat = double.Parse(geocodeInfo[2], CultureInfo.InvariantCulture);

 

 

var lng = double.Parse(geocodeInfo[3], CultureInfo.InvariantCulture);

 

ret =

new PointLatLng(lat, lng);
}

 

Coordinator
Jan 14, 2009 at 12:14 PM
well the key is only valid for web site, we don't use that ;}, and webclient isn't perfect solution for such things, it even can't set timeout ;}