0

I want to read an OSM file with OGR. I use Version GDAL 1.9.1, released 2012/05/15.

To read a SQLITE file works fine:

$ ogrinfo test.sqlite
INFO: Open of `test.sqlite'
      using driver `SQLite' successful.
1: aaa (Point)

When I try to read a OSM File it fails to open the datasource:

$ ogrinfo test.osm
FAILURE:
Unable to open datasource `test.osm' with the following drivers.
  -> ESRI Shapefile
  -> MapInfo File
  ...

The OSM file itself is not broken (I opened it in QGIS).

What am I doing wrong?

1 Answer 1

0

OSM data (in Protobuf - PBF and the traditional XML format) isn't supported in OGR until at least 1.10.0. Since you have 1.9.1, you can't make use of it at this time. You may wish to upgrade your GDAL/OGR (and whatever other tools you have that depend on it), or import / convert the OSM using another tool first, then use it in OGR.

2
  • 3.0.2 still cant open it Commented Aug 25, 2023 at 11:56
  • @FlashThunder I'd suggest opening another question, given that it is meant to work. Note that there are specific build configuration settings that are required, so you should specify your exact setup.
    – BradHards
    Commented Aug 26, 2023 at 1:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.