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

ENVIAgRasterizeZonesTask

ENVIAgRasterizeZonesTask

This task creates a raster of zone metrics. The result is a classification image showing the relative pattern of a selected zone metric, or a greyscale image showing actual values of a selected zone metric. Use ENVIAgCalculateZoneMetricsTask to calculate zone metrics before running this task.

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 ENVIAgCalculateZoneMetricsTask to calculate the mean elevation values for each zone
  • Runs ENVIAgRasterizeZones and displays a greyscale image of the mean elevation values.
; 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 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
 
; Create a raster of elevation means for each zone
rasterizeTask = ENVITask('AgRasterizeZones')
rasterizeTask.ZONES = outZones
rasterizeTask.OUTPUT_RASTER_URI = e.GetTemporaryFilename()
rasterizeTask.Execute
 
; Get the collection of objects currently in the Data Manager
DataColl = e.Data
 
; Add the output to the data collection
DataColl.Add, rasterizeTask.OUTPUT_RASTER
 
; Display the result
View = e.GetView()
Layer = View.CreateLayer(rasterizeTask.OUTPUT_RASTER)

Syntax


Result = ENVITask('AgRasterizeZones')

Input properties (Set, Get): CLASSIFICATION, OUTPUT_METRIC, OUTPUT_RASTER_URI, ZONES

Output properties (Get only): OUTPUT_RASTER

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.

OUTPUT_METRIC (optional)

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

ZONES (required)

Specify an input ENVIAgZones object.

Version History


1.1

Introduced

See Also


ENVIAgZones, ENVIAgCreateZonesTask, ENVIAgCalculateAndRasterizeZoneMetricsTask, ENVIAgCalculateZoneMetricsTask, ENVIAgConvertZonesToShapefileTask



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