English

How To: Create grid with coordinates of centroids as the values

Summary

Steps to create grids whose values are the x and y coordinates of the cell centroids defined by the $$XMAP and $$YMAP variables of GRID. A GRID license is necessary.

Procedure

  1. Use SETWINDOW and SETCELL to match the output grids' size and resolution with those of the input grid.

    Code:
    Grid: SETWINDOW in_grd
    Grid: SETCELL in_grd


  2. Use $$XMAP and $$YMAP to create two grids, one recording the X locations of the cell centroids, the other the Y locations.

    Code:
    Grid: elevx = $$XMAP
    Grid: elevy = $$YMAP