How To: Find coordinates of a cell with maximum value in a floating point grid
GRID's DOCELL statement allows you to find the coordinates of the maximum value in a floating point grid.
Run this aml from the GRID prompt:
Code: /* USAGE: &RUN XYOFMAX.AML <input_grid> &args ingrd &describe %ingrd% z1 = scalar(%grd$zmin%) docell if (%ingrd% > z1) begin z1 := %ingrd% xmap := scalar($$xmap) ymap := scalar($$ymap) end end &ty [show scalar xmap] &ty [show scalar ymap] &return
Note: This is not an ESRI supported aml. Use at your own risk. Please make a backup of your data before running this aml and carefully check the output. This aml does no error checking and it is meant only as a guide to developing an aml specific to your data inputs and desired outputs.
There is no provision within this methodology to identify multiple occurrences of the maximum value.