3

File Geodatabases are not connected to the same as other OGR data sources. In the Add Vector Layer dialog, the user has to select Directory as the Source Type, then further specify the type (as Open FileGDB or Esri FileGDB), then use the file browser to select the top-level folder of the FileGDB.

Example:

enter image description here

When one moves files around, data may not be where QGIS expects to find it. On opening the *.qgs file, the Handle Bad Layers dialog appears. However, this opens a file browser that appears to be the same one used to add a file-type OGR data source, such as Esri Shapefile, GeoJSON, KML, GeoPackage, etc. As this dialog is not used to add a FileGDB layer in the first place, it does not appear to work in the Handle Bad Layers dialog. When you navigate to the top-level folder and attempt to select it, the file browser just drills down into the FileGDB hierarchy.

Is there a workaround for this behavior? How can I reconnect data sources (what the Handle Bad Layers dialog does) for Esri File Geodatabases when files have been moved and paths have changed?

  • 2
    Instead of highlighting the bad layer path and opening the browse dialog, what happens if you edit the path value by manually updating the path text to the correct gdb location? – artwork21 Sep 16 '16 at 0:50
  • That worked! Do you know if that is a recent feature, because I think I remember that field not being manually editable in older versions, but it just worked in 2.16. In any event, do you want to turn that into an answer? – Lee Hachadoorian Sep 16 '16 at 1:14
  • @artwork21 Why don't you add your comment as an answer. It is actually correct. If the Datasource updated manually, it will solve the problem. – ahmadhanb Sep 16 '16 at 1:15
  • 1
    @LeeHachadoorian I tested with 2.14, and you can also update the Datasource manually. – ahmadhanb Sep 16 '16 at 1:16
3

As my comment noted, instead of highlighting the bad layer path and opening the browse dialog, just edit the path value by updating the path text to the correct gdb location in the bad layers dialog. Alternatively, you could open the .qgs file using a text editor and do a find and replace on the path and re-save the file (this method would be faster if you have to re-path many layers).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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