Reference Guide > M–N Routines > MAP_REVERSE Procedure
  

MAP_REVERSE Procedure
Converts output from routines like CURSOR and WtPointer from device, normal, or data coordinates to longitude and latitude coordinates.
Usage
MAP_REVERSE, x, y, lon, lat
Input Parameters
x—A variable containing the value (e.g., column of the current cursor position) to convert to a longitude value.
y—A variable containing the value (e.g., row of the current cursor position) to convert to a latitude value.
Output Parameters
lon—A named variable to receive the calculated longitude value.
lat—A named variable to receive the calculated latitude value.
Keywords
Data—If present and nonzero, specifies that data coordinates are the input (the default).
Device—If present and nonzero, specifies that device coordinates are the input.
Normal—If present and nonzero, specifies that normal coordinates are the input.
Discussion
MAP_REVERSE allows you to create mapping applications that permit user interaction. Input (x, y) is received from a procedure that reads the cursor position, such as CURSOR. MAP_REVERSE converts these values to longitude and latitude values in the current projection.
You cannot use this routine when the Projection keyword is set to 99 (3D Mapping onto Sphere) because it is not a projection, but a true 3D representation of the data.
Example
The following commands print the longitude and latitude of any point on a map that you click on with the mouse.
MAP
PRINT, 'Click on the map to select a point.'
CURSOR, x, y, /Normal
MAP_REVERSE, x, y, lon, lat, /Normal
PRINT, 'Longitude = ', lon
PRINT, 'Latitude = ', lat
See Also
CURSORMAP, WtPointer

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.