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:

For this example, we will use the command line option:

  1. Make sure you are viewing the IDL Visualize Perspective. (Click the Visualize button (viz_button.gif) in the upper right of the Workbench.)
  2. At the IDL command line, type the following (or click on the code below):
  3. READ_JPEG, FILEPATH('Clouds.jpg', $
    SUBDIR=['examples','data']), clouds

    The clouds variable now appears in the Variables View.

  4. Drag the clouds variable to the Map tool:
    icons_map.gif
  5. 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_register.gif

  1. The default selection is Degree. Accept that selection by clicking Next.
  2. IDL Map Register Image Step 2 dialog appears. Accept the default values by clicking Finish.
  3. The map image displays with the Mercator projection:

map_mercator.gif

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.

  1. Click on the action toggle button (window_icon.gif) 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.)
  2. 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 Element
    Item
    Description

    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.

  3. For more information on creating actions, see Creating Tools.

  4. 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):
  5. READ_JPEG, FILEPATH('Clouds.jpg', $
    SUBDIR=['examples','data']), clouds

    The CLOUDS variable appears in the Variables View.

  6. Drag the CLOUDS variable to the map action titled Map:Image lat/lon, Mollweide projection:
    map_custom_action03.gif
  7. Click the IMAP button to create the visualization.
  8. The iMap window displays the data without displaying the Map Registration dialog, because you defined the registration information in the action:

clouds_map.gif

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:

For more information, please refer to Working with Maps and Manipulating the Display in the iTools User Guide.