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 / ENVIAgCreateAndRasterizeCropLocationGridTask

ENVIAgCreateAndRasterizeCropLocationGridTask

ENVIAgCreateAndRasterizeCropLocationGridTask

This task estimates the crop count from a raster and a grid derived from three input points, and it creates a classification raster with their locations. See the Create Crop Location Grid topic for more information on how this tool works.

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

Example


; 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)
 
; Define a spatial subset that encompasses
; the crops of interest while removing the edges
Subset = ENVISubsetRaster(Raster, SUB_RECT=[12,17,653,626])
 
; Get the task from the catalog of ENVITasks
Task = ENVITask('AgCreateAndRasterizeCropLocationGrid')
 
; Define inputs
Task.INPUT_RASTER = Subset
Task.POINT1 = [202.8, 613.4]
Task.POINT2 = [19.4, 611.3]
Task.POINT3 = [20.0, 306.4]
Task.SPACE1 = 12
Task.SPACE2 = 12
 
; Define outputs
Task.OUTPUT_CROPS_URI = e.GetTemporaryFilename('json')
Task.OUTPUT_RASTER_URI = e.GetTemporaryFilename()
 
; Run the task
Task.Execute
 
; Display the result
View = e.GetView()
Layer = View.CreateLayer(Subset)
Layer2 = View.CreateLayer(Task.OUTPUT_RASTER)

Syntax


Result = ENVITask('AgCreateAndRasterizeCropLocationGrid')

Input properties (Set, Get):CROP_DIAMETER, FIELD_ROI, FILLED, INPUT_RASTER, OUTPUT_CROPS_URI, OUTPUT_RASTER_URI, POINT1, POINT2, POINT3, SPACE1, SPACE2

Output properties (Get only):DESCRIPTION, NAME, OUTPUT_CROPS, OUTPUT_NCROPS, 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


CROP_DIAMETER (optional)

Specify the diameter of each crop in meters (or pixels if the input raster is not georeferenced).

DESCRIPTION

This property describes the task.

FIELD_ROI (optional)

Specify an ENVIROI that outlines a field of crops.

FILLED (optional)

Set this property to true to create filled circles in the output crops classification raster.

INPUT_RASTER (required)

Specify an input raster.

NAME

This property contains the name of the task.

OUTPUT_CROPS

This is a reference to the output ENVIAgCrops object.

OUTPUT_CROPS_URI (optional)

Specify a string with the fully-qualified path and filename for OUTPUT_CROPS.

OUTPUT_NCROPS

This is the number of crops counted.

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

POINT1 (required)

Specify an array with the x and y file locations for the center of a crop. This point should be in a vertical or horizontal position relative to point 2.

POINT2 (required)

Specify an array with the x and y file locations for the center of a crop. This is the connecting point between points 1 and 3.

POINT3 (required)

Specify an array with the x and y file locations for the center of a crop. This point should be in a vertical or horizontal position relative to point 2.

SPACE1 (required)

Specify the number of spaces between points 1 and 2.

SPACE2 (required)

Specify the number of spaces between points 2 and 3.

Version History


1.0.1

Introduced

See Also


ENVIAgCropCountTask



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