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.
e = ENVI()
VectorFile = Filepath('counties.shp', $
Subdir=['classic', 'data', 'vector'], $
Root_Dir=e.Root_Dir)
Vector = e.OpenVector(VectorFile)
RasterFile = Filepath('bhtmref.img', $
Subdir=['classic', 'data'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(RasterFile)
CoordSys = ENVICoordSys( $
COORD_SYS_CODE=Raster.SPATIALREF.COORD_SYS_CODE)
Task = ENVITask('ReprojectVector')
Task.INPUT_VECTOR = Vector
Task.COORD_SYS = CoordSys
Task.Execute
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
API Version
4.3
See Also
ENVITask, ENVICoordSys, ENVIVector, ReprojectRaster Task