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  >  ENVIAgCalculateAndRasterizeZoneMetricsTask

ENVIAgCalculateAndRasterizeZoneMetricsTask

ENVIAgCalculateAndRasterizeZoneMetricsTask

This task calculates statistics from a single-band raster and an associated ENVIAgZones object. It creates a classification raster showing the relative values of zones or a greyscale raster showing actual statistical values of zones.

ENVIAgCalculateAndRasterizeZoneMetricsTask is a metatask that automatically runs the following tasks:

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.
  • Runs ENVIAgCreateZonesTask to create the zones.
  • Runs ENVIAgCalculateAndRasterizeZoneMetricsTask and displays a greyscale image of mean elevation values for each zone.
; Start the application
e = ENVI()
 
; 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 and rasterize zone metrics
Task = ENVITask('AgCalculateAndRasterizeZoneMetrics')
Task.INPUT_RASTER = Raster
Task.INPUT_ZONES = zonesTask.OUTPUT_ZONES
Task.OUTPUT_RASTER_URI = e.GetTemporaryFilename()
Task.Execute
 
; Get the collection of objects currently in the Data Manager
DataColl = e.Data
 
; Add the output to the data collection
DataColl.Add, Task.OUTPUT_RASTER
 
; Display the result
View = e.GetView()
Layer = View.CreateLayer(Task.OUTPUT_RASTER)

Syntax


Result = ENVITask('AgCalculateAndRasterizeZoneMetrics')

Input properties (Set, Get): CLASSIFICATION, INPUT_RASTER, INPUT_ZONES, OUTPUT_METRIC, OUTPUT_RASTER_URI, OUTPUT_ZONES_URI

Output properties (Get only): OUTPUT_RASTER, 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:

CLASSIFICATION (optional)

Set this property to true to create a classification image showing the relative pattern of a selected zone metric. The default value is false, which will create a greyscale image with the actual values of a zone metric.

INPUT_RASTER (required)

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

INPUT_ZONES (required)

Specify an input ENVIAgZones object.

OUTPUT_METRIC (required)

Specify one of the following strings, indicating the metric that the output raster will be based on.

  • Zone Minimum
  • Zone Maximum
  • Zone Mean (default)
  • Zone Standard Deviation

OUTPUT_RASTER

This is a reference to the output zones classification raster or greyscale raster.

OUTPUT_RASTER_URI (optional)

Specify a string with the fully qualified filename and path of the output raster. If you do not specify this property, the output raster is only temporary. Once the raster has no remaining references, ENVI deletes the temporary file.

OUTPUT_ZONES

This is a reference to the output zones data.

OUTPUT_ZONES_URI (optional)

Specify a string with the fully qualified filename and path for the output .sav file that will contain the zones data.

Version History


1.1

Introduced

See Also


ENVIAgZones, ENVIAgCreateZonesTask, ENVIAgCalculateAndRasterizeZoneMetricsWithSpectralIndexTask, ENVIAgCalculateZoneMetricsTask, ENVIAgRasterizeZonesTask, ENVIAgConvertZonesToShapefileTask



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