Select to view content in your preferred language

Calculating AREA and LENGTH Fields in SDO

1501
3
03-25-2011 08:45 AM
CMcDonald
Frequent Contributor
Hi folks,

I have my users setup with editable access using File GeoDatabases.  When they are finished I pull the data into Oracle which is setup in SDO Geometry in order to be open for our third parties.

The problem is that these reserved fields with there auto calculations are lost :(.  Is there a way I can get the values in?  Perhaps by creating a couple of new fields in the FGDB which will auto calculate also and I can then pull into Oracle.

Thanks 😉

Chris
0 Kudos
3 Replies
JakeSkinner
Esri Esteemed Contributor
I would recommend using a different storage type, such as ST_GEOMETRY, if you are not querying the data outside of ArcGIS or if no other application is dependent on this data type.  Or you can query the Area and Length through SQL*PLUS:

http://resources.arcgis.com/content/kbase?fa=articleShow&d=27329
0 Kudos
CMcDonald
Frequent Contributor
Unfortunately we have to store our data in SDO Geometry as we have a few third party apps that read our Oracle data directly.
0 Kudos
OvidioRivero
Emerging Contributor
I also prefer ST_GEOMETRY but if you must use SDO_Geometry you could write a trigger that fires on insert or update and populate the fields. 

You may want to look at these Oracle functions in the documentation:
SDO_GEOM.SDO_AREA
SDO_GEOM.SDO_LENGTH

http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28400/sdo_objgeom.htm#insertedID0

Also remember that if your data is versioned you have to write the trigger on the the ADDS table too or have some code that covers both the ADDS table and business table.

If you are loading data in Oracle and are not editing it you could just run an update statement once to populate the columns.



Ovidio
0 Kudos