If it works (again, not still), of course it can have a reprieve.   It's literally the oldest thing on my TODO markerboard...dating back to 1.3.7. :-/

For a long time, output=js was changing on a weekly/monthly basis.  Ron or I would pore through the Javascript to figure out how it was decoding the Secret Strings and make our code do the same.   A while back, output=js just plain quit delivering output at all and you had to work reasonably hard (faking browser UA strings or saving it from a browser) to get data that we could read at all.    It looks like it's now documented and the UA restriction has been lifted, so it makes more sense to keep it.   

I'm getting to play historian a lot lately while other people do Programmer Stuff.  It's kind of nice. :-)

In light of this stay of execution, Steve's suggestion to make the new development into a new module seems right to me.  googleamapapi or something would get my vote over "google2".


On Thu, Jan 3, 2013 at 8:06 PM, tsteven4 <tsteven4@gmail.com> wrote:
I have committed r4233 that fixes the long broken (since at least 2007) conversion of google directions for multi-segmented routes.  As Guilhem recently pointed out using &output=js format at maps.google.com currently generates output that can be parsed by gpsbabel using the google input format.  This patch allows that conversion to succeed with multi-segmented routes, e.g. A->B->C or A->B with marked intermediate points.

I think your suggestion to "create a new "module" (something like "google2" or anything more explicit)? Or perhaps rename previous one?" sounds best.  I would encourage you to continue your work with the new API, it sounds like a much better solution than the current js parsing in google.c.  I think it would be best to leave the old one with the "google" name for user interface consistency.  Keeping your new method separate may allow us to delete the old one some day which will be more palatable after the success of your new method with the documented API is demonstrated.  It will also allow you to have cleaner code as you won't have to support the old js and xml conversions.  The js method had been a maintenance issue earlier, but it appears to have been stable between 2007 and now in that no changes were required to get it to work today except in the case of multi-segmented routes that didn't work in 2007 anyway.

Can you hold off the blood lust to kill the old format?  It still works, and it is useful.


On 12/30/2012 3:42 PM, Guilhem Bonnefille wrote:

After playing some time on this topic, I'm not sure what I have to do.

I have a initial working code for the new Google Directions API.
But I discovered that the old one still work: at least the result of a query ending with &output=js is still parsed successfully. I discovered that while cleaning gpsbabel from "old" code.

So, what should I do?
Should I overwrite the old code and support only the new API?
Should I create a new "module" (something like "google2" or anything more explicit)? Or perhaps rename previous one?
Should I rewrite google.c in order to keep previous feature and add the new parsing to it?

Please, give me your opinion about this topic.

PS: current state of my work can be checked at

2012/12/17 Robert Lipe <robertlipe@gpsbabel.org>

That looks like a very different service.  The 'google' format has been broken for a long time and was on my list to remove for the last few releases.

We have infrastructure in place for reading XML, but not JSON, so that would be an easier place to start.  The XML seems to have a lot of stuff that we just don't have a place to put, but a straight-forward rip that just captures leg/step/start_location/{lat_lon} pairs probably has value.  It looks like it likes to think of "legs" (a line with two points) where we fundamentally think of an array of points, so there's a little bit of busy work required to suppress the dupes if you do the "obvious" thinkg of adding both start and end of each leg as a point to us.  It's probably not a very hard problem and even if you don't solve it at all, it's probably still useful; it'll just have more points than it should and wouldn't handle multi-segment routes as well as it could.   Neither are particularly shameful or common.

You can look at any of sourc efiles including "xmlgeneric.h" for examples, and we'll answer anything we can to help you get it developed and integrated. 

On Sun, Dec 16, 2012 at 3:11 PM, Guilhem Bonnefille <guilhem.bonnefille@gmail.com> wrote:

Since few month, the web service Google Direction change its API and, most of all, its output format.[1]
Does someone work on this topic?
I'm quite able to give an help, if no-one else work on this and if an experienced expert want to mentor me.

I found that gpsbabel has a "google.c" module but I'm not sure what output it proceses.
To support the current API, what is the best? Updating google.c or creating a google_direction.c?

As an example, you can access data with:

-=- JID: guyou@im.apinc.org MSN: guilhem_bonnefille@hotmail.com
-=- mailto:guilhem.bonnefille@gmail.com
-=- http://nathguil.free.fr/

LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
Gpsbabel-code mailing list  http://www.gpsbabel.org

-=- JID: guyou@im.apinc.org MSN: guilhem_bonnefille@hotmail.com
-=- mailto:guilhem.bonnefille@gmail.com
-=- http://nathguil.free.fr/

Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:

Gpsbabel-code mailing list  http://www.gpsbabel.org