When I import a feature class into my ArcSDE enabled PostGIS/PostgreSQL database, it automatically adds the st_area and st_length columns into ArcGIS. The problem is that st_length gives 0 when the features are polygons. According to PostGIS documentation, this should be normal (http://postgis.net/docs/ST_Length.html). I have to use st_perimeter instead. How can I change this automatic function (of sde?) so that it creates a st_perimeter column instead of the st_length?

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

  • Note that this this is an unsupported configuration (PG 9.4 support wasn't added until ArcGIS 10.4)
    – Vince
    Dec 29, 2016 at 17:22
  • "feature dataset" is a collection of tables, so I've edited the question to say "feature class"
    – Vince
    Dec 29, 2016 at 17:36

1 Answer 1


This doesn't have anything to do with ArcSDE (which is just the connection and transfer protocols), and has everything to do with how ArcGIS Desktop creates layers.

The Esri st_geometry type supports st_length() on polygons, and Desktop adds st_area and st_length calls as a matter of habit (I always disable these values, since I nearly exclusively work with WGS84 coordinate systems). There doesn't seem to be a switch within Desktop to check if the layer is ST or PG geometry storage, and choose the appropriate PostGIS function (looks like a bug to me).

You can explicitly add the st_area(geomcol) and st_perimeter(geomcol) functions to a Query Layer at layer creation or by editing the query definition (though if the coordinate system is geographic and the PG type geometry, casting to geography would be necessary, e.g.st_area(geomcol::geography)). You might also be able to specify "st_perimeter(geomcol)" in the column list from Python via ArcPy at map layer creation (haven't tried it, but it may work). I don't know of any way to alter the ArcGIS Desktop default column selection process.

  • Thanks for your answer. When you say you disable these values, do you mean you turn off the field in the layer? Or is there an option to actually be able to disable the whole calculation of st_area and st_length?
    – user30058
    Dec 30, 2016 at 9:01
  • There is no global setting, I just remove the area/length fields whereever I encounter them, by GUI or Python. Please do not add thanks in comments; the Help Center has guidance on this.
    – Vince
    Dec 30, 2016 at 12:17

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.