Select to view content in your preferred language

Can Arcade get the value of SHAPE_Length in SQL Server?

758
3
07-07-2022 03:09 PM
Labels (1)
LorenMueller
Regular Contributor

I am trying to create an Attribute Rule that on record update in a line feature class that grabs the value in Shape_Length and copies it into another field. But in the Arcade text editor when choosing the Shape_Length field, it populates the script with $feature['Shape.STLength()'], the underlying method that populates that field in the db.  Well, when the system tries to evaluate the rule upon record update, it errors out saying that it can't find the field [Shape.STLength()]. Well yeah, that is not a field, it is an ST geom method.  How does one get the current value in Shape_Length without calling the underlying ST geom method? The Length() method leaves me a bit nervous because of the caveat of changing the results based on the scale of the map!? Yikes. And the projection I am using is NAD 83, so I can't use the LengthGeodetic() method.  Any ideas greatly appreciated.

(Esri 10.9.1, Pro 2.9.3)

 

0 Kudos
3 Replies
Bud
by
Esteemed Contributor

Side note for anyone who’s interested:

Arcade automatically pre-densifies true curves. So that affects the Arcade length too (Length($feature))…the Arcade pre-densified length will be different than the real length.

Whereas the Shape length ($feature.shape_length) doesn’t get pre-densified, at least not in SDE.ST_GEOMETRY in Oracle.

https://community.esri.com/t5/arcgis-pro-ideas/hascurve-arcade-geometry-property/idc-p/1149449/highl...

Bud_0-1657294981109.png

 

0 Kudos
Bud
by
Esteemed Contributor

If you don't end up getting an answer here, I wonder if it would be worthwhile posting in a different community, such as the Attribute Rules Community.

LorenMueller
Regular Contributor

Good idea @Bud. Thank you.