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 properties (Set, Get): INPUT_VECTOR, MAXIMUM_VALUE, MINIMUM_VALUE, ORIENTED, OUTPUT_VECTOR_URI, UNITS

Output properties (Get only): OUTPUT_VECTOR

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:

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 property.

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 property.

ORIENTED (required)

Set this property to true to orient the output bounding boxes to match the rotation of the input records, thus producing the smallest area possible.

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

Version History


ENVI 5.6

Introduced

ENVI 5.6.1

Added UNITS property

API Version


4.2

See Also


ENVITask, ENVIVector, FilterVector Task, SmoothVector Task, VectorRecordsToCentroid Task, ReprojectVector Task