There are scripts that exist for converting osm to gml. Then they can be imported directly using ogr.
I did not have much luck with using XSLT with the the xml styles location on the Open Street Map wiki (http://wiki.openstreetmap.org/wiki/Converting_OSM_to_GML), but the python script (http://www.chzsoft.de/geo/osm2gml.py.txt) worked well for me.
Casey
grass-user-request@lists.osgeo.org wrote:
Send grass-user mailing list submissions to
grass-user@lists.osgeo.orgTo subscribe or unsubscribe via the World Wide Web, visit
http://lists.osgeo.org/mailman/listinfo/grass-user
or, via email, send a message with subject or body 'help' to
grass-user-request@lists.osgeo.orgYou can reach the person managing the list at
grass-user-owner@lists.osgeo.orgWhen replying, please edit your Subject line so it is more specific
than "Re: Contents of grass-user digest..."Today's Topics:
1. Re: osm import (Moritz Lennert)
----------------------------------------------------------------------
Message: 1
Date: Thu, 29 Apr 2010 16:36:20 +0200
From: Moritz Lennert <mlennert@club.worldonline.be>
Subject: [GRASS-user] Re: osm import
To: Hamish <hamish_b@yahoo.com>
Cc: grass-user@lists.osgeo.org, Mathieu De Maeyer <mdemaeye@ulb.ac.be>
Message-ID: <4BD99964.9090505@club.worldonline.be>
Content-Type: text/plain; charset=ISO-8859-1; format=flowedOn 29/04/10 15:37, Hamish wrote:
Moritz wrote:
In a recent post [1], you said that to import OSM maps, one
can use v.in.ogr, but I don't see a driver for OSM maps in
ogr. Could you explain ?
umm, probably just a dream, it was a former Summer of Code wish
for GDAL which apparently never happened.
Yes, I saw that, too. Nice dream, thougha web search finds these which may help:
http://www.google.co.nz/search?q=osm2shp (.shp will be lossy!)
apparently .NET-based, don't know if it works with Mono.
But obviously the easiest is just to use the CloudMade shapefiles: http://downloads.cloudmade.com/http://svn.openstreetmap.org/applications/utils/import/ogr2osm/ogr2osm.py
That works the other way around, i.e. ogr -> osm, or ?and a crappy old osm2grass script I wrote circa GRASS 6.1:
http://sites.google.com/site/hamishbowman/gpsdrivefiles#osmbut probably your best bet is to try the v.in.gpsbabel module
with a recent version of GpsBabel. ([to be] renamed/rewritten as
v.in.gps in GRASS 7)
Sounds like an interesting solution. Limited to lines and points, though, or ? For the record, that's gpsbabel 1.3.5+and probably the best near-term strategy is to help verify that
GpsBabel's import filter does not lose any data in the OSM tag
-> GPX attribute conversion.
I'll ask my colleagues who might use this to check.then either v.in.ogr + OGR's GPX driver or v.in.gpsbabel's GPX.
Why not directly v.in.gpsbabel on the osm file ?finally "osm2pgsql"
for the record: http://wiki.openstreetmap.org/wiki/Osm2pgsqland then connect GRASS to the PostGIS database
might be the most robust approach. I don't know much about
PostGIS -> GRASS but it is something I'd like to read about on
a GRASS wiki page
Well, it should be a simple v.in.ogr. There is an example on the v.in.ogr man page.Thanks for the exhaustive response !
Moritz------------------------------
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-userEnd of grass-user Digest, Vol 48, Issue 70
******************************************
--
Casey Vandenberg Geomatics Specialist SJ Geophysics Ltd. / S.J.V. Consultants Ltd.
11966 95A Avenue Delta, BC, Canada, V4C 3W2 Office: 604.582.1100
Mobile: 778.928.1103
www.sjgeophysics.com