7

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.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
ustroetz
  • 7,994
  • 10
  • 72
  • 118
  • Have you tried accessing an object in the filegeodatabase? You are asking ogrinfo to describe a directory and not a spatial object. – Jeffrey Evans Apr 22 '15 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.
    – Get Spatial Apr 22 '15 at 15:29
  • @JeffreyEvans how would I access an object? – ustroetz Apr 22 '15 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 Apr 22 '15 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 Apr 22 '15 at 21:01
  • copy gdalplugins to ogr2ogr.exe dir – ccxbb Mar 24 '17 at 01:43

2 Answers2

5

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.

user30184
  • 65,331
  • 4
  • 65
  • 118
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

kartoza-geek
  • 1,161
  • 1
  • 7
  • 17