This task reprojects the records in a vector from one coordinate system to another.

Example


This example reprojects a shapefile of U.S. counties to the same coordinate system as a raster so that they can be displayed in the same view.

; Start the application
e = ENVI()
 
; Open a shapefile of counties
VectorFile = Filepath('counties.shp', $
  Subdir=['classic', 'data', 'vector'], $
  Root_Dir=e.Root_Dir)
Vector = e.OpenVector(VectorFile)
 
; Open an input raster
RasterFile = Filepath('bhtmref.img', $
  Subdir=['classic', 'data'], $
  Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(RasterFile)
 
; Get the coordinate system of the raster
CoordSys = ENVICoordSys( $
  COORD_SYS_CODE=Raster.SPATIALREF.COORD_SYS_CODE)
 
; Get the task from the catalog of ENVITasks
Task = ENVITask('ReprojectVector')
 
; Define inputs
Task.INPUT_VECTOR = Vector
Task.COORD_SYS = CoordSys
 
; Run the task
Task.Execute
 
; Display the reprojected vector over the raster
View = e.GetView()
RasterLayer = View.CreateLayer(Raster)
VectorLayer = View.CreateLayer(Task.OUTPUT_VECTOR)
View.Zoom, 0.14

Syntax


Result = ENVITask('ReprojectVector')

Input properties (Set, Get): INPUT_VECTOR, COORD_SYS, OUTPUT_VECTOR_URI

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 the input vector to be reprojected.

COORD_SYS (required)

Specify the output coordinate system.

OUTPUT_VECTOR

This is a reference to the output reprojected vector.

OUTPUT_VECTOR_URI (optional)

Specify a string with the fully qualified path and filename for OUTPUT_VECTOR.

Version History


ENVI 5.5. 3

Introduced

API Version


4.2

See Also


ENVITask, ENVICoordSys, ENVIVector, ReprojectRaster Task