Bug report #7255

Cannot edit ESRI FileGDB in QGIS 1.8 (Win7 via osgeo4w inst.)

Added by Donovan Cameron over 11 years ago. Updated about 11 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Data Provider
Affected QGIS version:master Regression?:No
Operating System:Windows 7 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:16276

Description

I can't start an editing session on an ESRI FileGDB.

I'm using Windows 7 64bit with QGIS 1.8 installed from the osgeo4w installer.
I've also installed the gdal-filegdb driver.

This lets me add and view a FileGDB, but the "Start Edit" button is greyed out and I can't make edits.
I can create a FileGDB by using the "save as" option from a shapefile or other data sources, but still can't make subsequent edits to the resultant FileGDB.

I don't know if this is a QGIS, ESRI FileGDB API, or GDAL bug.

From my About QGIS window:

QGIS version 1.8.0-Lisboa
QGIS code revision f440b60
Compiled against Qt 4.7.1
Running against Qt 4.7.1
Compiled against GDAL/OGR 1.9.2
Running against GDAL/OGR 1.9.2
GEOS Version 3.3.6
PostgreSQL Client Version 8.3.10
SpatiaLite Version 3.0.1
QWT Version 5.2.1
This copy of QGIS writes debugging output.

I've attached a sample v10 FileGDB that has a polygon for the Province of British Columbia, Canada.

BC.gdb.zip - v10 ESRI FileGDB with polygon of British Columbia, Canada. (224 KB) Donovan Cameron, 2013-02-28 02:20 PM

25.png (309 KB) Giovanni Manghi, 2013-03-01 10:41 AM

36.png (349 KB) Giovanni Manghi, 2013-03-01 10:41 AM

42.png (328 KB) Giovanni Manghi, 2013-03-01 10:41 AM

qgisapp.png (158 KB) Mike MacRae, 2013-03-22 03:25 PM

Untitled.png (113 KB) Mike MacRae, 2013-03-25 03:28 PM

qgisedit.png (131 KB) Mike MacRae, 2013-03-26 08:16 AM

QGIS_about.png (39.9 KB) Mike MacRae, 2013-03-28 09:18 AM

Test_Geodatabase.zip (45.3 KB) Mike MacRae, 2013-03-28 09:18 AM

46.png (232 KB) Giovanni Manghi, 2013-03-29 01:58 PM


Related issues

Related to QGIS Application - Bug report #13024: Can't edit ESRI .gdb file Closed 2015-06-22

Associated revisions

Revision 808547e2
Added by Jürgen Fischer over 11 years ago

fix #7255 - any editing capability should enable toggle editing

History

#1 Updated by Giovanni Manghi over 11 years ago

  • File 25.png added
  • File 36.png added
  • File 42.png added
  • Status changed from Open to Feedback

I don't think it is enough to install gdal-filegdb and I don't think is qgis fault. AFAIK it is needed to have a copy of gdal compiled with file geodatabase support, and you can do just by obtaining your own copy of the esri sdk

http://resources.arcgis.com/content/geodatabases/10.0/file-gdb-api

For instance I have an Ubuntu VM where I compiled GDAL with the fgdb support and I can open and edit with no problems your vector. See attached image.

I believe this should be closed.

#2 Updated by Jürgen Fischer over 11 years ago

  • Status changed from Feedback to Closed

#3 Updated by Donovan Cameron over 11 years ago

Giovanni Manghi wrote:

I don't think it is enough to install gdal-filegdb and I don't think is qgis fault. AFAIK it is needed to have a copy of gdal compiled with file geodatabase support, and you can do just by obtaining your own copy of the esri sdk

http://resources.arcgis.com/content/geodatabases/10.0/file-gdb-api

For instance I have an Ubuntu VM where I compiled GDAL with the fgdb support and I can open and edit with no problems your vector. See attached image.

I believe this should be closed.

Doing it on Ubuntu with a GDAL compiled from source would possibly give different results than my machine (Windows 7) and on Windows you don't need to compile gdal with FGDB support, you just install GDAL from the osgeo4w installer (already compiled) and select the gdal-filegdb driver as well.

Have you tried it on Windows 7 when QGIS and the gdal-filegdb driver are installed from the osgeo4w installer?

Selecting the gdal-filegdb is suppose to bring in the required FileGDB API .dll (because ESRI says it can be distributed to end users) and I did grab the vs2010 dlls (because the vs2008 ones don't work) just in case and put those in my osgeo4w bin folder (it asked me to replace the existing FileGDB dll from the osgeo4w installer).

Same problem though, I can add and view a FileGDB, but cannot edit it at all.

I've checked to make sure that even the file system permissions are correct. My user is both the owner and has read/write/full-control privileges.

The office here has several other Windows PCs with QGIS installed using this method and they all have the same issue:
  1. Run osgeo4w installer and install packages: qgis, gdal-filegdb
  2. Open QGIS, add a FileGDB
  3. No editing option, still greyed out

#4 Updated by Donovan Cameron over 11 years ago

@Jürgen Fischer

That revision1 you posted, is that a fix for this bug?
If so, will that show up in the osgeo4w installer later on? Or should I request that it be included for an update to the osgeo4w maintainers?

[1] https://issues.qgis.org/projects/quantum-gis/repository/revisions/808547e293da39b0977dbb162765314df70c3c65

#5 Updated by Jürgen Fischer over 11 years ago

donovan cameron wrote:

That revision you posted, is that a fix for this bug?

yes.

If so, will that show up in the osgeo4w installer later on?

sure.

#6 Updated by Donovan Cameron over 11 years ago

Jürgen Fischer wrote:

donovan cameron wrote:

That revision you posted, is that a fix for this bug?

yes.

If so, will that show up in the osgeo4w installer later on?

sure.

Thanks Jürgen,

I've posted an enhancement request for the osgeo4w package maintainers OSGeo4W #346

#7 Updated by Jürgen Fischer over 11 years ago

Donovan Cameron wrote:

I've posted an enhancement request for the osgeo4w package maintainers OSGeo4W #346

no need to.

#8 Updated by Mike MacRae over 11 years ago

I have installed QGIS Lisboa 1.8.0 using OSGEO4W installer. I've gone through the advanced installation to install QGIS and the FileGDB API. I've opened QGIS and added the feature class which works fine. All the editing tools are greyed as indicated above. I tried to find the qgisapp.cpp file, but it doesn't seem to exist. The installation directory exists (C:\\OSGeo4W\\usr\\src) but it is completely empty. How do I fix this so that I can edit File gdb feature classes.

Thanks,
Mike

#9 Updated by Giovanni Manghi over 11 years ago

Mike MacRae wrote:

I have installed QGIS Lisboa 1.8.0 using OSGEO4W installer. I've gone through the advanced installation to install QGIS and the FileGDB API. I've opened QGIS and added the feature class which works fine. All the editing tools are greyed as indicated above. I tried to find the qgisapp.cpp file, but it doesn't seem to exist. The installation directory exists (C:\\OSGeo4W\\usr\\src) but it is completely empty. How do I fix this so that I can edit File gdb feature classes.

the fix is available on qgis master, aka "qgis-dev" on osgeo4w.

#10 Updated by Mike MacRae over 11 years ago

Thank you Giovanni :) This works for me now. For those who were stuck as I was, look at section 1.3:

https://issues.qgis.org/projects/quantum-gis/wiki/Download

"Nightly builds of the Master are also available through the OSGeo4W Installer for testing purposes. Use Advanced Install to install the qgis-dev package from the Desktop section."

Cheers,
Mike

#11 Updated by Mike MacRae over 11 years ago

Sorry to be so persistent, but this only sort of works. It appears that I can only create new features within an file geodatabase feature class, but I cannot edit existing features. Is this not supposed to work? See attached image.

Thanks,
Mike

#12 Updated by Giovanni Manghi over 11 years ago

Mike MacRae wrote:

Sorry to be so persistent, but this only sort of works. It appears that I can only create new features within an file geodatabase feature class, but I cannot edit existing features. Is this not supposed to work? See attached image.

Thanks,
Mike

if the layer is not selected in the TOC that tools are not active.

#13 Updated by Mike MacRae over 11 years ago

Unfortunately, this is not the behavior I am experiencing. In the attached image, I have only one ArcGIS 10.1 file geodatabase feature class layer in my map. It is selected and active and yet, the only editing I can do is to create a new feature using the active 'Add Feature' tool, but I still cannot edit existing features using the 'Move Features', 'Node Tools', 'Delete Selected Features' and the 'Cut, Copy and Paste Features' Tools. See the greyed out tools in the image I've attached. I tested on an version 10.0 File Geodatabase feature class with the same results. I tested to see if I can get the tools to be active by using an ESRI Shapefile and this works. Again, maybe I am doing something wrong on my end, but I can't seem to figure out what it is.

Thanks,
Mike

#14 Updated by Giovanni Manghi over 11 years ago

Mike MacRae wrote:

Unfortunately, this is not the behavior I am experiencing. In the attached image, I have only one ArcGIS 10.1 file geodatabase feature class layer in my map. It is selected and active and yet, the only editing I can do is to create a new feature using the active 'Add Feature' tool, but I still cannot edit existing features using the 'Move Features', 'Node Tools', 'Delete Selected Features' and the 'Cut, Copy and Paste Features' Tools. See the greyed out tools in the image I've attached. I tested on an version 10.0 File Geodatabase feature class with the same results. I tested to see if I can get the tools to be active by using an ESRI Shapefile and this works. Again, maybe I am doing something wrong on my end, but I can't seem to figure out what it is.

Thanks,
Mike

can you attached sample data? if confirmed we will reopen the ticket.

#15 Updated by Mike MacRae over 11 years ago

Sure Giovanni,

I've attached 2 datasets. One is ArcGIS 10.0 File Geodatabase, the second is a 10.1. Both were created in ArcCatalogue.

In the ArcGIS 10.0 geodatabase, I have:

- a line feature class projected with ESRI's out-of-the-box NAD83 UTM Zone 12 projected coordinate system
- a line feature class projected with ESRI's out-of-the-box NAD 1927 geographic coordinate system

In the ArcGIS 10.1 geodatabase, I have:

- a line feature class projected with ESRI's out-of-the-box NAD83 UTM Zone 12 projected coordinate system

None of the feature classes have M or Z values.

I started an edit session in QGIS and created a few lines in each feature class which is successful, but as per my comment above, I cannot modify/edit any of the features.

I am running 1.9.0 Lisboa compiled against GDAL/OGR 1.9.2 (See attached image of QGIS 'About' dialogue) I'm running a Windows 7 64 bit machine. If there's anything else you could use for information, I can provide.

Thanks,
Mike

#16 Updated by Giovanni Manghi over 11 years ago

Mike MacRae wrote:

Sure Giovanni,

I've attached 2 datasets. One is ArcGIS 10.0 File Geodatabase, the second is a 10.1. Both were created in ArcCatalogue.

In the ArcGIS 10.0 geodatabase, I have:

- a line feature class projected with ESRI's out-of-the-box NAD83 UTM Zone 12 projected coordinate system
- a line feature class projected with ESRI's out-of-the-box NAD 1927 geographic coordinate system

In the ArcGIS 10.1 geodatabase, I have:

- a line feature class projected with ESRI's out-of-the-box NAD83 UTM Zone 12 projected coordinate system

None of the feature classes have M or Z values.

I started an edit session in QGIS and created a few lines in each feature class which is successful, but as per my comment above, I cannot modify/edit any of the features.

I am running 1.9.0 Lisboa compiled against GDAL/OGR 1.9.2 (See attached image of QGIS 'About' dialogue) I'm running a Windows 7 64 bit machine. If there's anything else you could use for information, I can provide.

Thanks,
Mike

I have a Ubuntu VM with qgis compiled against a gdal version with file geodatabase support added. Your AG10 geodatabase edits without any issue (see screenshot). With the AG10.1 file geodatabase I get

/home/qgis/Desktop/QGIS_TEST_101.gdb/a00000001.gdbindexes is not a valid or recognized data source

but this is for sure a esri issue -> the free (gratis) API to edit file geodatabases is probably just for AG10.

#17 Updated by Mike MacRae about 11 years ago

Thanks Giovanni,

So for what I am reading from your post, you didn't text on a Windows 7 64 bit machine? I should assume this won't work on my machine unless I run the Ubuntu VM? Maybe I am installing OSGEO4W wrong? Is there a procedure somewhere on how to properly install to get this to work on my pc? The only one I've found is this, which I have followed through a few times now with the same result. Greyed out editing tools. I can only add a file fdb and create new features, but I am unable to edit existing features:

http://gis.stackexchange.com/questions/26285/how-to-get-gdb-esri-file-geodatabase-support-in-quantum-gis-osgeo4w-qgis

I also found this thread, but the steps provided in the answer do not work either. I opened the properties for the layer, navigated to the 'Fields' tab but the 'Toggle Edit Mode' tool is greyed out in this dialogue.

http://gis.stackexchange.com/questions/35369/is-it-possible-to-edit-layers-from-a-fgdb-file-geodatabse-in-qgis

It just seems that the editing tools need to be activated somehow, but how I am not sure.

Thanks,
Mike

#18 Updated by Giovanni Manghi about 11 years ago

as far as I know and understand, and I may be wrong, you can only edit a file geodatabase if you a copy of gdal compiled with the API provided by ESRI

http://resources.arcgis.com/content/geodatabases/10.0/file-gdb-api

to get one copy you need to register, login and download, and compile. On Linux is more or less straightforward, and Windows I have no idea.

This API is probably not redistributable, so is the reason because it is not shipped out of the box with qgis/osgeo4w. See also

http://trac.osgeo.org/gdal/wiki/FileGDB

Mike MacRae wrote:

Thanks Giovanni,

So for what I am reading from your post, you didn't text on a Windows 7 64 bit machine? I should assume this won't work on my machine unless I run the Ubuntu VM? Maybe I am installing OSGEO4W wrong? Is there a procedure somewhere on how to properly install to get this to work on my pc? The only one I've found is this, which I have followed through a few times now with the same result. Greyed out editing tools. I can only add a file fdb and create new features, but I am unable to edit existing features:

http://gis.stackexchange.com/questions/26285/how-to-get-gdb-esri-file-geodatabase-support-in-quantum-gis-osgeo4w-qgis

I also found this thread, but the steps provided in the answer do not work either. I opened the properties for the layer, navigated to the 'Fields' tab but the 'Toggle Edit Mode' tool is greyed out in this dialogue.

http://gis.stackexchange.com/questions/35369/is-it-possible-to-edit-layers-from-a-fgdb-file-geodatabse-in-qgis

It just seems that the editing tools need to be activated somehow, but how I am not sure.

Thanks,
Mike

#19 Updated by Jürgen Fischer about 11 years ago

Giovanni Manghi wrote:

This API is probably not redistributable, so is the reason because it is not shipped out of the box with qgis/osgeo4w.

The GDAL/OGR plugin and the necessary DLL from the ESRI SDK is distributed with OSGeo4W.

Apparently OGR only supports adding features to the BC.gdb, but not editing existing features.

#20 Updated by Mike MacRae about 11 years ago

I've received a response from ESRI. I've explained my issue as I have above. The response i received was:

"Editing (Update) is supported. See the edit sample. When you say it doesn't let you edit can you be more descriptive. Are you using C++ or C#. What compiler? What OS? Can you send sample code?"

I would like to facilitate a solution to this issue with some help, but I am not a C# or C++ developer.

I know this:

Installation file used is OSGEO4W compiled against GDAL/OGR 1.9.2
OS is Windows 7 64 bit

I'm not sure if the source code of the API in OSGEO4W is in C++ or C# or where I can find the source code. if someone can help me with this, then maybe I can provide some solutions on how to get this to work in QGIS.

thanks,
Mike

#21 Updated by Jürgen Fischer about 11 years ago

Mike MacRae wrote:

I'm not sure if the source code of the API in OSGEO4W is in C++ or C# or where I can find the source code.

Which API are you talking about? The FileGDB SDK API from ESRI? AFAIK they don't distribute any source code for that.
QGIS uses OGR to access FileGDB and that in turn uses the FileGDB SDK.

For QGIS a FileGDB layer is just an OGR layer as any other (eg. a shape file) and it just queries it via OGR_L_TestCapability, which returns FALSE for RandomWrite of the FileGDB layer and therefore QGIS disables some modification functions.

Also available in: Atom PDF