PROBLEM

Extract grid by graphic sample script gives errors

Last Published: April 25, 2020

Description

The Spatial Analyst sample script, grextrct.ave, gives incorrect results.

Cause

The extent of the output grid is not properly set to that of the shape.

Solution or Workaround

Change the following lines of code:

  1. From:

    Code:
    ae = theView.GetExtension(AnalysisEnvironment)
    ae.SetExtent(#ANALYSISENV_VALUE, ashpext)
    ae.SetCellSize(#ANALYSISENV_VALUE, g.getcellsize)

  2. To:

    Code:
    grid.setanalysisextent(#GRID_ENVTYPE_VALUE,ashpext)
    grid.setanalysiscellsize(#GRID_ENVTYPE_VALUE,g.getcellsize)

Article ID:000004328

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic