PostGIS – Using PostGIS Geometry for ArcSDE Database Integration

arcgis-desktopenterprise-geodatabasepostgisqgis

I just enabled my PostgreSQL/PostGIS database with ArcSDE. Since I did this, when I copy and paste a dataset into my database via ArcCatalog, the dataset is not visible in QGIS.

This is because there is no geometry according to QGIS. I want to use ArcSDE database with all its benefits in ArcMap, but still be able to add this dataset in QGIS via a PostGIS connection.

How do I make sure that ArcGIS uploads the table with PostGIS geometry?

I almost have a solution by changing the ArcSDE table sde_dbtune to contain Default Geometry_Storage of PG_GEOMETRY, but if I upload a new dataset via ArcCatalog, the table is still not visible in QGIS.

It does work if I change the config.keyword to PG_GEOMETRY in Catalog (see image), but shouldnt it have to work on DEFAULTS too since I changed the settings?

enter image description here

I use PostgreSQL version 9.4, PostGIS 2.1.8 and ArcGIS 10.2.

Best Answer

The default geometry creation type for ArcGIS in PostgreSQL databases depends on the version of software and how it's installed.

On Amazon RDS instances, where it's not possible to add the sde.st_geometry type, the geodatabase enablement code is able to detect RDS is in use, and the default DBTUNE entry is automatically altered to:

       keyword: "DEFAULTS"
parameter_name: "GEOMETRY_STORAGE"
 config_string: "PG_GEOMETRY"

On other PostgreSQL enterprise geodatabase-enabled databases, the default on initial install is:

       keyword: "DEFAULTS"
parameter_name: "GEOMETRY_STORAGE"
 config_string: "ST_GEOMETRY"

ArcGIS 10.4 and higher can write to PostgreSQL 9.3 and higher without enabling an enterprise geodatabase, and therefore use PostGIS geometry as a default.

The sdedbtune command-line utility was used to edit DBTUNE keywords at ArcGIS 10.2 and earlier, but that tool was deprecated, and a pair of ArcPy toolbox tools were added at 10.3:

I've generally just used SQL to make a simple change to one keyword parameter (but you need to make sure the transaction has committed before you try using it).

Note that the environment you have listed -- ArcGIS 10.2.x with PG 9.4.x and PostGIS 2.1.x -- is not a supported configuration. PostgreSQL 9.4 support was added at ArcGIS 10.4 (though it would probably work at ArcGIS 10.3.x). Always search on "system requirements" from desktop.arcgis.com to research RDBMS compatibility before enabling a geodatabase.

Related Question