Bug report #13824
Saving As File GeoDatabase - Feature Dataset isn't Optional
|Affected QGIS version:||2.12.0||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21849|
Using QGIS 2.12.0 (OSGeo4W package installer) on Windows 7 64bit.
I have installed the ESRI fGDB OGR driver package via the package installer, and can successfully read and edit existing feature classes within file GDBs.
If I choose the Save As option from the layer context menu in QGIS to convert a shapefile into FGDB format, I have found that this operation will fail if the FEATURE_DATASET field under Layer Options is left blank. A new File GeoDatabase is created, but the following error is returned:
Export to vector file failed. Error: creation of layer failed (OGR error:Error: Failed at creating FeatureDataset (The table name is invalid.))
I know that the equivalent parameter to the OGR fileGDB driver (FEATURE_DATASET layer creation option) is optional, and if omitted, the feature class will be created in the root of the new file geodatabase when running the equivalent command from the command prompt using ogr2ogr:
ogr2ogr -f "FileGDB" "c:\\temp\\testFGDB.gdb" "c:\\temp\\test.shp" -nln "testFC"
It seems that this is a bug in the QGIS GUI, something along the lines of when the FEATURE_DATASET text box is blank, the parameter isn't being disabled, rather it is passed to GDAL with a blank value, resulting in the error. entering a value for FEATURE_DATASET allows the command to complete, but with the possibly undesired creation of a Feature Dataset within the FGDB.
Solution - prevent the FEATURE_DATASET parameter from being passed to GDAL when the GUI textbox is blank.