[OSM-dev] OGR driver for OSM data

Jukka Rahkonen jukka.rahkonen at latuviitta.fi
Thu Mar 8 20:08:38 GMT 2012


Jochen Topf kirjoitti:
> 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.
>

Mapping between two worlds indeed :) I have been GIS professional for 17
years now but writing little C++ programs is not so easy for me.

I agree that making generic OGR driver would be difficult. However,
osm2pgsql and PostGIS with hstore is now perhaps the best solution that
exists for GIS users and it is quite a heavy combination.

Apart databases and relational tables, only GML can be as complicated as
OSM data.  Actually the INSPIRE administrational units schema and data
structure are actually rather close to OSM admin levels data model.
Schema:
http://latuviitta.org/documents/inspire_au.xsd
GML data of Finland (big file, at least 100 MB)
http://latuviitta.org/documents/inspire_au.xml

-Jukka Rahkonen-




More information about the dev mailing list