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

Jannis Achstetter krippi at gmail.com
Thu Jul 12 18:08:14 EDT 2007


Hello list,

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.

Sincerely,
    Jannis




More information about the grass-user mailing list