| Issue 3: | Address coordinate parsing does not work under cs-CZ culture | |
| Back to list |
See here: http://groups.google.com/group/geocodingnet/browse_thread/thread/5927d2520444a525 Hi, I found a bug in FromCoordinates method of GoogleGeoCoder class. When you run the code under different culture setting then en-US (cs-CZ in my case) you get "Input string was not in a correct format exception" at line 66: double longitude = double.Parse(coordinates[0]); Possible fix: private Location FromCoordinates(string[] coordinates) { CultureInfo ci = new CultureInfo("en-US"); double longitude = double.Parse(coordinates[0], (IFormatProvider)ci.NumberFormat); double latitude = double.Parse(coordinates[1], (IFormatProvider)ci.NumberFormat); Location gpsCoordinates = new Location(latitude, longitude); return gpsCoordinates; } Please note I have not read the documentation of the Google GeoCoding API so I only suppose the format of the returned coordinates is en- US. Thanks Leos
Aug 5, 2008
Project Member
#1
chadl...@gmail.com
Status:
Fixed
|