From OpenStreetMap Wiki
Jump to: navigation, search

I'd like to put more detailed instructions somewhere for beginners (like me). Should they go on this page?

Here is step-by-step what I've done:

bunzip Washington-20080229.osm.bz2
svn checkout
cd pyroute
python ../data/Washington-20080229.osm 21505268 26608779

This ate all my memory and then I killed it.

--Abie 16:54, 8 July 2008 (UTC)

TBH, I'd suggest trying something like:
svn co
python [lat1] [lon1] [lat2] [lon2] [car|cycle|foot]
that will download data as required, and should be faster and use less memory. If you then need to download data for a large area, write a script based on the URLs and filenames in Ojw 17:26, 8 July 2008 (UTC)

Hi Ojw, I keep getting error in on different .osm and .pbf (planet) files but I keep getting type errors where it can't concatenate string and int. I only try it on small metro extracts such as toronto.osm.pbf and also toronto.osm (uncompressed osm file) but I keep getting the error. I am also entering the coordinates that are within the bounds of the .osm file. In my Ubuntu linux command line, I enter: python toronto.osm.pbf 43.667 -79.4000 43.725 -79.402 car but then I get this error:

Traceback (most recent call last):

 File "", line 85, in <module>
 File "", line 31, in routeToGpx
   node1 = data.findNode(lat1,lon1)
 File "/home/peter/pyroutelib2/", line 173, in findNode
 File "/home/peter/pyroutelib2/", line 46, in getArea
   (x,y) = tilenames.tileXY(lat, lon, z)
 File "/home/peter/pyroutelib2/", line 30, in tileXY
   x,y = latlon2xy(lat,lon,z)
 File "/home/peter/pyroutelib2/", line 26, in latlon2xy
   x,y = latlon2relativeXY(lat,lon)
 File "/home/peter/pyroutelib2/", line 20, in latlon2relativeXY
   x = (lon + 180) / 360

TypeError: cannot concatenate 'str' and 'int' objects

Can you verify that I've entered all this correctly? Does your script work on .pbf extract files as well as .osm files?

I believe I included all the parameters and I also try different variations such as foot or cycle.  Thanks for your help.

--Developingcountries 21:55, 29 December 2013 (UTC)