Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Page 2 of 2 < 1 2
Topic Options
#246697 - 02/11/2005 20:39 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31594
Loc: Seattle, WA
Okay, there's a function in the old mapsonus parse routine that looks like this:

Code:

# create a route as a combination of 'shape' and 'turn' information
# make sure we discard duplicate records.
waypoints = []
for i in range(-1, len(coords)):
if route.has_key(i):
if len(waypoints) and waypoints[-1].coord == coords[i]:
del waypoints[-1]
waypoints.append(route[i])
else:
if waypoints[-1].coord != coords[i]:
waypoints.append(Wpoint(coords[i]))
return waypoints



The matching code in the new routine seems to be
Code:


h.segments[len(h.coords)-1] = h.destination
wpoints = []
for i in range(len(h.coords)):
wpoints.append(Wpoint(h.coords[i], h.segments.get(i)))
return wpoints



But I don't think a direct replacement will work because objects like "route" don't exist in the new code. Or am I reading that wrong?
_________________________
Tony Fabris

Top
#246698 - 02/11/2005 20:46 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31594
Loc: Seattle, WA
In the meantime, I'm working on a really complete "Strip" statement for the top of the script. Working OK so far, I have to throw a bunch of test cases at it next.
_________________________
Tony Fabris

Top
#246699 - 02/11/2005 21:01 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
The obvious thing to do would be to check on output to see if the line it's getting ready to print is the same as the last line it printed. You need to be careful about the descriptions, though.
_________________________
Bitt Faulk

Top
#246700 - 02/11/2005 21:14 Re: GPSApp users: MapsOnUs got good. [Re: wfaulk]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
I haven't even begun to test this. Not even run it through the interpreter to make sure the syntax is right.


Attachments
268703-parse_google.py (425 downloads)

_________________________
Bitt Faulk

Top
#246701 - 02/11/2005 21:46 Re: GPSApp users: MapsOnUs got good. [Re: wfaulk]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31594
Loc: Seattle, WA
Naw, that one doesn't produce any file as output. Thanks for the stab at it. Perhaps you'll get a chance to run it through the interpreter soon?
_________________________
Tony Fabris

Top
#246702 - 02/11/2005 21:55 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31594
Loc: Seattle, WA
By the way, if anyone wants it, I've got a strip command that's working pretty well so far in my test cases. The line is:

discard="((Start|End)\sPoint|follow|Continue onto|Continue on|continue|Continue|bears?|Bear|bear|turn|TURN|Turn |Go |into the |Take the|Take |Merge into|into|to |Set by click|sharply|left at|right at|left|right|straight|onto|as road goes into|as it|Head\s(North|West|East|South)\son)\s?"

And you have to chage the comment mark here so that the strip command gets called:

self.desc = re.sub(discard, "", desc).strip()
#self.desc = desc.strip()
_________________________
Tony Fabris

Top
#246703 - 02/11/2005 22:00 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
Here is a version that removes duplicates from the route (and which doesn't do datum conversion).


Attachments
268708-parse_google.py (407 downloads)

_________________________
40GB - serial #40104051 gpsapp

Top
#246704 - 02/11/2005 22:00 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Okay. A couple of syntax errors. Here it is again.


Attachments
268709-parse_google.py (413 downloads)

_________________________
Bitt Faulk

Top
#246705 - 02/11/2005 22:03 Re: GPSApp users: MapsOnUs got good. [Re: wfaulk]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31594
Loc: Seattle, WA
WOOO! SIMULTANEOUSLY!!!

I love you guys, you rock. So much.
_________________________
Tony Fabris

Top
#246706 - 02/11/2005 22:15 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31594
Loc: Seattle, WA
Just tried Jan's version. Works great!

Didn't try yours, yet, Bitt, sorry. Grabbed the first one my mouse fell upon, and it works.

YAY, DIRECTIONS FOR GPSAPP WORK AGAIN!

REJOICE!

So, Jan, you can update your script with the modified character-stripping commands I posted earlier in the thread, and put it up at the GPSapp web site. And if you fix up the instructions to describe how to use it with Google instead of Mapsonus, then I'll edit the FAQ to remove the note about how mapsonus stopped working.
_________________________
Tony Fabris

Top
#246707 - 03/11/2005 00:01 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
Ok, ok, and... ok. Haven't actually updated the tarball or CVS, just included a description and link to the parse_google script on the gpsapp page.
_________________________
40GB - serial #40104051 gpsapp

Top
#246708 - 03/11/2005 00:38 Re: GPSApp users: MapsOnUs got good. [Re: jaharkes]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31594
Loc: Seattle, WA
Cool.

Thanks everyone, for all the help.

Now, that's one more year I can go without dropping the cash on a nav system.
_________________________
Tony Fabris

Top
#246709 - 03/11/2005 03:59 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31594
Loc: Seattle, WA
I just took an actual drive with some mapping data using this script, and it worked perfectly. The Google map data is very accurate, moreso than I was used to seeing with mapsonus.

Awesome.
_________________________
Tony Fabris

Top
#246710 - 13/01/2006 20:55 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31594
Loc: Seattle, WA
Did Google Maps just change the output format of their web page?

I just tried converting a couple sets of directions with Parse_google.py and got errors. Is anyone else besides me using Parse_google.py and do you get the same problem?
_________________________
Tony Fabris

Top
Page 2 of 2 < 1 2