English

How To: Clip a grid or lattice

Procedure

Summary:

Grids can be clipped to a rectangular window or to an irregular shape. The following methods will point you to the correct commands. Method 1 only requires an ArcInfo licsense, Methods 2-4 require a GRID license, and Method 5 requires a TIN license.

Procedure:

Method 1: Use the GRIDCLIP command from the Arc prompt to clip a grid with a rectangular box.

Example:
Arc: GRIDCLIP mygrid clipgrid 127 4225 389 5324
Method 2: Enter the GRID module and use the SETWINDOW command to define the area to be clipped out. Then use the map algebra statement <outgrid> = <ingrid>. A copy of the input grid is made for just the area given with SETWINDOW.

Example:
Grid: SETWINDOW 127 4225 389 5324
Grid: clipgrid = mygrid
Method 3: To clip with an irregular shape, a mask grid must first be created. This grid must have a value of NODATA for cells that are outside the clipping area. SETMASK to the mask grid and SETWINDOW to the desired area. The statement <outgrid> = <ingrid> will make a copy of just the clipped area. The output will be of the area set with SETWINDOW and only cells in the SETMASK that have data will have data on the output.

Example:
Grid: SETWINDOW 127 4225 389 5324
Grid: SETMASK bndgrid
Grid: clipgrid = mygrid
Method 4: The selection functions (SELECTPOLYGON, SELECTBOX, etc.) in GRID will also do clipping. These functions will create an output grid of the same extent as the input grid but cells inside or outside (depending on which option is selected) the selected area will be converted to NODATA. There is more than one usage for each command. Check the command reference of each command for optional usages.

Example:
Grid: clipgrid = SELECTPOLYGON(mygrid,bndpoly,INSIDE)

Method 5: LATTICECLIP (TIN) command may be used to clip a grid with a polygon coverage.

Example:
Arc: LATTICECLIP mygrid bndpoly MINIMUM