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 parameters (Set, Get): INPUT_VECTOR, COORD_SYS, OUTPUT_VECTOR_URI
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 the input vector to be reprojected.
COORD_SYS (required)
Specify the output coordinate system.
OUTPUT_VECTOR_URI (optional)
Specify a string with the fully qualified path and filename for OUTPUT_VECTOR.
Output Parameters
OUTPUT_VECTOR
This is a reference to the output vector.
Methods
Execute
Parameter
ParameterNames
Properties
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
Version History
See Also
ENVITask, ENVICoordSys, ENVIVector, ReprojectRaster Task