Chapter Contents

Previous

Next
Working with Spatial Data Using SAS/GIS Software

COMPOSITE Statement

COMPOSITE operation composite-name </ arguments>;


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, 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:   You can use the SPATIAL CONTENTS statement to view the composites for a spatial entry.   [cautend]


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
CREATE defines associations between variables in the chains and nodes data sets and stores these associations 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. However, even those that are represented by a single SAS data set variable must be declared with a COMPOSITE CREATE statement if you want to use them in a GIS statement (such as a LAYER statement to define a LAYER entry).   [cautend]

DELETE
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 using the _ALL_ keyword.   [cautend]
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 COMPOSITE DELETE statement removes a composite from the spatial entry but does not delete the SAS variables from their respective SAS data sets.   [cautend]

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

REPLACE
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
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 you want to create, replace, delete, or update.

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


Optional Arguments

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

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

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

BILATERAL
BILATERAL indicates that the composite is a left/right type. 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);

Note:   BILATERAL composites are used to define polygonal layers in a LAYER statement.   [cautend]

CLASS
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.

VAR
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 keywords, 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:

CLASS=ADDRESS
ADDRESS indicates that the composite defines addresses in the chains data set.

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)

CLASS=AREA
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 address matching.

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)

CLASS=CITY | PLACE
CITY | PLACE indicates that the composite defines features related to geographic location, such as cities. Composites of this class are used in address matching.

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

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

CLASS=CLASSIFICATION
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 adding points to the map interactively in the GIS Map window, at least one CLASSIFICATION-type composite must be defined in the spatial entry.   [cautend]

CLASS=DIRECTION_PREFIX
DIRECTION_PREFIX indicates that the composite defines the directional prefix component of an aggregate feature name, such as the North in North Main Ave.

CLASS=DIRECTION_SUFFIX
DIRECTION_SUFFIX indicates that the composite defines the direction suffix component of an aggregate feature name, such as the South in 2nd St South.

CLASS=NAME
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.

CLASS=PLUS4
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 contains 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);

CLASS=TYPE
TYPE indicates that the composite defines the feature type component of an aggregate feature name, such as the Ave in N Harrison Ave.

CLASS=X
X indicates that the composite defines the X coordinates for the nodes in the nodes data set.

CLASS=Y
Y indicates that the composite defines the Y coordinates for the nodes in the nodes data set.

CLASS=ZIPCODE
ZIPCODE indicates that the composite defines postal delivery codes in the chains data. Composites of this class are used in address matching.

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=ssociation-declaration
The association-declaration argument for the VAR= option can be one of the following, depending on the class-type values 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 which 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 consisting 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 fragment 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=elmbegl,fromright=elmbegr,
       toleft=elmendl,toright=elmendr)
   class=address;
run;


Chapter Contents

Previous

Next

Top of Page

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