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

ENVIAgCreateZonesTask

ENVIAgCreateZonesTask

This task divides an input raster into management zones, based on the desired number of application categories that you specify. For example, you may decide to divide your field into three different categories, each having a different level of water or fertilizer application. The task further splits the application categories into zones, which are polygons that belong to the same application category but are spatially separated. The task creates a classification image, where the classes represent the zones, and the colors indicate the application categories they belong to. It also creates a zones output object that contains data for each individual zone.

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

Example


; 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)
 
; Get the task from the catalog of ENVITasks
Task = ENVITask('AgCreateZones')
 
; Define inputs
Task.INPUT_RASTER = Raster
Task.MINIMUM_AREA = 2023
Task.NUMBER_OF_APPLICATION_CATEGORIES = 5
 
; Define outputs
Task.OUTPUT_RASTER_URI = e.GetTemporaryFilename()
 
; Run the task
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(Raster)
Layer2 = View.CreateLayer(Task.OUTPUT_RASTER)

Syntax


Result = ENVITask('AgCreateZones')

Input properties (Set, Get): INPUT_RASTER, MAXIMUM_AREA, MINIMUM_AREA, NUMBER_OF_APPLICATION_CATEGORIES, OUTPUT_RASTER_URI, OUTPUT_ZONES_URI, PRIMARY_ANGLE

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

INPUT_RASTER (required)

Specify a single-band input raster.

MAXIMUM_AREA (optional)

Specify the maximum area of each zone. The area is measured in square meters if the input raster has a spatial reference. Otherwise, specify the number of square pixels for the area. The default value is 0, which means no splitting will occur.

MINIMUM_AREA (required)

Specify the minimum area of each zone. The area is measured in square meters if the input raster has a spatial reference. Otherwise, specify the number of square pixels for the area. The default value is 2000 square meters, or about half an acre.

NUMBER_OF_APPLICATION_CATEGORIES (required)

Specify the desired number of application categories. The default value is 3. In some cases, the actual number of application categories may be less than the specified number. This can happen, for example, when the specified minimum area results in all of the zones in an application category being merged into another application category.

OUTPUT_HOMOGENEITY_RATIO

This is a measure of how much more similar values in a class are to each other, versus values over the whole image. A value of 0 indicates no improvement, and a value of 1.0 indicates perfect improvement.

OUTPUT_NUMBER_OF_ZONES

This is the total number of zones created.

OUTPUT_RASTER

This is a reference to the output classification 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 ENVIAgZones object. In addition to the standard ENVIAgZone properties, the object will also contain the following attributes:

  • APPLICATION_CATEGORY_MAX: The maximum pixel value for each application category
  • APPLICATION_CATEGORY_MIN: The minimum pixel value for each application category
  • APPLICATION_CATEGORY_NAME: Strings with the name of each application category
  • AREA: The area in square meters of each zone
  • CAT_ID: Integer IDs of the application category corresponding to each zone, starting at 1. These IDs correspond to the application category id of the classification image.
  • CLASS_CLRS: The red/green/blue (RGB) color values for each zone. The name CLASS_CLRS is retained to be consistent with the zone classification raster.
  • CLASS_NAME: Strings with the name of each zone. The name CLASS_NAME is retained to be consistent with the zone classification raster.
  • HOMOGENEITY_RATIO: A measure of how much more similar values in a class are to each other, versus values over the whole image. A value of 0 indicates no improvement, and a value of 1.0 indicates perfect improvement.
  • NZONES: The number of zones
  • ZONE_ID: Integer IDs for each zone, starting at 1. These match the class values in the zone classification raster.

OUTPUT_ZONES_URI (optional)

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

PRIMARY_ANGLE (optional)

Specify the primary angle of the field in degrees clockwise from 0, where a value of 0 represents a horizontal alignment of the field. Zones will be split along this angle.

Version History


1.1

Introduced

See Also


ENVIAgZones, ENVIAgConvertZonesToShapefileTask, ENVIAgCalculateZoneMetricsTask, ENVIAgRasterizeZonesTask, ENVIAgCalculateAndRasterizeZoneMetricsTask



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