The ConvertMapToMap method converts a set of map coordinates (x-eastings, y-northings) from the source (input) spatial reference to the same location in the target (output) spatial reference. The user must specify both spatial references.
Example
e = ENVI(/HEADLESS)
file = FILEPATH('Avon.laz', ROOT_DIR=e.ROOT_DIR, $
SUBDIRECTORY = ['data','lidar'])
pointcloud = e.QueryPointCloud(file)
sourceSpatialRef = pointcloud.SPATIALREF
targetSpatialRef = ENVIPointCloudSpatialRef(COORD_SYS_CODE = 2235)
originalPoints = pointcloud.GetPointsInRange(0, 10)
sourceSpatialRef.ConvertMapToMap, originalPoints, reprojectedPoints, targetSpatialRef
print, 'Original points ='
print, originalPoints
print, 'Reprojected points ='
print, reprojectedPoints
pointcloud.Close
Syntax
ENVIPointCloudSpatialRef.ConvertMapToMap, inPointArray, outPointArray, ENVIPointCloudSpatialRef2 [, ERROR=variable]
ENVIPointCloudSpatialRef.ConvertMapToMap, inOutPointArray, ENVIPointCloudSpatialRef2, /CONVERT_IN_PLACE [, ERROR=variable]
Arguments
ENVIPointCloudSpatialRef2
The spatial reference to the target ENVIPointCloudSpatialRef object.
inOutPointArray
A 3-by-n array of double-precision containing the x,y,z positions of the points in the source spatial reference. On completion of ConvertMapToMap, this contains a 3-by-n array of double-precision values containing the x,y,z positions of the points in the target spatial reference. In this case, a copy of the x,y,z positions is not made. The original points are overwritten.
or
A 3-by-n array of double-precision containing the x,y positions of the points in the source spatial reference. On completion of ConvertMapToMap, this contains a 2-by-n array of double-precision values containing the x,y positions of the points in the target spatial reference. In this case, a copy of the x,y positions is not made. The original points are overwritten.
inPointArray
A 3-by-n array of double-precision values containing the x,y,z positions of the points in the source spatial reference.
or
A 2-by-n array of double-precision values containing the x,y positions of the points in the source spatial reference.
outPointArray
A 3-by-n array of double-precision values containing the x,y,z positions of the points in the target spatial reference.
or
A 2-by-n array of double-precision values containing the x,y positions of the points in the target spatial reference.
Keywords
CONVERT_IN_PLACE
Indicates to not make a copy of the input array. The input array is overwritten with the projection results. If only one array argument is specified without CONVERT_IN_PLACE, an error will be thrown.
ERROR
Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.
When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.
See Manage Errors for more information on error handling in ENVI programming.
Version History
API Version
4.3
See Also
ENVIPointCloudSpatialRef