I’ve been trying to work out how to obtain the travel time between two locations (walking, driving etc…).
As I understand it, the only way to do this accurately is by retrieving a KML file from google, then parsing it.
Research has shown that it then needs to be parsed with SAX. The problem is, I can’t seem to work out how to extract the correct variables (the time). Does anybody know if / how this can be done?
Many thanks for your help,
Pete.
Parsing XML (what KML basically is), using a SAX-Parser: http://www.dreamincode.net/forums/blog/324/entry-2683-parsing-xml-in-java-part-1-sax/
In the example you can see, that the guessed time is stored in the “description”-Tag. It’s saved in the last “Placemark”-Tag in the KML-File and it has a “
<name>Route</name>“-Tag.Getting this Tag with the SAX-Parser and extracting the time using regex should be easy done.