Active Topics

 


Reply
Thread Tools
Posts: 2 | Thanked: 0 times | Joined on Aug 2007
#1
It appears that google has changed something.
http://gnuite.com:8080/cgi-bin/gpx.cgi/directions.gpx does not parse the description properly. Does anyone have this script, I would prefer to host it locally and be able to fix issues like this quickly. Is there a reason it isn't readily avaible?
 
rcull's Avatar
Posts: 299 | Thanked: 168 times | Joined on Jun 2006 @ Wales UK
#2
Straight from the gpsbabel docs

#!/bin/sh
FROM="233 S. Upper Wacker Dr, Chicago, IL"
TO="1060 W. Addison St, Chicago, IL"
wget -O - "http://maps.google.com/maps?q=$FROM to $TO&output=js" \
2&>/dev/null >google_map.js
gpsbabel -i google -f google_map.js -o gpx -F google_map.gpx
Thats -zero not -ohhh in the wget line

You will probably have to play with the output

Rick
 
gnuite's Avatar
Posts: 1,245 | Thanked: 421 times | Joined on Dec 2005
#3
Sorry, but the code is unavailable for public release at the moment. In the future, the script may be based on gpsbabel, after which point I can release the code. In that case, though, I'll probably also incorporate gpsbabel support into Maemo Mapper itself.

By the way: thanks for the notice. I have since fixed the script.

Oh, and to rcull: actually, I think it is -ohhh, not -zero. "O" stands for "output", and "-" indicates stdout.
 
rcull's Avatar
Posts: 299 | Thanked: 168 times | Joined on Jun 2006 @ Wales UK
#4
You know I only open my mouth to change feet. ( shouldnt do these things from memory)
Gnuite
If you are including gpsbabel in MM is there any point in my continuing with Poi_Loader.

Rick
 
Posts: 2 | Thanked: 0 times | Joined on Aug 2007
#5
Originally Posted by rcull View Post
Straight from the gpsbabel docs



Thats -zero not -ohhh in the wget line

You will probably have to play with the output

Rick
Does it actually work anymore? From what I understand output=js used to include a xml document embedded in javascript. When I look at the output, I don't see anything that looks like a xml document. Furthermore, my gpsbabel output is empty save the parent tags that gpsbabel creates.

Gnuite: Thanks for the quick fix. Shame it's not public though. Perhaps you can explain how it works. I've tried to find a correlation between your script and say the kml output and it doesn't seem similar. For instance, your output has far more trackpoints. Do you just divide two points by a certain distance and include them for more accurate tracking?

Last edited by dracae; 2007-08-23 at 14:28.
 
thel8elvis's Avatar
Posts: 14 | Thanked: 2 times | Joined on Aug 2007 @ Virginia
#6
I believe the info from gpsbabel is out-of-date.

Google maps *used* to output in XML. Now, to get XML output, I believe you need a to go through the API, and you need a key. Even then, according to TOS,
The API is limited to allowing You to display map images only, and does not provide You with the ability to access the underlying map data, any services provided by Google in connection with its maps service (such as local search or directions), or any other Google service.
That being said, it is possible to grab the output from google maps, and it is in JSON. Then it is possible to parse it and create valid gpx output. There is a 'bookmarklet' here: gmaptogpx that parses the output into valid gpx.

The JS code used to parse the gmaps output is here

So, if one was enterprising, it would be possible to create a cgi script that takes a start and a destination, grab the js output from google maps, run it through the JS linked to above, and return gpx results.

As a disclaimer to all this, I just got a BT GPS receiver a week ago, and just started playing with maemo-mapper. I have not spent much time looking into all this....I may be completely wrong :-)
 

The Following User Says Thank You to thel8elvis For This Useful Post:
gnuite's Avatar
Posts: 1,245 | Thanked: 421 times | Joined on Dec 2005
#7
Originally Posted by dracae View Post
Perhaps you can explain how it works. I've tried to find a correlation between your script and say the kml output and it doesn't seem similar. For instance, your output has far more trackpoints. Do you just divide two points by a certain distance and include them for more accurate tracking?
Think of it this way: Google Maps's UI shows more than just waypoint locations. It also shows the actual path that you take to get from one waypoint to another (following the road). The GPX Driving Directions web service is able to extract both waypoint locations and path information (known by GPX as a "track") and return a GPX document based on that.

That's why Maemo Mapper's GPX format uses the "trk" element instead of the "wpt" element - it stores (by GPX's definition) a track, not just a set of waypoints. Conceivably, Maemo Mapper could store both trk and wpt elements, but unfortunately, there isn't an easy way (in GPX) to tie a wpt element to a specific trk element (unless I'm missing something). So I just store waypoint information directly in the trk data. Not ideal, I know, and maybe someday I'll find a way to make it better.
 
Reply


 
Forum Jump


All times are GMT. The time now is 11:50.