VectorRecordsToBoundingBox Task
This task creates a new polygon shapefile containing the bounding box of each input vector record.
Example
; Start the application
e = ENVI()
; Open an input raster
File = Filepath('qb_boulder_msi', ROOT_DIR=e.Root_Dir, $
SUBDIRECTORY=['data'])
Raster = e.OpenRaster(File)
; Open an input vector
VectorFile = Filepath('qb_boulder_msi_vectors.shp', $
ROOT_DIR=e.Root_Dir, SUBDIRECTORY=['data'])
Vector = e.OpenVector(VectorFile)
; Get the task from the catalog of ENVITasks
Task = ENVITask('VectorRecordsToBoundingBox')
; Select task inputs
Task.INPUT_VECTOR = Vector
Task.ORIENTED = 'true'
; Run the task
Task.Execute
; Add the output to the Data Manager
e.Data.Add, Task.OUTPUT_VECTOR
; Display the resulting bounding box
; over the raster layer
View = e.GetView()
Layer1 = View.CreateLayer(Raster)
Layer2 = View.CreateLayer(Vector)
Layer3 = View.CreateLayer(Task.OUTPUT_VECTOR)
Syntax
Result = ENVITask('VectorRecordsToBoundingBox')
Input parameters (Set, Get): INPUT_VECTOR, MAXIMUM_VALUE, MINIMUM_VALUE, ORIENTED, OUTPUT_VECTOR_URI, UNITS
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_VECTOR (required)
Specify an input polyline, polygon, or multi-point ENVIVector.
MAXIMUM_VALUE (optional)
Specify the maximum area (for polygons) or length (for polylines) to consider. Values greater than the maximum will be discarded in the output shapefile. The units depend on the coordinate system of the input vector. The units depend on the coordinate system of the input vector; however, you can override these units by specifying the UNITS parameter.
MINIMUM_VALUE (optional)
Specify the minimum area (for polygons) or length (for polylines) to consider. Values less than the minimum will be discarded in the output shapefile. The units depend on the coordinate system of the input vector. The units depend on the coordinate system of the input vector; however, you can override these units by specifying the UNITS parameter.
ORIENTED (required)
Set this parameter to true to orient the output bounding boxes to match the rotation of the input records, thus producing the smallest area possible.
OUTPUT_VECTOR_URI (optional)
Specify a string with the fully qualified path and filename for OUTPUT_VECTOR.
UNITS (optional)
Specify a string with the units of the minimum and maximum values. The choices are Meters, Kilometers, Feet, US Survey Feet, Yards, Miles, and Nautical Miles.
If you do not specify UNITS, be sure to specify the MINIMUM_VALUE and MAXIMUM_VALUE in the same units of the INPUT_VECTOR.
Output Parameters
OUTPUT_VECTOR
This is a reference to the output vector.
Methods
Properties
Version History
|
ENVI 5.6 |
Introduced |
|
ENVI 5.6.1 |
Added UNITS parameter |
See Also
ENVITask, ENVIVector, FilterVector Task, SmoothVector Task, VectorRecordsToCentroid Task, ReprojectVector Task