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 requires a separate license for the ENVI Crop Science Module; contact your sales representative for more information.

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
 
; 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): 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:

AddParameter

Execute

Parameter

ParameterNames

RemoveParameter

Properties


This task inherits the following properties from ENVITask:

COMMUTE_ON_DOWNSAMPLE

COMMUTE_ON_SUBSET

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

This task also contains the following properties:

CROP_DIAMETER (optional)

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

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.

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 associated OUTPUT_RASTER. If you do not specify this property, or set it to an exclamation symbol (!), a temporary file will be created.

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


Crop Science 1.0.1

Introduced

See Also


AgCropCount Task