Chapter Contents


Using Spatial Data with SAS/GIS Software

Data in SAS/GIS Applications

SAS/GIS software uses two basic types of data:

Spatial Data
Contain the coordinates and identifying information describing the map features such as streets, rivers, and railroads.

Attribute Data
Are the information that you want to use for analysis or presentation. This information must be spatial in nature. Sales figures for each of your store locations, population data for each county, and total income for each household in a region are examples of information that are spatial in nature because the information applies to a specific geographic feature.

For example, the U.S. Census Bureau distributes both types of data:

TIGER Line files
Contain spatial information that you can use to build maps.

Summary Tape files
Contain population and other demographic information that you can link to the map features.

Attribute data provide the information that you want to analyze, and spatial data provide the context in which you want to analyze it. For example, consider the SAS/GIS map shown in Spatial and Attribute Data in SAS/GIS Maps. Spatial data provide the boundaries for the map areas, and attribute data provide the population information that is used to color the map areas.

Spatial and Attribute Data in SAS/GIS Maps


Spatial Data

Spatial data contain the coordinates and identifying information that is necessary to draw maps. For SAS/GIS software, spatial data are stored in SAS/GIS spatial databases, which consist of collections of SAS data sets and SAS catalog entries. The primary method for creating a SAS/GIS spatial database is through the SAS/GIS Import facility, either in batch or in interactive mode. You can also use the GIS procedure to create, modify, and manage the catalog entries in a spatial database.

Features in the spatial data are organized into layers. A layer is a collection of all the features in the map that share some common characteristic. The various physical aspects of the map--political boundaries, roads, railroads, waterways, and so forth--are assigned to layers according to their common spatial data values. Some features can appear in multiple layers. For example, a street can also be a ZIP code boundary and a city boundary line. The street could appear in three layers: one containing the streets, one containing the ZIP code boundaries, and one containing the city boundaries.

Three types of layers can be represented in SAS/GIS maps: points, lines, and areas. For example, the collection of all the points in the map that represent park locations can be organized into a point layer for parks, the collection of all the lines in the map that represent streets can be organized into a line layer for streets, and the collection of all the areas that represents census tracts can be organized into an area layer for tracts. When the various layers are overlaid, they form a map, as shown in Layers Forming a SAS/GIS Map.

Layers Forming a SAS/GIS Map


A layer can be displayed as either static or thematic. When a layer is displayed as static, it uses the same graphical characteristics (color, line, width, and so forth) for all features in that layer. For example, a street layer could use the same color and line style to display all the streets. When a layer is displayed as thematic, it uses different graphical characteristics to classify the features in that layer. For example, a theme representing sales regions could use different colors to show the quarterly sales performance of each region. A theme in a layer representing highways could use different line widths to show the classes of roads. A layer can have multiple themes stored in it, and you can easily change which theme is currently displayed.

In SAS/GIS software, maps display only the portion of the spatial data that falls within a given coverage. A coverage defines a subset of the spatial data that is available to a map. The coverage can include all the spatial data in the database, or only selected portions. For example, a spatial database may contain geographic data for an entire country, but a coverage may restrict the portion that is available for a given map to only one region. You can define more than one coverage for each spatial database, although a map uses only one coverage at a time.

Most operations in SAS/GIS software use composites of spatial data variables rather than the actual spatial data variables themselves. Composites identify the relationships and purpose of the variables in the spatial data.

For example, if the spatial data have variables STATEL and STATER that contain the state ID codes for the left and right sides of each feature, then the spatial database could define a composite named STATE that identifies the relationship between these variables and specifies that they delineate state areas in the map. You would use the STATE composite, rather than the actual STATEL and STATER variables, to link state areas in the map to attribute data for the corresponding state.

See Details of SAS/GIS Spatial Databases for more information about the structure of SAS/GIS spatial databases.

Attribute Data

The second type of data that are used in a GIS is attribute data. In SAS/GIS software, your attribute data must be stored in either a SAS data set or a SAS view. SAS views allow you to transparently access data in other formats. For example, you can create a SAS/ACCESS view to access data in a database such as DB2 using the SAS/ACCESS to DB2 software. A DATA step view or an SQL view also allows you to access an external file, or any other type of data for which you can create a SAS view. Once your data are accessible either as a SAS data set or through a SAS view, they can be linked to your spatial data for use in labeling, analysis through an action, or theming. For instance, your spatial data might represent a county and contain information for city boundaries, census tract boundaries, streets, and so forth. An attribute data set with population information for each census tract can be linked to a map using the corresponding tract composite in the spatial data.

Some of the ways in which you can use attribute data in SAS/GIS software include the following:

Actions can be defined to do the following:

See Chapter 4, "Performing Actions for Selected Map Features" in SAS/GIS Software: Usage and Reference, Version 6 for more information on defining and performing actions.

Designing a SAS/GIS Spatial Database

One of the first steps in a SAS/GIS project is determining the design of your SAS/GIS spatial database. The database should include all of the spatial data that the user wants to see and all of the associated attribute data that the user needs to use for analysis or presentation purposes.

Although your first tendency with a new software product may be to begin using it immediately after you install it, take some time to draw up an overview of the system goals and data requirements that you will need for your database before you begin creating it. Do not rush into building your database. The time you spend designing your database initially will save you time and expenses later in the project. Remember, a well-designed database is easier to maintain and document, and you can extend it for future GIS projects.

Use the following guidelines when determining the information you want to include in a database:

Once you have determined a preliminary list of the data that you will need, use these additional factors to help evaluate and refine your list:

Chapter Contents



Top of Page

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