Chapter Contents

Previous

Next
Using Spatial Data with SAS/GIS Software

Importing Your Spatial Data

Suppose you are given the task of determining average household income by county for the states of North Carolina and South Carolina, based on the information that is collected in the MAPS.USAAC sample attribute data set that is provided with SAS/GIS software. For each U.S. county, this data set has an observation that includes the following variables:
STATE The FIPS (Federal Information Processing System) code for the state. See "Using FIPS Codes and Province Codes" in SAS/GRAPH Software for more in formation on FIPS codes.
COUNTY The FIPS code for the county.
AHI89 A 1989 estimate of average household income.

In order to analyze the data in MAPS.USAAC, you need a map with corresponding state and county boundaries and compatible identifier values. The MAPS.COUNTY map data set that is supplied with SAS/GRAPH software has coordinates for U.S. state and county boundaries and also uses FIPS codes to identify states and counties, so it is a compatible source of spatial data.

To extract map data that contain only the required states, submit the following in the Program Editor window:

data work.ncsc;
   set maps.county;
   where state in (37 45);  /* FIPS codes for NC and SC */
run;

To import the spatial data, open the GIS Spatial Data Importing window with the following selections from the GIS Map window's menu bar:

File
[arrow]
Import

Specify the following information in the appropriate fields of the GIS Spatial Data Importing window.
Import Type SASGRAPH
SAS/GRAPH data set WORK.NCSC
ID Vars STATE and COUNTY
Map Entries
Library SASUSER
Catalog NCSC
Name NCSC
Action Create
Spatial Data Sets
Library SASUSER
Name NCSC
Action Create

SAS/GIS Spatial Data Importing Window contains an example of the GIS Spatial Data Importing window with the information correctly entered in the fields.

SAS/GIS Spatial Data Importing Window

[IMAGE]

After entering these values, select [Import] to begin importing the spatial data.

When you receive the message, "Import complete. Close this window to display the map," select [Close] to close the GIS Spatial Data Importing window. The imported map is now displayed in the GIS Map window, as shown in Initial Display of Imported SAS/GRAPH Map.

Initial Display of Imported SAS/GRAPH Map

[IMAGE]

Note:   For more information on importing spatial data from other formats, see Importing Spatial Data.  [cautionend]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.