Академический Документы
Профессиональный Документы
Культура Документы
·• ..
•
categories. Then field locations are subsampled
from the 1 OOO-meter grid sample for ground
observation and measurement. By sampling from a
UTM grid, Forest Survey samples are equal map
•• distance apart (within grid zones), field sample
• locations are easily identified on U.S. Geologic
Figure l--UTM grid zones for the United States. Survey topographic maps, and resulting survey
data are labeled in metric units.
Map points are identified within each zone by
"northing tl and Iteastingll UTM coordinates on a Although UTM coordinates have many advantages for
metric scale (fig. 2). mapping and inventory of forest and range lands
in the Rocky Mountain States, they are not
compatible with SAS mapping procedures (SAS 1985).
UTM COORDINATES The GMAP procedure in SAS/GRAPH is based on
geographic coordinates (latitude and longitude
expressed in radians). not UTM coordinates.
Fortunately, a conversion between geographic and
UTM coordinates exists, but it is somewhat
camp 1i ca ted.
The purpose of this paper is to document the
conversion of UTM coordinates to geographic
coordinates in a SAS DATA step and display
resulting data with GMAP procedure using the
ANNOTATE= Data Sets feature.
CONVERSION OF UTM COORDINATES
Figure 2--The UTM "northingll coordinate identifies The algorithm for conversion of UTM coordinates
vertical direction and the lIeasting" to- geographic coordinates was taken from document-
coordinate identifies horizontal ation supplied by Lloyd (1985), which was based
direction. on Claire's (1968) work. For a given map point,
489
the algorithm requires UTM grid zone and northing "'''''COSINE OF LATITUDE OF FOOT OF PERPENDICULAR"'*"';
and easting coordinates as inputs in order to COSFP=COS (FP);
.give latitude and longitude as outputs. The
Clark 1866 spheroid is used by the algorithm for **"'COSINE OF LATITUDE OF FOOT OF PERPENDICULAR
SQUARED**";
the assumed size and shape of the earth. The CFP2=COSFP**2;
algorithm, as given in this paper, is applicable ETA=1 + (EM2"CFP2);
to the northern hemisphere only, but easily can
be modified for the southern hemisphere by "'''''DIFFERENCE BETWEEN EASTING INPUTED AND
adjusting the northing: FALSE EASTING"''''';
XMC=X-C;
XAK=( (I-ESQ) / (KO"KO)) "'(}[MC/A) ""2;
Y = 10,000,000 - Y
where: "'*"'DEGREES IN ONE RAlJIAN FOR CALCULATING
CENTRAL MERIDIAN"'**;
Y = northing coordinate in southern hemisphere RADDEG=180. 0 IPI;
~. ultSCALE FACTOR OF THE CENTRAL MERIDIAN""""'; Several maps were made to illustrate the useful-
KO=.9996; ness of the UTM conversion algorithm when combined
with the mapping features of SAS/GRAPH. The UTM
u"'FALSE EASTING"""tt; data (converted to latitude and longitude) were
C=500000.0; combined and prOjected with the SAS map data set
"'''''''RECTIFYING LATITUDE"'''''';
to assure uniform scaling. The projected UTM
V=.0000001571128261; data were then separated from the SAS map data
R£=Y"'Y; set. The projected UTM data were included in the
CRL=COS (BL) ; GMAP procedure for final mapping using ANNOTATE=
Data Sets. A similar example of this logic is
u"'CALCULATING LATITUDE OF FOOT OF PERPENDICULAR given in the SAS/GRAPH User's Guide (SAS 1985, p.
FROM POINT TO CENTRAL MERIDIAN (IN RADIANS)"'U;
0=.0000002457956882;
316-317) •
D=.005078649674;
F=.0000300245646; Figure 4 illustrates 5 OOO-meter UTM grid points
FP=BL + ((D + (F"'CRL**2) corresponding to several ownerships overlaid onto
+ (G"CRL**4)) "'(SQRT(1. 0-CRL**2)) "'CRL); a Wyoming counties map. Five different public
490
•
•
• •..
Jt.
•
................................
........................................ ... .. •
.............
.......................................
.. ..
...................................
•...... ........
• •
.........
....... .. .... ...
.............
• • ••
....
.... ".,," .. *
.. ......... JIo JIo JIo JIo ..
•• •
" .. "."""" .... ,,
JIo . . . . . . . . . . . . ..
• Nat'l Fore.t 0 Nat'l Park • Bureau of Land !.tamt ... Indian Re •• rvatlon * State
Figure 4--Five Wyoming public ownerships sampled on 5 ODD-meter UTM grid.
ownershi ps are ill ustrated for Wyomi ng. The map ** ......
shows a slight problem in using special symbols "SAS PROGRAM FOR SUGI12 PAPER--OWNERSHIP MAP
with FUNCTION='lABEl' to annotate the ownerships .... "' ....
;
on the map. Notice in figure 4 ownership classes
below the southern Wyoming border and a small gap GOPTIONS DEVICE=HP?475A;
of no ownerships below the northern Wyoming LIBNAME DD1 ':DJ:SASLIB:GMAP:SUGI12';
border. There should be no ownership symbols
outside the Wyoming border and National Park and DATA PI; SET DD1.WY PI;
National Forest ownerships should be adjacent to O=OWNER; -
the northern border. These problems apparently IF 0 EQ 9 OR 0 EQ 11 OR 0 EQ 12 OR 0 EQ 13 OR
occurred because ANNOTATE's label function centers o EQ 15;
within a graphics cell, instead of centering LENGTH FUNCTION $ 8 STYLE $ 8 TEXT $ 25 COLOR $ 8
exactly on the X an Y coordinates (SAS 1985, p. POSITION $ 1;
124). Had we used ANNOTATE's symbol function FUNCTION= 'LABEL';
(SAS 1985, p. 130) instead of the label function XSYS='2';
this problem might not have occurred. However YSY8='2';
WHEN",,'A ';
this speculation was not tested because of a X=LONGRAD;
"bug" in our AOS/VS version of SAS/GRAPH (beta Y=LATRAD;
test version 5.03). P08ITION='5';
STYLE= 'SPECIAL';
Also illustrated in figure 4 is the effect of a COLOR= 'BLACKS';
UTM zone break between zones 12 and 13 (see fig.
IF a EQ 11 THEN TEXT='K'; "NATIONAL FOREST;
1) for the BlM ownership. Zone breaks are a IF a EQ 9 THEN TEXT",,'H'; "NATIONAL PARK;
known nuisance when selecting survey samples on a IF 0 EQ 12 THEN TEXT='L'; "ELM;
fixed UTM coordinate grid, but maps such as IF 0 EQ 13 THEN TEXT='$'; "INDIAN;
figure 4 will help us make a sampling correction IF a EQ 15 THEN TEXT='M'; "STATE;
to deal with this problem in the future.
IF a EQ 9 OR a EQ 13 OR a EQ 15 THEN 8IZE=.8;
IF a EQ 11 THEN SIZE=1.1;
Because the SAS code for generating figure 4 is
representative of our concept for mapping UTM COUNTY = -1; ...... DUMMY COUNTY FOR ANNOTATE TEXT;
data s it is given below: RUN;
491
DATA LEGEND; In both cases UTM data sampled on 5 OOO-meter
LENGTH TEXT $ 25; grid is overlaid onto a portion of the Wyoming
counties map available in SAS.
FUNCTION='LABEL';
XSYS='3';
YSYS='3';
•• * .... • t •
· .
COLOR= 'BLACK3 '; ~
POSITION:' 0'; ... * • ••
Y==01; X=14;
.* ·1
••••••
• ••••• ••• ~ ••••·t·
STYLE='SPECIAL'; TEXT='K'; OUTPUT;
Y=.; K=.;
STYLE='DUPLEX'; TEXT=' Nat"Z, Fonst'; OUTPUT; ••
• ••• ......
• •• ft1=
••••
STYLE='SPECIAL'; TEXT=' H'; OUTPUT;
STYLE='DUPLEX'; TEXT:' Nat"Z, Park'; OUTPUT; ••• .t
• IU·
a: **a•
STYLE== 'SPECIAL'; TEXT::' L'; OUTPUT; : * *d
STYLE='DUPLEX'; TEXT=' Bureau of Land MfJ111t';OlJTPUT; ..*t" III
STYLE='SPECIAL'; TEXT=' $'; OUTPlJT;
STYLE='DUPLEX'; TEXT=' Indian Reservation'; OUTPUT; •• : :... ~:
STYLE='SPECIAL';
STYLE='DUPLEX';
TEXT='
TEXT='
M';
State';
OUTPUT;
OUTPUT; •• ••• •:·*·1
••• •
RUN; ••
•• • •••••• • •*
DATA SASMAP; SET DD1.WY_CNTY PI; RUN; • •
PROG GPROJECT DATA=SABMAP OUT=COMBINED;
• •• ••• ••••••••• ••• •
ID COUNTY; • • ••• • • •
RUN;
IF COUNTY EQ -=1 THEN OUTPUT PI PTS; Figure 6--Wood volume for all ownerships except
ELSE OUTPUT MAP_PTS;
RUN; National Forest in the Black Hills
region of northeast Wyoming sampled on
DATA PI PTS; SET PI PTS LEGEND; a 5 OOO-meter UTM grid.
RUN; - -
--. ......
i;. -" :":•
...............1
Figure 5--Yellowstone National Park's forest Figure 7--Boundary perimeter points for Wyoming's
types and lakes sampled on a 5 000- Wind River Indian Reservation sampled
meter UTM gri d. on a 5 OOO-meter UTM grid.
492
In figure 8 the northeast and northwest corner PROC SORT DATA=WE_5000M; BY BASTING DESCENDING NORTHING;
boundaries double back. RUN;
This was due to our inability to easily sort the DATA WR BNDRY; SET WR BNDRY;
boundary points in the correct order for certain LENGTH FUNCTION S 8;
types of concave corners. However, our SAS RETAIN I 0;
boundary program, given below, is a reasonable 1=1+1;
approximation for crude mapping purposes: IF I EQ 1 THEN FUNCTION='MOVE';
ELSE FUNCTION='DRAW';
XSYS='2';
.......... YSYS='2';
"SAS PROGRAM FOR IDENTIFICATION OF WIND RIVER INDIAN WHEN='A ';
RESERVATION BOUNDARY POINTS FOR 5 OOO-METER UTM GRID
..........
;
LINE=l;
SIZE=40;
COLOR='BLACK? ';
COPTIONS DEVICE=HF747SA; X=LONGRAD;
Y=LATRAD;
LIBNAME DDl ':DJ:SASLIB:GMAP:S!JGI12'; COUNTY=-l; ...... DUMMY COUNTY FOR ANNOTATE TEXT;
RUN;
DATA WR SOOOM; SET DD1.WE SOOOM; ......S OOO-METER DATA FILE;
RUN; - - DATA WR_MAP; SET DD1.WE_CNTY WR_BNDRY; RUN;
PROC SORT DATA=WR 5000M; BY DESCENDING NORTHING EASTING; PROC GPROJECT DATA~R MAP OUT=WR MAP;
RUN; - ID COUNTY; - -
RUN;
DATA EAST; SET WR SOOOM; BY DESCENDING NORTHING;
RETAIN KNT 0; - DATA MAP P'l'S WR BNDRY; SET WR MAP;
IF LAST. NORTHING THEN DO; IF COUNTY EQ ~1 THEN OUTPUT-WR BNDRY;
KNT=KNT+l; IF COUNTY GT 0 THEN OUTPUT MAP PTS;
SIDE=l; RUN; -
OUTPUT EAST;
END; PROC GMAP MAP=MAP PTS DATA.::MAP PTS;
RUN; ID COUNTY; - -
CHORO COUNTY I COUTLINE=BLACK? DISCRETE NOLEGEND
PRoe SORT DATA=WR SOOOM; BY DESCENDING EASTING NORTHING; ANNOTATE=WR....!3NDRY;
RUN; - PATTERNl V=E;
PATTERN2 V=E;
DATA SOUTH; SET WE SOOOM; BY DESCENDING EASTING; TITLEl H=3;
RETAIN KNT 0; - TITLE2 H=3;
IF FIRST,.EASTING THEN DO; RUN;
KNT==KNT+l;
SIDE==2;
OUTPUT SOUTH;
END;
RUN; CONCLUSION
PRoe SORT DATA=WR SOOOM; BY NORTHING EASTING; We feel this paper has illustrated the useful-
RUN; -
ness of combining UTM referenced data with the
DATA WEST; SET WE 5000M; BY NORTHING; powerful features of SAS/GRAPH to improve Forest
RETAIN KNT 0; - Survey data reporting. The previous examples
IF FIRST. NORTHING THEN DO; represent just the beginning of a new era of
KNT=KNT+l; Forest Survey data display.
SIDE=3;
OUTPUT WEST;
END;
RUN;
493
REFERENCES
U.S. Department of Defense, Army. Universal
transverse mercator grid. Technical Manual TM
5-241-8. Washington, DC: U.S. Department of
Defense, Army, Headquarters Department of the
Army; 1973. 64 p.
Lloyd, W.R. [Documentation of UTM easting,
northing conversion to latitude, longitude]
1985 December 12. Located at: U.S. Department
of Interior, Geological Survey, National
Mapping Division, Menlo Park, CA.
Claire, C.N. State plane coordinates by automatic
data processing. Publication 62-4. Washington,
DC: U.S. Department of Commerce, Coast and
Geodetic Survey, 1968. 68 p.
SAS Institute, Inc. SAS(GRAPH user's guide,
version 5 edition. Cary, NC: SAS Institute,
Inc., 1985. 596 pp.
Paper presented at SUGI 12, Dallas, TX, February
8-11, 1987. David C. Chojnacky is a Research
Forester and Ronald P. Tymcio is a Computer
Programmer; both are with Intermountain Research
Station, Forest Service, U.S. Department of
Agriculture, Ogden, UT 84401. Telephone: (801)
625-5388
SAS and SAS(GRAPH are registered trademarks of
SAS Institute Inc., Cary, NC, USA.
494