[OSM-dev] OGR driver for OSM data

Jochen Topf jochen at remote.org
Thu Mar 8 19:02:24 GMT 2012

On Thu, Mar 08, 2012 at 12:43:02PM -0500, Josh Doe wrote:
> I can only find a handful of mentions about creating an OGR driver for
> OSM files [0][1][2], and those are several years old. Has anyone else
> considered writing one? I don't think this group is terribly
> interested in it because we have many other robust tools for
> converting OSM data from and to other formats. However I think an OGR
> driver would lower the barrier to entry for using OSM data for those
> who aren't familiar with any of these other tools, and don't need the
> power they offer.
> Right now I'm only thinking about a read-only implementation. Basing
> the driver off of one of the existing XML-based drivers like KML or
> GPX. Possibly revive this as a GSoC idea?

This idea comes up again and again. Writing a generic OGR driver for OSM data
would be very difficult, because the data models just don't match. You'd have
to have some kind of complex mapping between the two worlds. Thats why nobody
has done it.

Osmium (http://wiki.osm.org/wiki/Osmium) has support for OGR output. Its
pretty easy to write a little C++ program that does the mapping you need
from OSM data to the OGR format. Example programs are provided for this.

Jochen Topf  jochen at remote.org  http://www.remote.org/jochen/  +49-721-388298

More information about the dev mailing list