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


Harris Geospatial / Docs Center / ENVI API / Crop Science / ENVIAgRasterizeCropsTask

ENVIAgRasterizeCropsTask

ENVIAgRasterizeCropsTask

This task creates a classification raster from an ENVIAgCrops object. The Crops class consists of circle outlines at the crop locations.

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

Example


This example performs the following steps.

  1. Opens an orthophoto of a citrus orchard.
  2. Creates a spectral index raster to make the citrus trees bright against the background. A Modified Triangular Vegetation Index (MTVI) works well in this case.
  3. Tip: See the ENVISpectralIndexRaster topic in ENVI Help for a full list of spectral indices. You can run ENVIQuerySpectralIndicesTask to see what indices are available for your particular image.

  4. Runs ENVIAgCropCount to count the trees from the MTVI image and to create an ENVIAgCrops object.
  5. Creates a classification raster showing the locations of the trees.
; Start the application
e = ENVI()
 
; Open an input file
File = Filepath('CitrusOrthophoto.dat', $
  Subdir=['data','crop_science'], $
  Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
 
; Preprocess the image so that crops are bright
MTVIImage = ENVISpectralIndexRaster(Raster, 'MTVI')
 
; Count the crops and create an ENVIAgCrops object
outCrops = ENVIAgCropCount(MTVIImage, 2.0, 5.0, $
  GAUSSIAN_FACTOR = 0, $
  /INCLUDE_EDGES, $
  INTENSITY_THRESHOLD = 0.8, $
  NUMBER_OF_INCREMENTS = 4, $
  PERCENT_OVERLAP = 100.0)
 
; Get the rasterize task from the catalog of ENVITasks
Task = ENVITask('AgRasterizeCrops')
 
; Define the task inputs
Task.CROPS = outCrops
Task.FILLED = 'true'
 
; Define the task 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)
View.Zoom, /FULL_EXTENT

Syntax


Result = ENVITask('AgRasterizeCrops')

Input properties (Set, Get): CLASSIFICATION, CROPS, FILLED, OUTPUT_METRIC, OUTPUT_RASTER_URI

Output properties (Get only): DESCRIPTION, NAME, OUTPUT_RASTER

Properties marked as "Set" are those that you can set to specific values. 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


CLASSIFICATION (optional)

Set this property to true to create a classification raster for the relative metric. This property is ignored if you set OUTPUT_METRIC to Count.

CROPS (required)

Specify an input ENVIAgCrops object.

DESCRIPTION

This property describes the task.

FILLED (optional)

Set this property to true to create filled circles. The default is false.

NAME

This property contains the name of the task.

OUTPUT_METRIC (optional)

Specify one of the following strings indicating the metric or count that the output raster will be based on. The default is Count.

  • Count
  • Crop Min
  • Crop Max
  • Crop Mean
  • Crop Stddev

OUTPUT_RASTER

This is a reference to the output crops 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.

Version History


1.0

Introduced

See Also


ENVIAgCropCount, ENVIAgCropCountTask, ENVIAgCountAndRasterizeCropsTask, ENVIAgCalculateCropMetrics, ENVIAgCalculateCropMetricsTask



© 2017 Exelis Visual Information Solutions, Inc. |  Legal
My Account    |    Buy    |    Contact Us