8

I have a file ending with *.gdb. I don't know what it actually is. I also don't know what to expect inside the file. I am trying to access it with ogr.

I tried with ogrinfo:

ogrinfo test.gdb 
ERROR 1: posix_spawnp() failed
FAILURE:
Unable to open datasource `test.gdb' with the following drivers.
  -> ESRI Shapefile
  -> MapInfo File
  -> UK .NTF
  -> SDTS
  -> TIGER
  -> S57
  -> DGN
  -> VRT
  -> REC
  -> Memory
  -> BNA
  -> CSV
  -> GML
  -> GPX
  -> KML
  -> GeoJSON
  -> GMT
  -> GPKG
  -> SQLite
  -> WAsP
  -> PostgreSQL
  -> PCIDSK
  -> OpenFileGDB
  -> XPlane
  -> AVCBin
  -> AVCE00
  -> DXF
  -> Geoconcept
  -> GeoRSS
  -> GPSTrackMaker
  -> VFK
  -> PGDump
  -> OSM
  -> GPSBabel
  -> SUA
  -> OpenAir
  -> PDS
  -> WFS
  -> HTF
  -> AeronavFAA
  -> EDIGEO
  -> GFT
  -> GME
  -> SVG
  -> CouchDB
  -> Idrisi
  -> ARCGEN
  -> SEGUKOOA
  -> SEGY
  -> XLS
  -> ODS
  -> XLSX
  -> ElasticSearch
  -> PDF
  -> CartoDB
  -> SXF

So apparently I do have the OpenFileGDB driver. Why do I get an error?


I am on OS X 10.10.3

My GDAL version is 1.11.1, released 2014/09/24 installed with brew.

6
  • Have you tried accessing an object in the filegeodatabase? You are asking ogrinfo to describe a directory and not a spatial object. Commented Apr 22, 2015 at 15:29
  • Where did the file come from? Do you know what is supposed to be in the file? If it is a FileGDB, do you know what version it is? This may make a difference. What system are you using? How did you install GDAL? You should upgrade to the latest version of GDAL. Basically all of my questions lead to the point of you needing to add more detail to your question to handle some of the possible variables. The more detailed information you can provide, the better your chance of getting a good answer. Commented Apr 22, 2015 at 15:29
  • @JeffreyEvans how would I access an object?
    – ustroetz
    Commented Apr 22, 2015 at 15:44
  • 1
    You say it is a "file". Is it a file or folder? It should be a folder with a bunch of files with various .gdb* extensions. If it is a file, it may be a zipped file gdb. In that case, unzip the file and see what is inside.
    – JasonT
    Commented Apr 22, 2015 at 16:41
  • Yes it is a file ending with .gdb. So it is not a zip, but apparently also not a folder as expected from a File Geodatabase. I assume there is something wrong with the file. I try to get a hold of the creator of the dataset.
    – ustroetz
    Commented Apr 22, 2015 at 21:01

2 Answers 2

6

I do not know why you get an error but compare your results with mine. Download first this file https://hub.qgis.org/attachments/8536/Trecks.gdb.zip

Unzip (it will create a directory) and run ogrinfo

ogrinfo Trecks.gdb
Had to open data source read-only.
INFO: Open of `trecks.gdb'
      using driver `OpenFileGDB' successful.
1: Venedigertreck_3D (3D Multi Line String)
2: Knappentreck_3D (3D Multi Line String)
3: Schobertreck_3D (3D Multi Line String)
4: Lasoerlingtreck_3D (3D Multi Line String)
5: Trecks (3D Multi Line String)
6: Trecks_3D (3D Multi Line String)
7: umbalfaelle (3D Multi Line String)
8: Trecks_fertig (3D Multi Line String)
9: Trecks_3D_fertig (3D Multi Line String)

Select some layer and take a summary report:

ogrinfo Trecks.gdb Knappentreck_3D -so
Had to open data source read-only.
INFO: Open of `Trecks.gdb'
      using driver `OpenFileGDB' successful.

Layer name: Knappentreck_3D
Geometry: 3D Multi Line String
Feature Count: 2
Extent: (148016.066200, 199364.803000) - (152634.006300, 210556.171800)
Layer SRS WKT:
PROJCS["MGI / Austria GK West",
    GEOGCS["MGI",
        DATUM["Militar_Geographische_Institute",
....

Re-run ogrinfo without -so and you should see all the data.

6
  • I get the same results as you do with the sample file you provided.
    – ustroetz
    Commented Apr 22, 2015 at 15:53
  • Thus my conclusion is that there is something different in your geodatabase.
    – user30184
    Commented Apr 22, 2015 at 15:58
  • You are right. There is something wrong with my file. Your sample file and your description helped me confirm this. Therefore I accept that as the answer.
    – ustroetz
    Commented Apr 22, 2015 at 21:00
  • 5
    Pro tip: don't unzip, just do ogrinfo Trecks.gdb.zip
    – Mike T
    Commented Apr 22, 2015 at 21:29
  • 2
    @ustroetz "GDB must be ArcGIS version 10 or later". So if you happen to have version 9...
    – Miro
    Commented Mar 24, 2017 at 1:52
1

Try opening it in qgis and see if you can access the objects as described. You choose vector>Directory>click on souce type and choose OpenfileGDB or alternatively try to convert it to other formats using ogr. If it fails then upgrade gdal. If qgis can open this then you might be having two versions of gdal

2
  • I can't open it this way. I think there is something wrong with the file.
    – ustroetz
    Commented Apr 22, 2015 at 16:03
  • I had this issue. It turned out that my gdb file was empty.
    – jsta
    Commented Oct 25, 2016 at 17:21

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.