>  Docs Center  >  ENVI API  >  Point Clouds  >  ENVIPointCloudSpatialRef::ConvertMapToMap

ENVIPointCloudSpatialRef::ConvertMapToMap

ENVIPointCloudSpatialRef::ConvertMapToMap

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


; Create a headless instance
e = ENVI(/HEADLESS)
 
; Open a las file
file = FILEPATH('Avon.laz', ROOT_DIR=e.ROOT_DIR, $
  SUBDIRECTORY = ['data','lidar'])
pointcloud = e.QueryPointCloud(file)
 
; Get source coordinate system
sourceSpatialRef = pointcloud.SPATIALREF
 
; Target coordinate system to reproject to (State Plane, NAD83, ft)
targetSpatialRef = ENVIPointCloudSpatialRef(COORD_SYS_CODE = 2235)
 
; Get the first 10 points in the original projection
originalPoints = pointcloud.GetPointsInRange(0, 10)
 
; Reproject the original points to EPSG 2235
sourceSpatialRef.ConvertMapToMap, originalPoints, reprojectedPoints, targetSpatialRef
 
; Print original points
print, 'Original points ='
print, originalPoints
 
; Print reprojected points points
print, 'Reprojected points ='
print, reprojectedPoints
 
; Close the point cloud object
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


ENVI 5.3

Introduced

API Version


3.3

See Also


ENVIPointCloudSpatialRef



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us