(View the complete code for this example.)
This example shows how to use a bounding box (by specifying the BBOX= option) to define the geographic area to retrieve a preliminary local storm report (PLSR) starting May 5 and ending May 10 (not including May 10). The output is shown in Output 50.2.1 for the data set My8bb and in Output 50.2.2 for the data set My8bb_M.
options validvarname=any;
title 'Retrieve the NOAA SWDI PLSR Data for a Bounding Box';
libname mylib "/sasusr/noaa/doc/";
libname noaa sasenoaa "%sysget(NOAA_DATA)"
noaaset=plsr
range='20060505:20060510'
bbox='-91,30,-90,31'
id='427200'
outXml=my8BB
automap=replace
mapref=MyMap
xmlmap="%sysget(NOAA_DATA)my8BB.map"
format=xml
;
data mylib.PLSRbb;
set noaa.my8BB;
run;
proc contents data=mylib.PLSRbb; run;
proc print data=mylib.PLSRbb; run;
Output 50.2.1: Preliminary Local Storm Report for a Bounding Box with the RANGE= Option
| Retrieve the NOAA SWDI PLSR Data for a Bounding Box |
| Obs | ztime | id | event | magnitude | city | county | state | source | shape |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 2006-05-09T02:20:00 | 427540 | HAIL | 1 | 5 E KENTWOOD | TANGIPAHOA | LA | TRAINED SPOTTER | POINT (-90.43 30.93) |
| 2 | 2006-05-09T02:40:00 | 427536 | HAIL | 1 | MOUNT HERMAN | WASHINGTON | LA | TRAINED SPOTTER | POINT (-90.3 30.96) |
| 3 | 2006-05-09T02:40:00 | 427537 | TSTM WND DMG | -9999 | MOUNT HERMAN | WASHINGTON | LA | TRAINED SPOTTER | POINT (-90.3 30.96) |
| 4 | 2006-05-09T03:00:00 | 427199 | HAIL | 0 | FRANKLINTON | WASHINGTON | LA | AMATEUR RADIO | POINT (-90.14 30.85) |
| 5 | 2006-05-09T03:17:00 | 427200 | TORNADO | -9999 | 5 S FRANKLINTON | WASHINGTON | LA | LAW ENFORCEMENT | POINT (-90.14 30.78) |
The RANGE= option selects only the storm reports for dates from May 5 to May 10, 2006 (not including May 10), and the BBOX= option limits the data returned to the geographic area defined by the intersection of the specified coordinates: minimum longitude,
minimum latitude, maximum longitude, and maximum latitude. The ID='427200' option returns additional data in the SAS data set my8bb_M for the storm event that has that ID, and the results can be viewed using the following sample code.
Note: The SASENOAA engine appends _M to the name specified in the OUTXML= option for these additional data.
libname myreport "/sasusr/noaa/test/";
proc contents data=myreport.my8bb_m; run;
proc print data=myreport.my8bb_m; run;
Output 50.2.2: Preliminary Local Storm Report for Tornado Event, ID=427200
| Retrieve the NOAA SWDI PLSR Data for a Bounding Box |
| Obs | remarks | swdiXmlResponse_ORDINAL | result_ORDINAL |
|---|---|---|---|
| 1 | TORNADO MOVED ACROSS HWY 25 BLEW TWO CARS IN THE DITCH AND DEBRIS ON HWY. | 1 | 1 |