MapsOnUs Data and ActiveState Python2.2-Questions

Posted by: Neutrino

MapsOnUs Data and ActiveState Python2.2-Questions - 18/10/2002 11:18

I have downloaded and installed GPS App .9 and ActiveState Python 2.2. This was no problem. My question concerns the data from MapsOnUs and how you get Python to work with it. I understand how to get the data from Mapsonus but that is where I hit a roadblock. In the Raw Route Data Page, what portion of this page should I use? Do I delete the none data stuff from the top? I have read in the GPS App threads something about saving this page as an HTML. Once again what portions of this page should I import into Python. My version of Python in its present state does not understand the HTML data that I am trying to run. Do I simply open the HTML page in Python and hit "Run". Could someone give us a run down on the correct procedure to do this stuff? Any help from you way more intellegent that average people would be greatly appreciated.

Thank You
Posted by: tfabris

Re: MapsOnUs Data and ActiveState Python2.2-Questions - 18/10/2002 11:27

At the bottom of the page is a link "Raw Route Description".

Right-click on that link and say "Save Target As".

Save it as a file name that represents the directions with an HTM extension. For example "Trip to Morro Bay.htm".

Then go to a DOS prompt in that directory and type...

parse_mapsonus.py "Trip to Morro Bay.htm"

It should save a file called "Trip to Morro Bay" with no file extension.

I've written a batch file wrapper to all of this which also FTP's the resulting file to the empeg and cleans up after itself.

Posted by: jaharkes

Re: MapsOnUs Data and ActiveState Python2.2-Questi - 18/10/2002 11:27

I'm not sure about windows, but on my machine I simply run,

python parse_mapsonus.py raw_route.html
Posted by: tfabris

Re: MapsOnUs Data and ActiveState Python2.2-Questions - 18/10/2002 11:30

Note that if you are not in the same directory as either of those files (the .PY or the .HTM), then you have to include the full path name to those files when you invoke the command. For instance, for me, it might be:

c:\progra~1\directions\parse_mapsonus.py "c:\temp\test map.htm"

The resulting data file will end up in whatever the current directory is.
Posted by: Neutrino

Re: MapsOnUs Data and ActiveState Python2.2-Questions - 18/10/2002 11:57

Thank You both for the speedy reply. I'm on the Road! Yahoo!