Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


  >  Docs Center  >  ENVI API  >  Crop Science  >  ENVIAgCalculateZoneMetricsTask

ENVIAgCalculateZoneMetricsTask

ENVIAgCalculateZoneMetricsTask

This task calculates statistics on individual zones contained in an ENVIAgZones object.

This task is part of ENVI Crop Science, which requires a separate license and installation.

Example


This example uses a DEM as the basis for splitting a field into five management zones. The example uses ENVIAgCreateZonesTask to create the zones, then it calculates and prints metrics for each zone.

; Start the application
e = ENVI(/HEADLESS)
 
; Open a DEM file
File = Filepath('FieldDEM.dat', $
  Subdir=['data','crop_science'], $
  Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
 
; Create a zones object
zonesTask = ENVITask('AgCreateZones')
zonesTask.INPUT_RASTER = Raster
zonesTask.MINIMUM_AREA = 2023
zonesTask.NUMBER_OF_APPLICATION_CATEGORIES = 5
zonesTask.OUTPUT_RASTER_URI = e.GetTemporaryFilename()
zonesTask.Execute
 
; Calculate zone metrics
metricsTask = ENVITask('AgCalculateZoneMetrics')
metricsTask.INPUT_RASTER = Raster
metricsTask.INPUT_ZONES = zonesTask.OUTPUT_ZONES
metricsTask.OUTPUT_ZONES_URI = e.GetTemporaryFilename('sav')
metricsTask.Execute
outZones = metricsTask.OUTPUT_ZONES
 
; Print the properties of the output zones object
Print, outZones

Syntax


Result = ENVITask('AgCalculateZoneMetrics')

Input properties (Set, Get): INPUT_RASTER, INPUT_ZONES, OUTPUT_ZONES_URI

Output properties (Get only): OUTPUT_ZONES

Properties marked as "Init" are applied only during the initial creation of the object. Properties marked as "Set" are those that you can set to specific values after the object has been created. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.

Methods


This task inherits the following methods from ENVITask. See the ENVITask topic in ENVI Help.

  • AddParameter
  • Execute
  • Parameter
  • ParameterNames
  • RemoveParameters

Properties


This task inherits the following properties from ENVITask:

COMMUTE_ON_DOWNSAMPLE

COMMUTE_ON_SUBSET

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

See the ENVITask topic in ENVI Help for details.

This task also contains the following properties:

INPUT_RASTER (required)

Specify a single-band raster from which zone metrics will be computed.

INPUT_ZONES (required)

Specify an input ENVIAgZones object.

OUTPUT_ZONES

This is a reference to the output ENVIAgZones object. In addition to the standard ENVIAgZone properties, the output object will contain the following attributes:

  • SOURCE_RASTER_NCOLUMNS: The number of columns in the source raster
  • SOURCE_RASTER_NROWS: The number of rows in the source raster
  • SOURCE_RASTER_SPATIALREF: The spatial reference of the source raster
  • ZONE_MAX: The maximum pixel value for each zone
  • ZONE_MEAN: The mean pixel value for each zone
  • ZONE_MIN: The minimum pixel value for each zone
  • ZONE_STDEV: The standard deviation pixel value for each zone

OUTPUT_ZONES_URI (optional)

Specify a string with the fully qualified filename and path of the output zones.

Version History


1.1

Introduced

See Also


ENVIAgZones, ENVIAgCreateZonesTask, ENVIAgCalculateAndRasterizeZoneMetricsTask, ENVIAgRasterizeZonesTask, ENVIAgConvertZonesToShapefileTask



© 2018 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us