Hello! I need a little bit of help!
I have to extract from a polygon feature class the YMax coordinate value and its corresponding X value ( which is not necessary equal to XMax). I need them in two fields in attribute table "YMax" and "X".
I tried with field calculator for YMax, it worked, but i have problems with its pair, X coordinate.
Thank you in advance!
Field Calculator, switch to Arcade. Edit the last line to return the X or Y coordinate.
function sort_by_y (p1, p2) {
return p1.Y < p2.Y
}
var vertices = Geometry($feature).rings[0]
var v_YMax = First(Sort(vertices, sort_by_y))
return v_YMax.X
You can get many geometry attributes directly for a whole featureclass using this tool
Calculate Geometry Attributes (Data Management)—ArcGIS Pro | Documentation
these include extent parameters amongst other things
Yeah, getting YMax is easy. Would also be a one-liner with Arcade/Python. But Calculate Geometry Attributes won't give you the X coordinate of the northern-most vertex.