0

I have a PostGIS database that uses the PG_Geometry stored in a shape field. This same database is a registered ArcGIS geodatabase. I am able to edit and create features in ArcGIS. I can connect, view and edit attribute data in QGIS, but when I try to create new features I get the error shown below. Ironically it seems that QGIS attempts to use ST_Geometry when writing the data even though the data are stored as PG_Geometry. I am looking for the setting in QGIS that will allow me to write the geometry data using PG_Geometry.

Could not commit changes to layer drp_occurrence

Errors: ERROR: 1 feature(s) not added.

Provider errors: PostGIS error while adding features: ERROR: column "shape" is of type geometry but expression is of type st_geometry LINE 1: ...atex","dgupdatey","catalognumbernumeric") VALUES (st_geomfro... ^ HINT: You will need to rewrite or cast the expression.

1 Answer 1

1

QGIS cannot use Esri's geometry format so the error you are seeing is caused by something else.

When you create a feature class in ArcGIS and specify that you want to use the PG_GEOMETRY option, ArcGIS registers the table as having a generic geometry type column. You can see this in the public.geometry_columns table PostGIS uses as a central registry of spatial tables.

You should change this to a specific geometry type, like POINT, LINESTRING, POLYGON, MULTILINESTRING or MULTIPOLYGON.

The naming of spatial types and functions are many times equal between PostGIS and Esri. The big difference is that Esri stuff in stored in the sde schema. PostGIS keeps these things in the public schema.

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.