Unoffical empeg BBS

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

Page 1 of 2 1 2 >
Topic Options
#246667 - 17/01/2005 16:26 GPSApp users: MapsOnUs got good.
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
For those using GPSApp on their empegs, you probably already know that MapsOnUs is pretty much the only way you can use the web to get routes into the empeg.

In the past, creating a route with MapsOnUs was tricky for me, because it would sometimes do strange things, such as:

- Calling a freeway onramp an "unnamed road" instead of just saying "Take I-80 West".

- Confusing small roads with highways; A freeway onramp that appeared on many of my routes was called "highway 193". When there's no highway by that name anywhere near there.

- Making a route line that cut across blank terrain, even though the highway line was nearby. In these cases I had to hand-position an intermediate "correction" destination by clicking on the map. Big pain.

- Misdirecting you on small residential roads (like the ones near my house).

Anyone else get that behavior in the past?

Well, anyway, I just punched in a new set of directions (hadn't needed to for the last few months), and suddenly MapsOnUs is working flawlessly. All the problems I'd had before are corrected now. Yay! I don't know if it's because their database has been updated, or they've fixed code bugs, or what, I'm just glad to see it working that way.

And the Python parser script still seems to work fine on their output page.

Just wanted to put that in here for anyone else using GPSApp. Enjoy!
_________________________
Tony Fabris

Top
#246668 - 19/01/2005 10:45 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
schofiel
carpal tunnel

Registered: 25/06/1999
Posts: 2993
Loc: Wareham, Dorset, UK
Quote:
Calling a freeway onramp an "unnamed road" instead of just saying "Take I-80 West"


This is a good indicator that the underlying maps have good node granularity, a good thing.

Quote:
- Making a route line that cut across blank terrain, even though the highway line was nearby. In these cases I had to hand-position an intermediate "correction" destination by clicking on the map. Big pain.

- Misdirecting you on small residential roads (like the ones near my house).


This sort of behaviour shows that their route-matrix construction algorithm has defects: the second one typically shows that it is returning too many choices of matrix and the app that does the choice of route has got poor controls on choice of route criteria (also shown in the "missed highway" symptom above).

If the routing app now behaves better, then it's pretty obvious they've been working on the routing app.
_________________________
One of the few remaining Mk1 owners... #00015

Top
#246669 - 08/02/2005 16:49 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
robricc
carpal tunnel

Registered: 30/10/2000
Posts: 4931
Loc: New Jersey, USA
I was just checking out Google Maps. Looks like there are coordinates in the HTML source. Doesn't appear to be turn-by-turn at first glance.
_________________________
-Rob Riccardelli
80GB 16MB MK2 090000736

Top
#246670 - 09/02/2005 02:08 Re: GPSApp users: MapsOnUs got good. [Re: robricc]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
Ooo. Didn't know about this. Interesting little app. Having a go at it...
_________________________
Tony Fabris

Top
#246671 - 14/02/2005 18:51 Re: GPSApp users: MapsOnUs got good. [Re: robricc]
n6mod
enthusiast

Registered: 27/09/1999
Posts: 200
Loc: Berkeley, CA
Google Maps is based on technology developed (and sold to Google) by some friends of mine. (Tony- That was the other startup in the house in Berkeley)

It's a long shot, but I'll see if I can get them to sneak in some gpsapp-friendly output.

-Z
_________________________
-Zandr
Mk.IIa #010101243 currently getting a 500GB SSD. More spares in the shed.

Top
#246672 - 14/02/2005 19:12 Re: GPSApp users: MapsOnUs got good. [Re: n6mod]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
Oooooooo cool.
_________________________
Tony Fabris

Top
#246673 - 09/03/2005 15:48 Re: GPSApp users: MapsOnUs got good. [Re: n6mod]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
It's already there in a somewhat friendly format. The vector that is drawn for the directions seems to be an encoded string of actual coordinates. They simply decode it, scale it and draw it with some javascript foo.

I haven't had time to really play with gpsapp in a while, but the attached file was able to parse the google maps data. I got directions, clicked on the 'link to this page' and saved the page as plain html.

Then I fed it into the parser and it spit out something that looks like it would be a valid input file for gpsapp. It doesn't strip down the turn-by-turn descriptions yet, so gpsapp will probably repeat itself like 'turn left at turn left at that street' and quite a bit of code was simply cut and pasted from parse_mapsonus.

edit: updated the script to add the destination address as the last waypoint.


Attachments
250948-parse_google.py (522 downloads)



Edited by jaharkes (09/03/2005 16:08)
_________________________
40GB - serial #40104051 gpsapp

Top
#246674 - 09/03/2005 17:19 Re: GPSApp users: MapsOnUs got good. [Re: jaharkes]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
Whoa. COOOOOL.
_________________________
Tony Fabris

Top
#246675 - 29/10/2005 16:12 Re: GPSApp users: MapsOnUs got good. [Re: jaharkes]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
Oh.
My.
God.

I could KISS YOU.

It works. Turns and all.

I simply edited my batch file and replaced "parse_mapsonus.py" with "parse_google.py" and ran it, and IT WORKED.

GAAAAAAAAAAAAAAH THIS IS SO COOL.

AAAAAAAAAAAAAAAAA!!!!!

<head explodes>
_________________________
Tony Fabris

Top
#246676 - 01/11/2005 00:11 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
canuckInOR
carpal tunnel

Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
/me disassembles monitor and wipes tfabris head off the inside.

Top
#246677 - 01/11/2005 08:11 Re: GPSApp users: MapsOnUs got good. [Re: canuckInOR]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
Quick question.

When using the Google maps route I tried, my position was offset from the map, north and east by several meters, more than I would usually account for with consumer GPS accuracy and map data difficulties.

If I find that my position is always consistently off by X number of meters north and east, is there a way I can configure GPSapp to compensate? Like an offset command in its configurations info in config.ini?
_________________________
Tony Fabris

Top
#246678 - 01/11/2005 14:46 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
It could be that Google's coordinates are already in the WGS84 (gps) coordinate system. Typically map data in the US is in NAD27 coordinates.

In the parse_google.py file, there is a function 'decodePolyline'. It contains a line where we convert from NAD27toWGS84 which might not be necessary if they already did the conversion for us. The difference between the two coordinate systems tends to be about 200 meters.

You could replace coord=NAD27toWGS84(Coord(lat*SCALE,lon*SCALE)) with coord=Coord(lat*SCALE,lon*SCALE) and see if that does the trick.
_________________________
40GB - serial #40104051 gpsapp

Top
#246679 - 01/11/2005 17:40 Re: GPSApp users: MapsOnUs got good. [Re: jaharkes]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
Hm. Not sure if the difference I'm seeing is as big as 200 meters. But I'll give it a shot and see. Thanks.
_________________________
Tony Fabris

Top
#246680 - 01/11/2005 18:12 Re: GPSApp users: MapsOnUs got good. [Re: jaharkes]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
Okay, I've tried to make that change in the code a bunch of different times now, and it fails completely, no route file is generated. I don't know why it's failing because I don't see any console errors output. I'm pasting the text exactly as you wrote it, exactly in place of the existing line. So I don't know what's wrong, but I can't try this.
_________________________
Tony Fabris

Top
#246681 - 01/11/2005 21:08 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
siberia37
old hand

Registered: 09/01/2002
Posts: 702
Loc: Tacoma,WA
This might be worth a try:

def NAD27toWGS84(coord):
return ConvertDatum(coord, Datum_WGS84, Datum_WGS84)

(change the existing NAD27toWGS84 function), then you keep the coord= line the way it was before.

Top
#246682 - 01/11/2005 22:08 Re: GPSApp users: MapsOnUs got good. [Re: siberia37]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
Nope, same error. No route file gets generated when I change that function as you showed.
_________________________
Tony Fabris

Top
#246683 - 02/11/2005 04:27 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
mtempsch
pooh-bah

Registered: 02/06/2000
Posts: 1996
Loc: Gothenburg, Sweden
Shot in the blue, not knowing exactly how/with what you edit the file, but might it be an introduction of a non-Unix style linefeed upsetting the script?
_________________________
/Michael

Top
#246684 - 02/11/2005 11:41 Re: GPSApp users: MapsOnUs got good. [Re: mtempsch]
JBjorgen
carpal tunnel

Registered: 19/01/2002
Posts: 3582
Loc: Columbus, OH
Heh...same thing I thought.
_________________________
~ John

Top
#246685 - 02/11/2005 11:53 Re: GPSApp users: MapsOnUs got good. [Re: jaharkes]
Daria
carpal tunnel

Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
Quote:
It could be that Google's coordinates are already in the WGS84 (gps) coordinate system. Typically map data in the US is in NAD27 coordinates.



This suggests yes, as did a quick check of my house.

Top
#246686 - 02/11/2005 14:28 Re: GPSApp users: MapsOnUs got good. [Re: mtempsch]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
Quote:
might it be an introduction of a non-Unix style linefeed upsetting the script?

First thing I checked. Taking the existing, working script, editing and resaving with the CR/LF pairs (no textual edits), and running it, works.

Only editing that function in the ways suggested cause it to fail. Not the CR/LF issue.
_________________________
Tony Fabris

Top
#246687 - 02/11/2005 14:29 Re: GPSApp users: MapsOnUs got good. [Re: Daria]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
Quote:
This suggests yes, as did a quick check of my house.

Ah, good. Now if we could just get that python script to work without the data conversion, we'd be in good shape.
_________________________
Tony Fabris

Top
#246688 - 02/11/2005 14:56 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
Daria
carpal tunnel

Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
I suppose in a bit I will look.

Top
#246689 - 02/11/2005 14:57 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5680
Loc: London, UK
Quote:
Quote:
This suggests yes, as did a quick check of my house.

Ah, good. Now if we could just get that python script to work without the data conversion, we'd be in good shape.


Python is whitespace sensitive. The code snippet above doesn't have any leading whitespace. Did you make sure that the body of the function was indented under the name?
_________________________
-- roger

Top
#246690 - 02/11/2005 16:25 Re: GPSApp users: MapsOnUs got good. [Re: jaharkes]
Daria
carpal tunnel

Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
Try


Attachments
268654-250948-parse_google.py (459 downloads)


Top
#246691 - 02/11/2005 17:16 Re: GPSApp users: MapsOnUs got good. [Re: Daria]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
Okay, that works!

But it looks to be exactly like the modification you supplied above.

I tried to make the whitespace match exatly when I made the modifications, but perhaps I just got it wrong.

Now it's off to try a little drive and see if the coordinates match the real world better. THANK YOU!
_________________________
Tony Fabris

Top
#246692 - 02/11/2005 17:19 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
Daria
carpal tunnel

Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
I didn't supply the mod. I just used an editor on a real platform

Top
#246693 - 02/11/2005 17:42 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
Okay, fantastic, the modified version of the script is correct. Without the NAD27 to WGS84 data conversion, the car's position on the map route is perfectly nailed. Fantastic!

Now for the next problem.

Every single turn is wrong. Every single turn tells me (for example) to go left when it's clearly right. Also, as I execute that turn, it doesn't advance me to the next waypoint.

I'm pretty sure this is because the Google Maps data has some kind of a "hiccup" in the data points at each turn location. This happened before when we tried to use another mapping program. instead of a turn looking like this...

Code:

|
|
|
O-------



If you magnifiy it really small, in the data points it acutally looks like this:

Code:

|
|
|
O--|-------
\ |
\|
|



Is there any way we can fix that in the script?
_________________________
Tony Fabris

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

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
No wait!!!!!

It's simpler than that.

That was the problem with the other mapping program. With this one it's not nearly as thorny an issue. The problem is that each turn contains two data points that are the exact same point. For example:

52 -4942
252 -4957
253 -5154
253 -5154
Take the Stewart St. exit 166 to Denny Way
246 -5177
234 -5307
233 -5328

That should be VERY EASY to fix in the script, right?
_________________________
Tony Fabris

Top
#246695 - 02/11/2005 19:03 Re: GPSApp users: MapsOnUs got good. [Re: tfabris]
Daria
carpal tunnel

Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
Quote:
No wait!!!!!

It's simpler than that.

That was the problem with the other mapping program. With this one it's not nearly as thorny an issue. The problem is that each turn contains two data points that are the exact same point. For example:

52 -4942
252 -4957
253 -5154
253 -5154
Take the Stewart St. exit 166 to Denny Way
246 -5177
234 -5307
233 -5328

That should be VERY EASY to fix in the script, right?


For anyone but you, apparently

Top
#246696 - 02/11/2005 19:25 Re: GPSApp users: MapsOnUs got good. [Re: Daria]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
Hey, I don't know python. Not my fault!

And I know my editor didn't have anything to do with it because I've successfully edited the old MapsOnUs python script to add more text phrases to strip out of the turn directions. I'm guessing it was a whitespace-sensitivity issue (despite my attempts to match the whitespace correctly).

Anyway...

Does anyone know where in the script one might handle that correction?
_________________________
Tony Fabris

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

Registered: 20/12/1999
Posts: 31563
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: 31563
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 (386 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: 31563
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: 31563
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 (368 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 (374 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: 31563
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: 31563
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: 31563
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: 31563
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: 31563
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 1 of 2 1 2 >