HOW TO

Find coordinates of a cell with maximum value in a floating point grid

Last Published: April 25, 2020

Summary

GRID's DOCELL statement allows you to find the coordinates of the maximum value in a floating point grid.

Procedure



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.

Article ID:000002103

Software:
  • ArcMap 8 x
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic