This task converts an ENVIAgCrops object to a shapefile.
This object is part of ENVI Crop Science, which requires a separate license and installation.
Example
This example performs the following steps:
- Opens an RGB image of emerging cotton plants, captured by an unmanned aerial vehicle (UAV). Image courtesy of Drone Global Network.
- Runs ENVIAgCropCount on the green band of the image, to count the crops and to create an ENVIAgCrops object.
- Creates a shapefile from the ENVIAgCrops object.
- Displays the shapefile on top of the image.
Note: The resulting crop count includes several outliers. You can use AgFindRowsAndRemoveOutliers Task to remove these.
e = ENVI(/HEADLESS)
File = Filepath('Cotton.dat', $
SUBDIR=['data','crop_science'], $
ROOT_DIR=e.Root_Dir)
Raster = e.OpenRaster(File)
subset = ENVISubsetRaster(Raster, BANDS=[1])
countTask = ENVITask('AgCropCount')
countTask.INPUT_RASTER = subset
countTask.INCLUDE_EDGES ='true'
countTask.MINIMUM_CROP_DIAMETER = 9
countTask.MAXIMUM_CROP_DIAMETER = 12
countTask.NUMBER_OF_INCREMENTS= 12
countTask.GAUSSIAN_FACTOR = 0.8
countTask.PERCENT_OVERLAP = 60
countTask.INTENSITY_THRESHOLD = 0.81
countTask.Execute
outCrops = countTask.OUTPUT_CROPS
shapeTask = ENVITask('AgCropsToShapefile')
shapeTask.INPUT_CROPS = outCrops
shapeTask.Execute
Syntax
Result = ENVITask('AgCropsToShapefile')
Input parameters (Set, Get): INPUT_CROPS, OUTPUT_VECTOR_URI
Output parameters (Get only):OUTPUT_VECTOR
Parameters marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Parameters marked as "Get" are those whose values you can retrieve but not set.
Input Parameters
INPUT_CROPS (required)
Specify an input ENVIAgCrops object.
OUTPUT_VECTOR_URI (optional)
Specify a string with the fully qualified path and filename for OUTPUT_VECTOR.
Output Parameters
OUTPUT_VECTOR
This is a reference to the output vector.
Methods
Execute
Parameter
ParameterNames
Properties
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
Version History
Crop Science 1.0
|
Introduced |
See Also
ENVIAgCropsToShapefile, ENVIAgCrops, ENVIAgCropCount, AgCropCount Task