GPROJECT Procedure

Example 3: Clipping an Area from the Map

Features:

PROC GPROJECT options LONGMAX=, LONGMIN=, LATMAX=, and LATMIN=

Sample library member: GPJCLIPP
This example uses the clipping capabilities of PROC GPROJECT to create a map of the states in the United States that border the Gulf of Mexico. Because the PROJECT= option is not used in the GPROJECT procedure, the Albers' equal-area projection method is used by default.
Sample library member: GPJCLIPP

Program

goptions reset=all border;
proc gproject data=maps.states
              out=gulf
              longmin=81
              longmax=98
              latmin=25
              latmax=33;
   where density<5;
   id state;
run;
title "Northern Gulf Coast";
footnote j=r "GPJCLIPP ";
pattern value=mempty color=blue;
proc gmap map=gulf data=gulf all;
   id state;
   choro state / nolegend levels=1;
run;
quit;

Program Description

Set the graphics environment.
goptions reset=all border;
Clip and project a rectangular subset of the map. The LONGMIN= and LONGMAX= options specify the minimum and maximum longitudes to be included in the map projection. The LATMIN= and LATMAX= options specify the minimum and maximum latitudes to be included in the map projection.
proc gproject data=maps.states
              out=gulf
              longmin=81
              longmax=98
              latmin=25
              latmax=33;
   where density<5;
   id state;
run;
Define the title and footnote for the map.
title "Northern Gulf Coast";
footnote j=r "GPJCLIPP ";
Define the pattern characteristics.
pattern value=mempty color=blue;
Show the clipped map.
proc gmap map=gulf data=gulf all;
   id state;
   choro state / nolegend levels=1;
run;
quit;