Map Visualizations
Using the Visualize Perspective, you can visualize data as a map, with the map projection of your choice. Map data can be vectors, arrays, images, or shapefile objects.
IDL allows you to open map data in several ways:
- Use File → Open File and select the file you want. This process opens the image data in iImage by default rather than iMap. You can close the iImage window and the image variable persists in the Workbench Variables View. You can then drag the variable onto the Map tool.
- Drag an image file from the Project Explorer onto the Map tool.
- Use a READ routine from the IDL command line. See the example below or the Image Reading Routines for more information.
For this example, we will use the command line option:
- Make sure you are viewing the IDL Visualize Perspective. (Click the Visualize button (
) in the upper right of the Workbench.) - At the IDL command line, type the following (or click on the code below):
- Drag the
cloudsvariable to the Map tool:

READ_JPEG, FILEPATH('Clouds.jpg', $
SUBDIR=['examples','data']), clouds
The clouds variable now appears in the Variables View.
Note
This example assumes the default action definitions. Your results may be different if you have added new actions or changed the order of actions. To return all Tool Palette actions to their system default state, see Resetting the Default Actions.
The iMap window appears, with the IDL Map Register Image dialog on top.
Note
Registering an image creates a correspondence between the image pixels and points on the earth's surface. Registration lets the iMap tool properly display image data in the map projection you select. You can set the registration properties within an action. See the Map Registration and Projection Example.


Map Registration and Projection Example
You can define the registration and map projection information in a Map tool action. Defining the action this way gives IDL all the information that it would ask for in the Map Register dialogs. This is an efficient method if you will be viewing many data sets from similar locations.
The following example uses a system-defined action that displays map data with a Mollweide projection.
- Click on the action toggle button (
) to expand the Tool Palette to display the actions. (You can also drag the right border of the Tool Palette to the right to display the actions.) - Click on the Map tool in the Tool Palette to display the available map actions. Find the Map: Image in lat/lon, Mollweide projection action. The action definition is based on the IDL
IMAP procedure, and defines the map registration properties using keywords. The following table describes the action definition:Action ElementItemDescription
IDL Procedure
IMAP
Calls the iMap iTool procedure
Positional Arguments
Image
Defines the data variable to use.
Keywords
GEOTIFF=%1_geotiff
This keyword uses the GeoTiff tags if they are specified in the image file.
RGB_TABLE=%1_pal
This keyword uses the image palette if one is defined in the image file.
MAP_PROJECTION=
'mollweide'Note - Defines the map projection to use. IDL provides numerous projections to choose from. For a list of projections, see iMap Map Projection.
GRID_UNITS=2
Defines degrees of latitude and longitude as the map units.
LIMIT=[-90,-180,90,180]
Specifies the boundaries of the region to be mapped.
IMAGE_LOCATION=[-180,-90]
Specifies the image location in data units.
IMAGE_DIMENSIONS=
[360,180]Specifies the image dimensions in data units.
WINDOW_TITLE='Map %1 (Mollweide)'
Defines the map title as the name of the data variable. See Using Variable Names (Tokens) with Keywords.
Title
Map: Image in lat/lon, Mollweide projection
Title appears in the action by default.
Description
Display an image warped to cover the entire globe, using the Mollweide projection.
Description appears on mouse hover over the action.
- If you do not already have the CLOUDS variable available in the Variables view, enter the following command at the IDL command line (or click on the command to run it in IDL):
- Drag the CLOUDS variable to the map action titled Map:Image lat/lon, Mollweide projection:

- Click the IMAP button to create the visualization.
For more information on creating actions, see Creating Tools.
READ_JPEG, FILEPATH('Clouds.jpg', $
SUBDIR=['examples','data']), clouds
The CLOUDS variable appears in the Variables View.
The iMap window displays the data without displaying the Map Registration dialog, because you defined the registration information in the action:

Note
This action works with other IDL example data, including avhrr.png, Day.jpg, Night.jpg, and states.shp.
Manipulating Map Visualizations
Once you have visualized an image, you can perform many different kinds of operations on it, including:
- Using the Map Panel to view and modify map projections and latitude and longitude limits (see Using the Map Panel)
- Modifying the Map Panel (see Using the Map Panel)
- Manipulating the image by rotating, scaling, flipping, inverting, zooming, adding annotations, etc. (see Manipulating the Display)
- Using the iTools Procedural Interface to add a variety of annotations.
For more information, please refer to Working with Maps and Manipulating the Display in the iTools User Guide.