The ConvertMapToLonLat method uses the source spatial reference to convert a set of map coordinates (x-eastings, y-northings) to a set of geographic latitude and longitude coordinates using WGS84 datum.

Example


; Create a headless instance
e = ENVI (/HEADLESS)
 
; Open a las file with spatial reference
file = FILEPATH('DataSample.las', ROOT_DIR=e.ROOT_DIR, $
  SUBDIRECTORY = ['data','lidar'])
pointcloudQuery = e.QueryPointCloud(file)
 
; Get the spatial reference from the lidar object
sourceSpatialRef = pointcloudQuery.SpatialRef
 
; Get and print the first 10 points
inOutPoints = pointcloudQuery.GetPointsInRange(0, 10)
print, 'Original points ='
print, inOutPoints
 
; Convert and print the converted inOutPoints
sourceSpatialRef.ConvertMapToLonLat, inOutPoints, /CONVERT_IN_PLACE
print, 'Reprojected points ='
print, inOutPoints
 
; Close the point cloud object
pointcloudQuery.Close

Syntax


ENVIPointCloudSpatialRef.ConvertMapToLonLat, inPointArray, outPointArray [, ERROR=variable]

ENVIPointCloudSpatialRef.ConvertMapToLonLat, inOutPointArray, /CONVERT_IN_PLACE [, ERROR=variable]

Arguments


inOutPointArray

On input, a 3-by-n array of double-precision values containing the x,y,z positions of the points in the ENVIPointCloudSpatialRef coordinate system. On completion of ConvertMapToLonLat, inOutPointArray contains 3-by-n array of double-precision values containing the x,y,z positions of the points in the geographic LonLat coordinate system. The original points are overwritten.

or

On input, a 2-by-n array of double-precision values containing the x,y positions of the points in the ENVIPointCloudSpatialRef coordinate system. On completion of ConvertMapToLonLat, inOutPointArray contains a 2-by-n array of double-precision values containing the x,y positions of the points in geographic LonLat coordinate system. 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 ENVIPointCloudSpatialRef coordinate system.

or

A 2-by-n array of double-precision values containing the x,y positions of the points in the ENVIPointCloudSpatialRef coordinate system.

outPointArray

A 3-by-n array of double-precision values containing the x,y,z positions of the points in the geographic lon/lat coordinate system.

or

A 2-by-n array of double-precision values containing the x,y positions of the points in the geographic lon/lat coordinate system.

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


4.2

See Also


ENVIPointCloudSpatialRef