Wednesday 23 October 2019

gdal - Reading Esri File Geodatabase (FileGDB) with OGR?



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.



Answer



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.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...