ENVIAgCropsToShapefileTask
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 ENVIAgFindRowsAndRemoveOutliersTask 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 properties (Set, Get): INPUT_CROPS, OUTPUT_VECTOR_URI
Output properties (Get only):OUTPUT_VECTOR
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_CROPS (required)
Specify an input ENVIAgCrops object.
OUTPUT_VECTOR
This is a reference to the output vector.
OUTPUT_VECTOR_URI (optional)
Specify a string with the fully qualified path and filename for the output ENVIVector.
Version History
See Also
ENVIAgCropsToShapefile, ENVIAgCrops, ENVIAgCropCount, ENVIAgCropCountTask