The GPROJECT Procedure |
About the Input Map Data Set |
The input map data set must be in traditional map data set format (see About Traditional Data Sets), and it must contain these variables:
a numeric variable named X that contains the longitude coordinates of the map boundary points.
a numeric variable named Y that contains the latitude coordinates of the map boundary points.
one or more identification variables that uniquely identify the unit areas in the map. These variables are listed in the ID statement.
The X and Y variables contain the values that are to be projected.
In addition, the input map data set can also contain these variables:
a numeric variable named SEGMENT that distinguishes nonconterminous segments of the unit areas.
a numeric variable named DENSITY that can be used to affect the output from PROC GPROJECT. See Clipping Map Data Sets for more information.
Other variables in the input map data set do not affect the GPROJECT procedure.
The following is a list of all of the data sets supplied by SAS that contain X and Y variables whose values are unprojected:
See Using Default Projection Specifications for an illustration of this type of input map data set and the variables it contains.
Note: Projection is appropriate for map data sets in which the X and Y variable values represent longitude and latitude. Some of the map data sets that are supplied with SAS/GRAPH have already been projected; such data set should not be projected again.
Most traditional map data sets contain both sets of variables (X, Y and LONG, LAT) for projected and unprojected maps. In these cases, the X and Y variables produce a projected map so you do not need to use the GPROJECT procedure. However, you might want to use the LONG and LAT variables to reproject the map using a different projection type. To do this you must first rename the LONG and LAT variables as X and Y. It is necessary to rename the LONG and LAT variables because the GPROJECT procedure looks for variables that are named X and Y by default. You can create a new map data set using the OUT= option, drop the current X and Y variables, and rename the LONG and LAT variables as X and Y. Your new data set then contains unprojected values in X and Y. The following statements illustrate how to do this:
proc gproject data=maps.austral (drop=x y rename=(long=x lat=y)) out=newaust; id id; run;
For additional information on the supplied SAS/GRAPH map data sets, see About Map Data Sets and the METAMAPS data set in your maps data set directory.
About Coordinate Values |
Longitude and Latitude Coordinates shows the standard coordinate system for map data sets with coordinates in longitude and latitude. For the longitude and latitude values (below and to the right of the figure, respectively) the upper value is expressed in degrees and the lower value is expressed in radians. A radian is approximately 57.3 degrees.
Longitude and Latitude Coordinates
By default, the GPROJECT procedure assumes that the units for the input coordinate values are radians and that values for the horizontal coordinate increase from east to west across the map. If your map coordinates are stored as degrees of arc, use the DEGREE option in the PROC GPROJECT statement. If the horizontal coordinate values in the map increase west-to-east rather than east-to-west, use the EASTLONG option in the PROC GPROJECT statement. See Options for details about the DEGREE and EASTLONG options.
The unprojected map data sets that are provided with SAS/GRAPH can be projected if you use the default procedure characteristics: coordinate units in the data sets are radians, and horizontal values increase east-to-west.
About Types of Map Projections |
The GPROJECT procedure performs three different types of projection: Albers' equal-area projection with two standard parallels (the default method), Lambert's conformal projection with two standard parallels, or the gnomonic projection (an azimuthal equidistant projection).
The Albers' projection is a conic projection from the surface of the sphere to a cone secant to the sphere, cutting it at two standard parallels of latitude. The axis of the cone coincides with an extension of the polar axis of the sphere. Each section of the resulting map bears a constant ratio to the area of the sphere. In general, distortion in shape tends to increase toward the poles in latitudes outside of the two standard parallels.
Albers' Projection illustrates an Albers' equal-area projection of the northern hemisphere.(footnote 1)
The Albers' projection is suitable for portraying areas of large and small east-to-west extent and produces satisfactory results in most cases. However, both standard parallels must lie on the same side of the equator, so this method might not be suitable for map data sets of large north-to-south extent that span the equator. For those map data sets, use the gnomonic projection method.
The Lambert's projection is obtained from a secant cone in the same manner as Albers' projection. In the Lambert's projection, meridians of longitude are straight lines that radiate from the apex of the cone, while parallels of latitude are concentric circles. The Lambert's projection is somewhat better than the Albers' projection at representing the original shape of projected unit areas, while the Albers' projection is somewhat better at representing relative sizes of projected unit areas.
Lambert's Projection illustrates a Lambert's conformal projection of Europe.
The Lambert's projection is ideal for navigational charts and maps of relatively small east-to-west extent. However, as in the Albers' projection, both standard parallels must lie on the same side of the equator, so this method might not be suitable for map data sets that span the equator. For those map data sets, use the gnomonic projection method.
The gnomonic projection is a planar projection from the surface of the sphere directly onto an imaginary plane tangent to the sphere at the map projection pole. By default, the projection pole is placed at the center of the map data set that is to be projected, but you can specify the projection pole to be anywhere on the surface of the sphere. (See the POLELAT= and POLELONG= option.)
Gnomonic Projection illustrates a gnomonic projection of Africa.
In the gnomonic projection, distortion increases as the distance from the map pole increases. Because of this distortion, the PROC GPROJECT procedure deletes all of the observations that lie more than 85 degrees from the map pole. The gnomonic projection is best suited for mapping areas of small east-to-west extent.
FOOTNOTE 1: The projection examples in this topic include grid lines that were added with the Annotate facility. See the Samples area at support.sas.com for an example of adding latitude and longitude lines to a map.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.