GPROJECT Procedure

Using the GPROJECT Procedure

About the GPROJECT Procedure

You can use PROC GPROJECT statement options to do the following actions:
  • select the map projection method
  • specify the map projection criteria
  • create a rectangular subset of the input map data set
The following sections describe how you can use PROC GPROJECT statement options to select your own projection method and projection criteria.

Selecting Projections

Except when projecting map data sets that cover large areas, all three types of projections (Albers', Lambert's, and gnomonic) produce relatively similar results when you use default projection criteria, so you usually do not need to be concerned about which projection method to use when you produce maps of small regions.
However, the default projection criteria might be unsuitable in some circumstances. In particular, the default specifications fail when the map that is being projected extends on both sides of the equator. On other occasions, you might want to select a projection method to achieve a particular effect.
For the Albers' and Lambert's projections, the two standard parallels must both lie on the same side of the equator. PROC GPROJECT stops and gives an error message if this condition is not met, regardless of whether you explicitly specify parallel values or let the procedure calculate default values. See the descriptions of the PARALLEL1= and PARALLEL2= options for more information about how to specify the two standard parallels.

Controlling Projection Criteria

For both the Albers' and Lambert's projections, PROC GPROJECT calculates appropriate standard parallels. You can override either or both of these selections if you explicitly specify values for the PARALLEL1= or PARALLEL2= option. You can influence the selection of default parallels if you use the PARADIV= option.
For the gnomonic projection, PROC GPROJECT determines the longitude and latitude of the approximate center of the input map data set area. You can override either or both of these selections if you explicitly specify values for the POLELAT= or POLELONG= option.
The clipping options, discussed in Clipping Map Data Sets, can also influence the calculations of the default standard parallels by changing the minimum and maximum coordinate values.

Clipping Map Data Sets

The GPROJECT procedure can create rectangular subsets of the input map data set. This capability provides a way to extract a portion of a larger map if you do not need all the original unit areas for your graph. The procedure enables you to clip unit area boundaries at specified latitude values, longitude values, or both. Unit areas that fall completely outside of the specified clipping limits are excluded from the output map data set. Unit areas bisected by the clipping limits are closed along the clipping parallels and meridians, and all points outside of the clipping limits are excluded.
If the input map data set contains the DENSITY variable, any new vertex points and corners that are created by PROC GPROJECT are assigned a DENSITY value of 0 in the output map data set. This enables you to use a subset of the clipped map without using PROC GREDUCE to assign new DENSITY values. (See GREDUCE Procedure for information about how to reduce the number of points that you need to draw a map.)
You can specify the minimum latitude to be retained in the output map data set with the LATMIN= option and the maximum latitude with LATMAX= option. Minimum and maximum longitude values are specified with the LONGMIN= and LONGMAX= options, respectively.
This is how the PROC GPROJECT interprets the clipping longitude and latitude values:
  • If you specify PROJECT=NONE in the PROC GPROJECT statement, the procedure assumes that the input map data set is already projected and the clipping longitude and latitude values are Cartesian coordinates. In this case, the LATMAX= and LATMIN= options specify the top and bottom edges, respectively, of the area that you want to extract, and the LONGMAX= and LONGMIN= options specify right and left edges, respectively.
    You must be familiar with the range of values in the X and Y variables in order to select appropriate clipping limits. Use the MEANS or SUMMARY procedure in Base SAS to determine the range of values in X and Y. See the Base SAS Procedures Guide for more information.
  • In all other projections, the clipping values are treated as degrees.
Depending on the size and position of the clipped area and the type of projection that is performed, the resulting map might not be exactly rectangular. PROC GPROJECT performs clipping before projection, so the clipped area might be distorted by the projection process.
To produce a clipped area with a rectangular shape, use PROC GPROJECT in two steps:
  1. Project the map using the appropriate projection method and projection criteria.
  2. Project the map using PROJECT=NONE, and use the LATMIN=, LATMAX=, LONGMIN=, and LONGMAX= options to clip the map.
See Clipping an Area from the Map, for an example of clipping an area from an unprojected map data set.