Using the GPROJECT Procedure


The GPROJECT procedure uses a default projection method and default projection criteria to project your map data set. If you do not want to use these defaults, you can use PROC GPROJECT statement options to

  • 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 solely for graphics output.

However, the default projection criteria may 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 may 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 with 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 PARALEL1= and PARALEL2= option on page 1170 for more information on 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 PARALEL1= or PARALEL2= option. You can influence the selection of default parallels if you use the PARADIV= option. See Options on page 1168 for more information on these options.

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. See Options on page 1168 for more information.

The clipping options, discussed in Clipping Map Data Sets on page 1173, 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 parallels of latitude or meridians of longitude 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 Chapter 41, The GREDUCE Procedure, on page 1213 for information on 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 LATMIN= and the maximum latitude with LATMAX= . Minimum and maximum longitude values are specified with LONGMIN= and LONGMAX=, respectively. See Options on page 1168 for more details on these options.

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, LATMAX= and LATMIN= specify the top and bottom edges, respectively, of the area that you want to extract, and LONGMAX= and LONGMIN= 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.

  • If PROJECT=ALBERS, LAMBERT, or GNOMON, 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 may not be exactly rectangular. PROC GPROJECT performs clipping before projection, so the clipped area may 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 LATMIN=, LATMAX=, LONGMIN=, and LONGMAX= to clip the map.

See Example 3 on page 1178, for an example of clipping an area from an unprojected map data set.




SAS.GRAPH 9.1 Reference, Volumes I and II
SAS.GRAPH 9.1 Reference, Volumes I and II
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 342

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net