4

I have an Esri File GDB with relationship classes. I would like to import this GDB in PostgreSQL or MSSQL to enable multi-user edit through QGIS (dufour) tool.

What are the steps/procedures to follow?

Or is there any other way to achieve GDB multi-user edit without ArcSDE and Arc tools?

4 Answers 4

5

Do you have the ESRI FGDB API set up so that ogr can access file geodatabases? If so, you can open the file geodatabase layers in QGIS 2.0 and use the database manager to import each layer into a PostGIS database.

If you don't have the API you can't get to the data in the file geodatabase. It's easy to install on windows, just use the OSGeo4W installer. It is under the Libs section and is called gdal-filegdb.

If you're a Mac user see this question for help.

If you're using Linux it varies from distribution to distribution on how you go about getting the API installed.

2
  • gdal-filegdb is useful to work with file GDBs. But i like to enable the gdb for multi-user editing.
    – vasudevanp
    Jan 17, 2014 at 16:01
  • 2
    Even in the ESRI environment File geodatabases are single editor. For multiuser editing in PostGIS see this question: gis.stackexchange.com/questions/66784/… Jan 17, 2014 at 16:09
3

You cannot import the "relationship classes" because the ESRI FileGDB API can't read those unfortunately.

And the GDAL driver relies on the ESRI FileGDB API to get read/write functionality for a FileGDB.

But you can convert the FileGDB you have, only the feature classes and tables, to a PostgreSQL database with PostGIS.

The PostgreSQL database with the PostGIS extension allows you to store geometries with multi-user editing and access.

First, make sure your FileGDB is >= 10.0 because GDAL's ogr2ogr can't read from a FileGDB < 10.0. And you can't use any tools inside QGIS without GDAL having support for FileGDB formats. You can test this quickly by trying to load a FileGDB into QGIS - if it loads layers, it works, if not, then the version of GDAL that QGIS is running against doesn't support FileGDB - yet...

You should see it under the "Directory" type when adding a vector layer: loading an ESRI FileGDB into QGIS with the Add Vector Layer dialog

Second, configure and deploy a PostgreSQL/PostGIS database cluster/server to store all of this data.

Third, use ogr2ogr to translate the data from FileGDB to PostgreSQL. Inside QGIS there is also a number of options like right-clicking each layer from the FileGDB and doing a "Save as...", using the DBManager, SPIT Plugin (uses Shapefiles though).

Fourth, re-create your old relationship classes in the PostgreSQL database using the various SQL tools at your disposable - notably creating VIEWS from various types of JOINs. This is the part that can take some time depending on the type and amount of relationship classes your old FileGDB had.

You will definitely enjoy the fruits of your labour though and appreciate the multitude of skills you will acquire along the way (or just outsource). I didn't provide details of each step because they can change depending on the details of your source data. But this site as a whole should contain enough insight into each issue to get you started!

It will also be good to know that your data is now stored in a well documented Open SQL format that could set you up later on down the road to easily transfer that data to a different storage format.

3
  • Thanks for the detailed steps, i am going to try this, it gives me some good hope. By the way, does the QGIS attribute edit form supports "relationship" data? Example, when i create a feature, the attribute form should have facility to enter relationship data too.
    – vasudevanp
    Jan 17, 2014 at 16:41
  • 1
    @VasudevanPeriasamy That's a good question and I really don't want to answer it in the comments because it's a new question that you should post on this site. Editing attributes and controlling relationships (remember, you won't be using these anymore, but have VIEWS instead - the views are dynamic and update as the source data is modified) is done at both the QGIS level (building the forms) and PostgreSQL level (with CHECKs and CONSTRAINTs).
    – SaultDon
    Jan 17, 2014 at 16:56
  • Please find my new question gis.stackexchange.com/q/83402/7188
    – vasudevanp
    Jan 17, 2014 at 17:11
1

It's not clear if you want to use ESRI products. If you want to work in ArcMap you can use ST_LINKS for this. Otherwise QGIS & PostGIS.

1
  • Yes, I am trying to eliminate Esri products and like to use the open source products. It would be helpful if you point out the BEST way to get/import the file GDB in PostgreSQL.
    – vasudevanp
    Jan 17, 2014 at 14:43
1

I have followed @SaultDon & @HeyOverThere answers and imported FileGDB data to PostgreSql with relations successfully. Then i have used QGIS 2.1's Relations (a great feature) to handle the relationship forms/data in QGIS with multi-user editing.

Note: 2.1 is dev version, 2.2 will be the release

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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