Chapter Contents

Previous

Next
Using Spatial Data with SAS/GIS Software

COMPOSITE Statement

COMPOSITE operation composite-name </ options>;


Description

The COMPOSITE statement defines, modifies, or deletes associations between variables in the chains and nodes data sets. Once defined, composites can be referenced by other GIS procedure statements.

For example, if a spatial database contains the variables COUNTYL and COUNTYR that identify the chains' left and right values for a county ID variable, you could use the COMPOSITE statement to create a composite called COUNTY by associating the two spatial database variables. The COUNTY composite could then be used to define the county boundaries for the map.

Composites are stored in the currently specified spatial (GISSPA) entry. An error occurs if you submit a COMPOSITE statement when no spatial entry is currently selected.

Note:   Use the SPATIAL CONTENTS statement to view the composites for a spatial entry.  [cautionend]


COMPOSITE Statement Operations

In a COMPOSITE statement, the operation can be one of the following:

The following list contains descriptions of the COMPOSITE statement operations:

CREATE
Defines associations between variables in the chains and nodes data sets and stores these composites in the current spatial entry.

A warning is issued and processing of the current RUN group is halted if a composite with the specified name already exists. The COMPOSITE CREATE statement does not overwrite existing composites. Use COMPOSITE REPLACE to overwrite an existing composite.

Note:   Not all spatial database variables are composites of multiple SAS data set variables. Some composites represent a single SAS data set variable.  [cautionend]

DELETE
Deletes the specified composite from the current spatial entry.

No additional arguments (other than the composite name) are used with this operation. A warning is issued and processing of the current RUN group is halted if the specified composite does not exist.

Note:   The DELETE operation of the COMPOSITE statement removes a composite from the spatial entry but does not delete the SAS variables from their respective SAS data sets.  [cautionend]

For the DELETE operation, you can also specify the following alternative forms for the composite-name argument:

CAUTION:
Use DELETE with care. The GIS procedure does not prompt you to verify the request before deleting an existing composite. Be especially careful when you use _ALL_.  [cautionend]

REPLACE
Overwrites the previous definition of a composite in the current spatial entry, or creates a new composite if the specified composite-name did not previously exist.

UPDATE
Applies new values for the specified arguments to an existing composite.

A warning is issued and processing of the current RUN group is halted if there is no existing composite with the specified name.

composite-name
In a COMPOSITE statement, the composite-name argument names the composite that you want to create, replace, delete, or update.

The composite-name value must conform to the rules for SAS names:


COMPOSITE Statement Optional Arguments

When you specify CREATE, REPLACE, or UPDATE for operation in a COMPOSITE statement, you can specify one or more of these options to follow the composite-name.

Note:   Separate the list of options from the composite-name with a slash (/).  [cautionend]

The following list contains descriptions of the additional COMPOSITE statement options:

BILATERAL
Indicates that the composite is a left/right type. BILATERAL composites are used to define polygonal layers in a LAYER statement. This argument provides an implicit VAR= argument, where the LEFT= and RIGHT= variable names are constructed by appending L and R to the specified composite name. For example, the following two statements are equivalent:
composite create state / class=area bilateral;
composite create state / class=area 
                         var=(left=statel,right=stater);

CLASS=class-type
Defines the role of the composite in the spatial database. The CLASS= option links specific functionality to particular composites. The default is CLASS=CLASSIFICATION. See CLASS=Class-Type for more information on the CLASS type values.

VAR=association-declaration
Defines a variable or an association between related variables in the current spatial chains or nodes data set. Variables for all composites are assumed to be in the chains data set except for CLASS=X and CLASS=Y variables, which must be in the nodes data set.

The VAR= argument is required when you use the CREATE or REPLACE operations, except in the following circumstances:


CLASS=Class-Type

The class-type for the CLASS= option can be one of the following:

The following list contains descriptions of the CLASS=Class-type arguments:

ADDRESS
Indicates that the composite defines addresses in the chains data set that is used for geocoding.

Data set address values are the numeric portion of a street address, for example, the 100 in the street address, 100 North Main Street. A chain has four values to define the address range for each side:
FROMLEFT Beginning address on the left side
TOLEFT Ending address on the left side
FROMRIGHT Beginning address on the right side
TORIGHT Ending address on the right side.

When you use specify ADDRESS for the class-type value, you must use the following form of the VAR= argument:

VAR=(<FROMLEFT=>variable, <FROMRIGHT=>variable,
<TOLEFT=>variable, <TORIGHT=>variable)

AREA
Indicates that the composite defines polygonal areas.

For polygonal areas that represent political subdivisions, you can specify the following alternative class-type values to indicate which features the areas represent:

COUNTRY
Indicates that the composite defines countries in the chains data.

COUNTY
Indicates that the composite defines counties in the chains data.

STATE
Indicates that the composite defines states in the chains data. Composites of this class are used in geocoding.

When you use AREA (or COUNTRY, STATE, or COUNTY) for the class-type value, you must specify the bilateral form of the VAR= argument to specify the variables that identify the features on the left and right sides of each chain in the area:

VAR=(<LEFT=>variable, <RIGHT=>variable)

CITY | PLACE
Indicates that the composite defines features that are related to geographic location, such as cities. Composites of this class are used in geocoding.

By default, CITY is not considered an AREA-type composite. If your spatial data contain closed city boundaries, you must explicitly define the composite as an AREA class as well:

composite create towns / var=(cityl cityr) class=(city area);

CLASSIFICATION
Indicates that the composite defines a general descriptive value that can be used to classify features in the map.

Note:   In order to create new point layers when you add points to the map interactively in the GIS Map window, you must define at least one CLASSIFICATION-type composite in the spatial entry.  [cautionend]

DIRECTION_PREFIX
Indicates that the composite defines the directional prefix component of an aggregate feature name, such as the North in North Main Ave. Composites of this class are used in geocoding.

DIRECTION_SUFFIX
Indicates that the composite defines the direction suffix component of an aggregate feature name, such as the South in 2nd St South. Composites of this class are used in geocoding.

NAME
Indicates that the composite defines the names of features in the chains data, such as Central Park, or the name component of an aggregate feature name, such as the Main in E Main St. Composites of this class are used in geocoding.

PLUS4
Indicates that the composite defines extended postal delivery codes (U.S. ZIP+4) in the chains data. Composites of this class are used in address matching.

By default, PLUS4 is not considered an AREA-type composite. If your chains data contain closed ZIP+4 boundaries, you must explicitly define the composite as an AREA class as well:

composite create zip4 / var=(zip4l zip4r) class=(area plus4);

TYPE
Indicates that the composite defines the feature type component of an aggregate feature name, such as the Ave in N Harrison Ave. Composites of this class are used in geocoding.

X
Indicates that the composite defines the X coordinates for the nodes in the nodes data set.

Y
Indicates that the composite defines the Y coordinates for the nodes in the nodes data set.

ZIPCODE
Indicates that the composite defines postal delivery codes in the chains data. Composites of this class are used in geocoding.

By default, ZIPCODE is not considered an AREA-type composite. If your chains data set contains closed ZIP code area boundaries, you must explicitly define the composite as an AREA class as well:

composite create zip / var=(zipl zipr)
                       class=(zipcode area);


VAR=association-declaration

The association-declaration argument for the VAR= option can be one of the following, depending on the class-type values that are specified in the CLASS= option:

variable
Declares a composite consisting of a single SAS variable. Use this form for single-variable association classes such as CLASSIFICATION, DIRECTION_PREFIX, DIRECTION_SUFFIX, NAME, TYPE, X, and Y.

(<LEFT=>variable-1, <RIGHT=>variable-2)
Declares a composite consisting of two variables that represent the left and right sides of a feature. Association declarations of this form can be used to define the boundaries between elements in the spatial data. Use this form for bilateral association classes such as AREA, CITY, COUNTRY, COUNTY, PLACE, STATE, ZIPCODE, and PLUS4.

(<FROMLEFT=>variable-1, <FROMRIGHT=>variable-2, <TOLEFT=>variable-3, <TORIGHT=>variable-4)
Declares a composite that consists of four variables that separately represent the left and right sides of a feature. Association declarations of this form can be used to define the locations of specific addresses in the spatial data. Use this form for the ADDRESS class.

Variable is the name of a SAS data set variable in the chains data set. An error occurs if any of the specified variables do not exist in the chains data set.


COMPOSITE Statement Examples

Define a single-variable composite

The following code fragment associates the class Y with the variable named LAT in the nodes data set to indicate that the variable contains north-south coordinate information:

composite create latitude / var=LAT class=y;
run;

Define a composite for a bilateral feature

Either of the following code fragments associates a pair of variables in the chains data set that contain values for the left and right sides of area boundaries:

composite create state / var=(left=statel,right=stater)
                         class=area;
run;
composite create state/ bilateral
                        class=area; 
run;

Define a composite for an address feature

The following code fragment associates two pairs of variables in the chains data set that contain values for the corners of address boundaries:

composite create custadd / 
   var=(fromleft=FRADDL,fromright=FRADDR,
        toleft=TOADDL,toright=TOADDR)
   class=address;
run;


Chapter Contents

Previous

Next

Top of Page

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