Previous Getting Started with IDL: Mapping Next

Drawing Map Projections

Drawing continental outlines and plotting data in different projections is easy using IDL's mapping routines. The MAP_SET routine is the heart of the mapping package. It controls the type of projection and the limits of the global region to be mapped.

  1. Reset the graphics window to default size:
  2. WINDOW  
    

     

  3. Display a cylindrical projection map of the world:
  4. MAP_SET,/CYLINDRICAL,/GRID,/CONTINENTS,/LABEL  
    

     

    Figure 9-2: A Cylindrical Projection

    Figure 9-2: A Cylindrical Projection

     

    The CYLINDRICAL keyword tells MAP_SET to use the cylindrical projection. The GRID keyword causes the latitude and longitude lines to be drawn. The LABEL keyword adds the latitude and longitude labels. The CONTINENTS keyword tells MAP_SET to draw continental outlines.

     

    A similar map could be created by entering a series of separate commands to set up the type of projection, draw the continent outlines, and then draw the grid lines.

     

    Although the single-line MAP_SET command is quicker to enter, by using the separate MAP_SET, MAP_GRID, and MAP_CONTINENTS commands, you exercise more control over the map colors, fills, and so on.

     

  5. Load a new color table.
  6. LOADCT,39  
    

     

  7. Display a Miller cylindrical projection of the world.
  8. MAP_SET,/MILLER  
    

     

  9. Draw the continent outlines. The FILL keyword fills in the continents using the color specified by the COLOR keyword.
  10. MAP_CONTINENTS,COLOR=220,/FILL  
    

     

  11. Draw the grid lines. The COLOR keyword specifies the color of the grid lines. The LABEL keyword labels the lines.
  12. MAP_GRID,COLOR=160,/LABEL  
    

     

    Figure 9-3: Miller Cylindrical Projection with MAP_CONTINENTS and MAP_GRID

    Figure 9-3: Miller Cylindrical Projection with MAP_CONTINENTS and MAP_GRID

     

    The order of MAP_GRID and MAP_CONTINENTS depends on how you wish to display your map. In the above example, if you call MAP_GRID before MAP_CONTINENTS, the filled continents are drawn over the labeled grid lines.

     

  13. Dismiss the graphics window:
  14. WDELETE  
    

  IDL Online Help (March 06, 2007)