bug report: google conversion

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bug report: google conversion

Travis at AndersenAcres.com
I notice that when one tries doing a conversion of directions using google maps to whatever output format that when you have a coordinate as a node instead of an address the error "XML Reader:Parse error at 2: not well-formed (invalid token)" occurs.  For example try using the following url
http://maps.google.com/maps?q=39.82N,%20104.96W%20to%20AURORA,%20CO It will display a map but if you use the same url with the &output=js parameter and then save it to a file and then try using gpsbabel to decode the waypoints or route the above formentioned error occurs.
 
Otherwise gpsbabel works great for address used in google.maps
 
Thank you
 
Travis
 
 
Reply | Threaded
Open this post in threaded view
|

Re: bug report: google conversion

Ron Parker-2
Travis at AndersenAcres.com wrote:
I notice that when one tries doing a conversion of directions using google maps to whatever output format that when you have a coordinate as a node instead of an address the error "XML Reader:Parse error at 2: not well-formed (invalid token)" occurs.
I just got around to looking at this, and it appears that the problem is that the output from Google Maps is not well-formed UTF-8.  (I'm as shocked as you are, Dear Reader.)

When you specify a coordinate pair, Google helpfully converts it to degrees and minutes, inserting a 'degree' symbol
where you'd expect to see one.  Unfortunately, it inserts it in ISO-8859-1 (0xB0) rather than in UTF-8 (0xC2 0xB0).  This inability to actually use the encoding they claim to use is a common error among people who generate XML on Windows; I'm not sure what Google's excuse is.

I'm looking into a way to detect and fix this condition automatically in GPSBabel.  Until then, inserting the following line at the beginning of the file fixes it:

<?xml version='1.0' encoding='ISO-8859-1'?>

Alternatively, you can find the places where the degree symbols appear and insert an  (alt-0194) character in front of them.
(This just works for degree symbols; in general the conversion from ISO-8859-1 to UTF-8 is harder.)

------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Gpsbabel-code mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gpsbabel-code