[GRASS-user] GRASS-module to import OSM-data

Hamish hamish_nospam at yahoo.com
Thu Jul 12 21:19:37 EDT 2007


Jannis Achstetter wrote:
> I wanted to import data from the OpenStreetMap-project to GRASS. I
> found a bash-script written by Hamish some (long) time ago and tried
> it that way. His script has 3 disadvantages for me:
> - It somehow had X and Y swapped (maybe worked correctly for earlier
> version of GRASS?)
> - It didn't work with OSM-files written by JOSM (Files written by
> server/API were OK)
> - It's slow (Spawns lot of procs, used tempfiles very often)
> So I quite rewrote the script in TCL (using similar techniques but
> improved ;) fixing some stuff.
> When I had the thing done, I tried to rewrite it, so it now became a
> module for GRASS (though written in TCL).
> The script reads the file line-by-line and stores the important stuff
> in arrays and then imports the data as vector map using 1 polyline for
> each way. Since TCL uses quite a bit of memory for arrays (it's not C
> after all), you might not want to import the whole planet.osm.
> Since this is my first module for GRASS and things can always be
> improved, feedback is very welcome and wanted.
> You can find the script here:
> http://kripton.kripserver.net/software/v.in.osm
> Written for GRASS 6.2.1, not tested for other versions.


Excellent stuff Jannis. I look forward to trying it out.
Yes, mine was a quick hack just to get it working. I was mostly
interested in building a connected network from all the OSM segments to
try out GRASS's v.net.* and d.path routing modules with real data.
Hopefully OSM has standardized some on road types (dirt, residential,
highway, etc.) since then. I remember correcting for that taking most of
the time. I'll update my google page to list your script once I get my
Debian upgrade finished ;)  Until then perhaps you could add it to the
GRASS Wiki add-ons page?


Hamish




More information about the grass-user mailing list