Chapter Contents

Previous

Next
Using Spatial Data with SAS/GIS Software

LAYER Statement

LAYER operation <libref.catalog.>layer-entry </ options>;


Description

The LAYER statement

A layer entry is a SAS catalog entry of type GISLAYER that stores information about a layer in a map. Each layer represents a different set of features on the map and defines how the features are displayed. For example, you could create a layer entry named RIVERS to represent the water features in your spatial data.

Layers can be displayed as either static or thematic. When a layer is displayed as static, it has a fixed set of graphical attributes (fill colors, outline colors, and so forth) for all of the features in that layer. When a layer is displayed as thematic, it uses values of a response variable in an associated attribute data set to determine the graphical attributes for the layer. Information about the theme value ranges and the attribute data is stored in the layer entry.


LAYER Statement Operations

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

The following list contains descriptions of the LAYER statement operations:

CONTENTS
Displays the characteristics of the specified layer entry in the OUTPUT window, including the WHERE clause that defines the layer and lists of the layer's parameters and graphical attributes.

An error occurs if the specified layer entry does not exist.

CREATE
Creates a new layer entry to define a particular set of features in the spatial database.

An error occurs if a layer entry with the specified name already exists. The LAYER CREATE statement does not overwrite existing layer entries. Use LAYER REPLACE to replace an existing entry.

For a LAYER CREATE statement, you must also specify either the COMPOSITE= argument or the WHERE= argument. (For area layers, you must use the COMPOSITE= argument.)

DELETE
Removes the specified layer entry.

No additional arguments (other than the layer entry name) are used with this operation. An error occurs if the specified layer entry does not exist.

For the DELETE operation, you can also specify the special value _ALL_ for the layer-entry name to delete all layer entries in the current catalog.

Note:   You must specify a new layer list for any map entries that refer to the deleted layer entry.  [cautionend]

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

REPLACE
Overwrites the specified layer entry or creates a new layer entry if an entry with the specified name does not exist. The LAYER REPLACE statement has the effect of canceling the previously issued LAYER CREATE statement for the specified layer entry.

For a LAYER REPLACE statement, you must also specify either the COMPOSITE= argument or the WHERE= argument. (For area layers, you must use the COMPOSITE= argument.)

UPDATE
Modifies the specified layer entry by applying new values for specified arguments.

An error occurs if there is no existing layer entry with the specified name.


Layer-Entry Name

In a LAYER statement, the layer-entry name identifies the layer entry that you want to create, delete, replace, or update. The general form of the argument is

<libref.catalog.>layer-entry

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


LAYER Statement Optional Arguments

When you specify CONTENTS, CREATE, REPLACE, or UPDATE for operation in a LAYER statement, you can specify one or more of the after additional arguments after the layer entry name.

Note:   Separate the list of arguments from the layer-entry name with a slash (/).  [cautionend]

The following list contains descriptions of additional LAYER statement arguments:

COMPOSITE=composite-name
Specifies a composite that defines the common characteristic of the features in the layer. The COMPOSITE= argument is an alternative to specifying a WHERE clause by using the WHERE= argument. For example, if you use specify COMPOSITE=STATE in the LAYER statement and the composite named STATE was created with the variable association VAR=(LEFT=STATEL,RIGHT=STATER), then the implied WHERE clause for the layer is WHERE STATEL NE STATER.

Note:   Either the COMPOSITE= argument or the WHERE= argument is required when you use the CREATE or REPLACE keyword. For area layers, you must use the COMPOSITE= argument.  [cautionend]

DESCRIPTION='string'
Specifies a descriptive phrase, up to 256 characters long, that is stored in the description field of the layer entry. The default description is blank.

DETAILON=scale-value
Specifies the scale at or below which detail coordinates are displayed, provided that detail points are available. This argument helps keep the detail level of a layer to a minimum when the map is zoomed to a large scale. By default, detail is displayed at all scales when detail is turned on.

Note:   The DETAILON= argument is effective only when detail coordinates are read for the layer. The DETAILS argument controls whether detail coordinates are read.  [cautionend]

DETAILS | NODETAILS
Specifies whether the detail coordinates are read for this layer. The default is NODETAILS.

If you specify DETAILS to read the detail coordinates from the database, you can use the DETAILON= argument to control the scale at which the detail coordinates are actually displayed.

MAP=<libref.catalog.>map-entry
Identifies a GISMAP-type entry that provides theme information for layers that are created in SAS/GIS in Release 6.11 of the SAS System. This option is ignored for layers that are generated by later releases of SAS/GIS. For thematic layers, the link to the associated data set and the name of the response variable for the theme are stored in the map entry rather than in the layer entry. If you omit this argument, the LAYER CONTENTS statement is unable to provide thematic display information for layers that were created in SAS/GIS in Release 6.11 of the SAS System.

Note:   The MAP= argument is valid only in conjunction with the CONTENTS and UPDATE operations and is the only option that is permitted with the CONTENTS operation.  [cautionend]

LABELON=scale-value
Specifies the numeric scale at or below which map labels are displayed. This argument helps keep the number of items in the map window to a minimum when the map is zoomed to a large scale. By default, labels are displayed at all scales.

OFFSCALE=scale-value
Specifies the numeric scale at or below which the layer display is turned off. When you zoom in below the specified scale, the layer is hidden. When you zoom out beyond the specified scale, the layer is displayed. By default, the layer is displayed at all zoom scales.

Note:   If you specify both the OFFSCALE= and ONSCALE= arguments, the scale-value for OFFSCALE= must be less than the scale-value for ONSCALE=.  [cautionend]

ONSCALE=scale-value
Specifies the numeric scale at or below which the layer display is turned on. When you zoom in below the specified scale, the layer is displayed. When you zoom out beyond the specified scale, the layer is hidden. This argument helps prevent clutter by enabling you to suppress selected layers when the map is zoomed to a large scale. By default, the layer is displayed at all zoom scales.

Note:   If you specify both the ONSCALE= and OFFSCALE= arguments, the scale-value for ONSCALE= must be greater than the scale-value for OFFSCALE=.  [cautionend]

STATIC
Toggles the current theme off so that it is not displayed when the map is opened. It does not remove the theme from the layer entry. If the layer has no theme, STATIC is ignored. The default appearance of a newly created layer is STATIC. Static graphical attributes can be modified with the DEFAULT=(...) option as described later in this section.

THEMATIC
Toggles the current theme in the layer on so that it is displayed when the map is opened. If the layer has no theme, this option has no effect. Use the THEME=(...) option to create a theme in a layer. See THEME= later in this section for more information.

TYPE=POINT | LINE | AREA
Specifies the type of layer. The TYPE argument affects how the layer is displayed in a map. The default is TYPE=LINE.

POINT
The layer's features are discrete points and have no length or area associated with them. If a POINT feature has left and right attributes, the values of the attributes must be identical.

LINE
The layer's features have length, and they can have different values for their left and right attributes. However, a LINE feature can enclose an area, even though it is displayed as a line.

AREA
The layer's features have length and area associations and the layer is displayed as enclosed polygons.

Note:   Each area layer must have a polygonal index for the composite that defines the area boundaries.   [cautionend]

UNITS=unit-specification
Specifies the scale units for subsequent ONSCALE=, OFFSCALE=, and DETAILON= argument values. The default is UNITS=METRIC (for example, kilometers per centimeter).

Unit-specification can be one of the following:

ENGLISH
Selects nonmetric as the scale units, for example, miles per inch or feet per inch.

METRIC
Selects metric as the scale units, for example, kilometers per centimeter or meters per centimeter.

real-units/map-units
Selects a user-defined combination of units. Valid values for real-units and map-units are as follows:

  • KM | KILOMETER | KILOMETERS

  • M | METER | METERS

  • CM | CENTIMETER | CENTIMETERS

  • MI | MILE | MILES

  • FT | FOOT | FEET

  • IN | INCH | INCHES

The value of real-units is typically KM, M, MI, or FT, and the value of map-units is usually either CM or IN.

WHERE=('where-string-1' <... 'where-string-n'>)
Specifies a WHERE clause that subsets the chains data set to define a geographic layer of a spatial database. Where-string can contain a complete valid WHERE expression of 200 characters or fewer.

To specify a WHERE expression greater than 200 characters, you must break the expression into separate quoted strings. When WHERE= is processed, the strings are concatenated, with a space between each string, and the entire expression is evaluated.

If you are using multiple strings, each string does not have to contain a complete WHERE expression, but the concatenated expression must be valid.

You can use any of the variables in the chains data set in the WHERE expressions, not just the coordinate variables. However, the layer definition must not delineate a bounded geographic region, but rather a particular subset of the spatial data that is independent of the coverage. For example, a STREETS layer may apply to all the spatial data, even if streets do not exist in many areas. You can use only the variables in the WHERE expression, not composites. Specify WHERE='1' to define a layer that contains all the features in the map.

Note:   Either the WHERE= argument or the COMPOSITE= argument is required when you use the CREATE or REPLACE operation. For area layers, you must use the COMPOSITE= argument. If you use the WHERE= argument, the default layer type is LINE.  [cautionend]

FORCE
Allows you to create more than one theme by using the same variable from the same attribute data set.

DEFAULT=
Is used to define the static appearance of a layer. Within the DEFAULT= argument, you indicate the appropriate appearance options for the layer.

DEFAULT= options:

POINT=
Defines the static appearance of the symbols in a point layer. This option allows you to specify the color, size, font, and a specific character to be used for the symbols. It is valid only when TYPE=POINT is in the layer definition.

POINT= syntax:

DEFAULT = (
   POINT = (COLOR = color
            SIZE = [1..21]
            FONT=font-name
            CHARACTER='character' ));

POINT= arguments:
COLOR= Specifies the color of the point symbol. COLOR= must specify a predefined SAS color name, an RGB color code in the form CXrrggbb, an HLS color code in the form Hhhhllss, or a gray-scale color code in the form GRAYll. For more information about color-naming schemes, see "SAS/GRAPH Colors" in SAS/GRAPH Software: Reference. The default color is BLACK.
SIZE= Specifies the size of the point symbol. SIZE= must specify an integer that is greater than or equal to 1, and less than or equal to 21. The default size is 8.
FONT= Specifies the font to use for the point symbol. FONT= must specify a valid fontname. The default font is MARKER. Font verification can be overridden by using the FORCE option on the LAYER statement.
CHARACTER= Specifies the character to use for the point symbol. CHARACTER= must specify a single character in quotes. The default character is 'W', which in the MARKER font represents a "dot."

LINE=
Defines the static appearance of the lines in a line layer. Allows you to specify the color, width, and style to be used for the lines. Valid only when TYPE=LINE is in the layer definition.

LINE= syntax:
DEFAULT = (LINE = (COLOR = color 
                   WIDTH = [1..20]   
                   STYLE = SOLID | DASHED | DOTTED));

LINE= arguments:
COLOR= Specifies the color of the line. COLOR= must specify a predefined SAS color name, an RGB color code in the form CXrrggbb, an HLS color code in the form Hhhhllss, or a gray-scale color code in the form GRAYll. For more information about color-naming schemes, see "SAS/GRAPH Colors" in SAS/GRAPH Software: Reference. The default color is BLACK.
WIDTH= Specifies the width of the line. WIDTH= must specify an integer that is greater than or equal to 1, and less than or equal to 20. The default width is 1.
STYLE= Specifies the style of the line. STYLE= must specify either SOLID, DASHED, or DOTTED. The default style is SOLID.

CENTERLINE=
Defines the static appearance of the optional centerline in a line layer. The option allows you to specify whether a centerline is displayed as well as the color, width, and style to be used for the centerlines. It is valid only when TYPE=LINE in the layer definition.

CENTERLINE= syntax:
     DEFAULT = (CENTERLINE = (ON | OFF
                              COLOR = color
                              WIDTH = [1..20]
                              STYLE = SOLID | DASHED | DOTTED));

CENTERLINE= arguments:
ON | OFF Specifies whether the optional centerline is displayed. The default is OFF.
COLOR= Specifies the color of the centerline. COLOR= must specify a predefined SAS color name, an RGB color code in the form CXrrggbb, an HLS color code in the form Hhhhllss, or a gray-scale color code in the form GRAYll. For more information about color naming schemes, see "SAS/GRAPH Colors" in SAS/GRAPH Software: Reference. The default color is BLACK.
WIDTH= Specifies the width of the centerline. WIDTH= must specify an integer that is greater than or equal to 1 and less than or equal to 20. The default width is 1.
STYLE= Specifies the style of the centerline. STYLE= must specify either SOLID, DASHED, or DOTTED. The default style is SOLID.

AREA=
Defines the static appearance of the area fills in an area layer. Area allows you to specify the color and fill style as well as angle and spacing parameters for hatched and crosshatched fill styles. It is valid only when TYPE=AREA in the layer definition.

AREA= syntax:
DEFAULT = (AREA = (COLOR = color
                   STYLE = EMPTY | FILLED | HATCH | CROSSHATCH 
                   ANGLE = angle-value
                   SPACING = [2..10] ));

AREA= arguments:
COLOR= Specifies the fill color of the area. COLOR= must specify a predefined SAS color name, an RGB color code in the form CXrrggbb, an HLS color code in the form Hhhhllss, or a gray-scale color code in the form GRAYll. For more information about color-naming schemes, see "SAS/GRAPH Colors" in SAS/GRAPH Software: Reference. The default color is GRAY.
STYLE= Specifies the fill style of the area. STYLE= must specify either EMPTY, FILLED, HATCH, or CROSSHATCH. The default style is FILLED, which means the area contains one, solid color.
ANGLE= Specifies an angle for hatched and crosshatched lines. ANGLE= must specify a real number that is greater than or equal to zero and less than 90 (for crosshatch), or greater than or equal to zero and less than 180 (for hatch). The default angle for both the hatch and crosshatch is 0.
SPACING= Specifies the spacing between hatched lines or crosshatched lines. SPACING= must specify an integer that is greater than or equal to 2 and less than or equal to 10. The lower the number, the less space between lines (the higher the number, the more space between lines). The default spacing is 7.

OUTLINE=
Defines the appearance of the area outlines in an area layer. The option allows you to specify the color, width, and style to be used for the outlines. It is valid only when TYPE=AREA is in the layer definition.

OUTLINE= syntax:

DEFAULT = (OUTLINE = (ON | OFF
                      COLOR = color
                      WIDTH = [1..20]
                      STYLE = SOLID | DASHED | DOTTED));

OUTLINE= arguments:
ON | OFF Specifies whether the area outline is displayed. The default is ON.
COLOR= Specifies the color of the outline. COLOR= must specify a predefined SAS color name, an RGB color code in the form CXrrggbb, an HLS color code in the form Hhhhllss, or a gray-scale color code in the form GRAYll. For more information about color-naming schemes, see "SAS/GRAPH Colors in SAS/GRAPH Software: Reference. The default color is BLACK.
WIDTH= Specifies the width of the outline. WIDTH= must specify an integer that is greater than or equal to 1 and less than or equal to 20. The default width is 1.
STYLE= Specifies the style of the outline. STYLE= must specify either SOLID, DASHED, or DOTTED. The default style is SOLID.

Note:   The following THEME= list entry is an optional argument of the LAYER statement. It is not an option of the DEFAULT= optional argument of the LAYER statement.   [cautionend]

THEME =
THEME=(operations options) allows you to modify or delete existing themes or to create new themes. In the LAYER statement THEME argument, the operation argument can be one of the following:
CREATE
REPLACE
UPDATE
DELETE

The following list contains descriptions of the THEME= operations:

CREATE
Creates a new theme for the specified layer entry.

An error occurs if a theme already exists for the layer that uses the same variable in the same attribute data set, unless you also specify the FORCE option in the LAYER statement. The CREATE statement does not overwrite existing themes. Use REPLACE to replace an existing theme.

For a CREATE statement, you must also specify the LINK= and VAR= arguments.

REPLACE
Overwrites the specified theme for the layer entry. The REPLACE statement has the effect of canceling the previously issued CREATE statement for the specified layer entry.

For a REPLACE statement, you must also specify both the LINK= argument and the VAR= arguments.

UPDATE
Modifies the specified theme for the layer entry by applying new values for specified arguments.

An error occurs if the specified layer does not have at least one existing theme. For an UPDATE statement, you must specify a value for at least one of the arguments LINK=, VAR=, RANGE=, NLEVELS=, MAKE_CURRENT, or NOT_CURRENT.

If you do not specify LINK=, the current data set link is used. If you do not specify THEMEVAR=, the current thematic variable is used.

DELETE
Removes the specified theme from the specified layer entry.

For a DELETE statement, you must specify a value for THEMEVAR=varname or POSITION=integer. An error occurs if you specify THEMEVAR=varname and if a theme based on varname does not exist.

CAUTION:
Use DELETE with care. The GIS procedure does not prompt you to verify the request before it deletes the layer theme.  [cautionend]


Additional LAYER Statement Optional Arguments

When you specify CONTENTS, CREATE, REPLACE, or UPDATE for the operation keyword in a LAYER statement and specify THEME=, you can specify the following additional options.
LINK=link-name
THEMEVAR=var-name
RANGE= DEFAULT | DISCRETE | LEVELS
NLEVELS=integer
POSITION=integer
MAKE_CURRENT | NOT_CURRENT
COMPOSITE=(comp-name)
DATASET=<libref.>data-set
DATAVAR=(variable-name
POINT=(argument)
LINE=(argument)
CENTERLINE=(argument)
AREA=(argument)
OUTLINE=(argument)

The following list contains descriptions of the THEME= options:

LINK=link-name
Specifies the attribute data set containing the theme variable to be used. If you do not specify link-name and you are performing an update, the current data set link is used.

THEMEVAR=var-name
Specifies the theme variable in the linked attribute data set (specified in LINK=link-name). If you do not specify var-name and you are performing an update, the current theme variable is used.

THEMEVAR=var-name also specifies the theme to delete or to make current.

RANGE=DEFAULT | DISCRETE | LEVELS
Specifies the thematic range type.

DEFAULT
Increments are calculated automatically using an algorithm that is based on the 1985 paper by G.R. Terrell and D. W. Scott, "Oversmoothed Nonparametric Density Estimates" in the Journal of the American Statistical Association, Volume 80, pages 209-214.

DISCRETE
The range is treated as a series of discrete values instead of a continuous variable. If the variable that is specified in the VAR= argument is a character variable, only RANGE=DISCRETE is allowed.

LEVELS
The range is divided into evenly spaced increments. You do not have to specify RANGE=LEVELS if you specify NLEVELS=integer instead.

If you do not specify RANGE=, DEFAULT is used for numeric variables and DISCRETE is used for character variables.

NLEVELS=integer
Specifies the number of range levels in the theme. The value for NLEVELS must be an integer greater than one. You cannot specify both NLEVELS and RANGE=DEFAULT or RANGE=DISCRETE. If you specify NLEVELS, RANGE=LEVELS is assumed and can be omitted.

POSITION=integer
Specifies the position number of the target theme. POSITION=1 is the first theme, POSITION=2 is the second theme, and so on. Negative values of integer are the position number counting backward from the last theme. POSITION=-1 specifies the last theme; POSITION=-2 specifies the second to the last theme, and so on. POSITION=0 specifies the current theme, whatever position that theme is in the series.

If you do not specify a value for POSITION, new themes are created at the end of the theme list, UPDATE operations are performed on the last theme, and DELETE fails unless you specify the target theme with THEMEVAR=var-name.

If you use POSITION to specify a new theme position, layer-name must not already contain a theme at that position.

MAKE_CURRENT
Specifies that the specified theme is to be the current theme when the map opens. MAKE_CURRENT is the default when a theme is created or updated.

NOT_CURRENT
Specifies that the specified theme should be created or modified but is not to be made the current theme.

COMPOSITE=(comp-name-1 | <,..., comp-name-n>)
Lists one or more spatial composite names when you create a new key or link for a theme. If only one composite is listed, you can omit the parentheses. The composites are paired with the attribute data set variables that are named in the DATAVAR= argument. If the composite names and the data set variable names are the same, you can justify them once with either the COMPOSITE= or DATAVAR= lists, and those names will be used for both.

Note:   This is not the same argument as the COMPOSITE = argument that is used to set up a WHERE clause when you create an AREA type layer.  [cautionend]

DATASET= <libref.>data-set
Specifies the attribute data set when you create a new key link for a theme. If you specify a one-level data set name, the default library is WORK.

DATAVAR= (variable-1 <,..., variable-n>)
Lists attribute data set variables when you create a new key link for a theme. If only one variable is listed, you can omit the parentheses. These variables are paired with the spatial composites that are named in the COMPOSITE= argument. If the data set variable names and the composite names are the same, you can justify them once with either the COMPOSITE= or DATAVAR= lists, and those names will be used for both.

POINT=
Defines the appearance of the symbol for each level of the specified theme in a point layer. The option allows you to specify the color, size, font and specific character to be used for the symbols. It is valid only when TYPE=POINT is specified in the layer definition.

POINT= syntax:
THEME = (POINT = ((LEVEL = integer | FIRST | LAST 
                   COLOR = color | CURRENT
                   SIZE = [1..21] | CURRENT
                   FONT = font1
                   CHARACTER='char')
                  BLENDCOLOR
                  BLENDSIZE));

POINT= arguments:
LEVEL= Specifies which theme range is being operated upon. For example, LEVEL=1 refers to the first range level in this theme. LEVEL=FIRST and LEVEL=LAST can also be used to denote the initial and final range levels. If LEVEL=1 is omitted, the entered theme parameters are assigned to the range levels in sequence.
COLOR= Specifies the color of the point symbol. COLOR= must specify a predefined SAS color name, an RGB color code in the form CXrrggbb, an HLS color code in the form Hhhhllss, or a gray-scale color code in the form GRAYll. For more information on color naming schemes, see "SAS/GRAPH Colors" in SAS/GRAPH Software: Reference. CURRENT is specified when you want to specify BLENDCOLOR and you simply want this range level to maintain its current color.
SIZE= Specifies the size of the point symbol. SIZE= must specify an integer that is greater than or equal to 1 and less than or equal to 21. Defaults to the size of the static point symbol for this layer. CURRENT is specified when you want to specify BLENDSIZE and use this existing range level size as one of those points to interpolate between.
FONT= Specifies the font to use for the point symbol. FONT= must specify a valid fontname. The default is the font of the static point symbol for this layer. Font verification can be overridden by using the FORCE option in the LAYER statement.
CHARACTER= Specifies the character to use for the point symbol. CHARACTER= must specify a single character in quotes. The defaults is the character of the static point symbol for this layer.
BLENDCOLOR Interpolates the color values for any theme range levels between those that you specified with LEVEL=. If you want to blend between existing colors, indicate the colors with COLOR=CURRENT.
BLENDSIZE Interpolates the point size for any theme range levels between those that you specified with LEVEL=. To blend between existing sizes, indicate the sizes as SIZE=CURRENT.

LINE=
Defines the appearance of the line for each level of the specified theme in a line layer. The option allows you to specify the color, width and style to be used for the lines. It is valid only when TYPE=LINE in the layer definition.

LINE= syntax:
     THEME = ( LINE= ((LEVEL = integer | FIRST | LAST
                       COLOR = color | CURRENT 
                       WIDTH = [1..20]
                       STYLE = SOLID | DASHED | DOTTED)
                      BLENDCOLOR
                      BLENDWIDTH));

LINE= arguments:
LEVEL= Specifies which level of the theme is being operated upon. For example, LEVEL=1 refers to the first range level in this theme. LEVEL=FIRST and LEVEL=LAST can also be used to denote the initial and final range levels. If the LEVEL= arguments are omitted, the entered theme parameters are assigned to the range levels in sequence.
COLOR= Specifies the color of the line. COLOR= must specify a predefined SAS color name, an RGB color code in the form CXrrggbb, an HLS color code in the form Hhhhllss, or a gray-scale color code in the form GRAYll. For more information about color-naming schemes, see "SAS/GRAPH Colors" in SAS/GRAPH Software: Reference. CURRENT is used when you want to BLENDCOLORS and use this range level color as one of the colors to interpolate with.
WIDTH= Specifies the width of the line. WIDTH= must specify an integer that is greater than or equal to 1 and less than or equal to 20. The default is the width of the static line for this layer. CURRENT is used when you want to specify BLENDWIDTH and use this existing range level width as one of those to interpolate with.
STYLE= Specifies the style of the line. STYLE= must specify either SOLID, DASHED, or DOTTED. The default is the style of the static line for this layer.
BLENDCOLOR Interpolates the color values for any theme range levels between those specified with LEVEL=. If you want to blend between existing colors, indicate the colors with COLOR=CURRENT.
BLENDWIDTH Interpolates the line width for any theme range levels between those specified with LEVEL=. To blend between existing widths, indicate the widths as WIDTH=CURRENT.

CENTERLINE=
Defines the appearance of the optional centerline for the specified theme in a line layer. The option allows you to specify whether a centerline is displayed as well as the color, width, and style to be used for the centerlines. It is valid only when TYPE=LINE is in the layer definition.

Note:   A centerline does not vary in a single theme. Its appearance is the same for all range levels.  [cautionend]

CENTERLINE= syntax:
     THEME = (CENTERLINE = (ON | OFF
                            COLOR = color | CURRENT 
                            WIDTH = [1..20]
                            STYLE = SOLID | DASHED | DOTTED));

CENTERLINE= arguments:
ON | OFF Specifies whether the optional centerline is displayed. The default is the same on/off status as the static centerline for this layer.
COLOR= Specifies the color of the centerline. COLOR= must specify a predefined SAS color name, an RGB color code in the form CXrrggbb, an HLS color code in the form Hhhhllss, or a gray-scale color code in the form GRAYll. For more information about color-naming schemes, see "SAS/GRAPH Colors" in SAS/GRAPH Software: Reference. The default is the color of the static centerline for this layer.
WIDTH= Specifies the width of the centerline. WIDTH= must specify an integer that is greater than or equal to 1 and less than or equal to 20. The default is the width of the static centerline for this layer.
STYLE= Specifies the style of the centerline. STYLE= must specify either SOLID, DASHED, or DOTTED. The defaults is the style of the static centerline for this layer.

AREA=
Defines the appearance of the area fill for each level of the specified theme in an area layer. AREA= allows you to specify the color and fill style as well as angle and spacing parameters for hatched and crosshatched fill styles. It is valid only when TYPE=AREA in the layer definition.

AREA= syntax:
THEME = (AREA = ((LEVEL = integer | FIRST | LAST
                  COLOR = color | CURRENT 
                  STYLE = EMPTY | FILLED | HATCH | CROSSHATCH 
                  ANGLE = angle-value
                  SPACING = [2..10]) | CURRENT
                 BLENDCOLOR
                 BLENDSPACING));

AREA= arguments:
LEVEL= Specifies which level of the theme is being modified. For example, LEVEL=1 refers to the first range level in this theme. LEVEL=FIRST and LEVEL=LAST can also be used to denote the initial and final range levels. If the LEVEL= arguments are omitted, the entered theme parameters are assigned to the range levels in sequence.
COLOR= Specifies the fill color of the area. COLOR= must specify a predefined SAS color name, an RGB color code in the form CXrrggbb, an HLS color code in the form Hhhhllss, or a gray-scale color code in the form GRAYll. For more information about color-naming schemes, see "SAS/GRAPH Colors" in SAS/GRAPH Software: Reference. The defaults is GRAY. CURRENT is specified when you want to specify BLENDCOLORS and use this range level color as one of the colors to interpolate with.
STYLE= Specifies the fill style of the area. STYLE= must specify either EMPTY, FILLED, HATCH, or CROSSHATCH. The defaults is the style of the static area for this layer.
ANGLE= Specifies an angle for hatched and crosshatched lines. ANGLE= must specify a real number that is greater than or equal to zero and less than 90 (for crosshatch), or greater than or equal to 0 and less than 180 (for hatch). The default is the angle of the static area for this layer.
SPACING= Specifies the spacing between hatched lines or crosshatched lines. SPACING= must specify an integer that is greater than or equal to 2 and less than or equal to 10. The lower the number, the less space that there is between lines (the higher the number, the more space that there is between lines). The defaults is the spacing of the static area for this layer.
BLENDCOLOR Interpolates the color values for any theme range levels between those specified with LEVEL=. If you want to blend between existing colors, indicate the colors with COLOR=CURRENT.
BLENDSPACING Interpolates the hatched or crosshatched style for any theme range levels between those specified with LEVEL=. To blend between existing spacing values, indicate them as SPACING=CURRENT. If any intermediate range levels are not hatched or crosshatched, BLENDSPACING ignores them.

OUTLINE=
Defines the appearance of the polygon outlines for each level of the specified theme in an area layer. OUTLINE= allows you to specify the color, width, and style to be used for the outlines. It is valid only when TYPE=AREA in the layer definition.

OUTLINE= syntax:
THEME = (OUTLINE = (ON | OFF
                    COLOR = color
                    WIDTH = [1..20]
                    STYLE = SOLID | DASHED | DOTTED));

OUTLINE= arguments:
ON | OFF Specifies whether the area outline is displayed. The defaults is the same on/off status as the static outline for this layer.
COLOR= Specifies the color of the outline. COLOR= must specify a predefined SAS color name, an RGB color code in the form CXrrggbb, an HLS color code in the form Hhhhllss, or a gray-scale color code in the form GRAYll. For more information about color-naming schemes, see "SAS/GRAPH Colors" in SAS/GRAPH Software: Reference. The defaults is the color of the static outline for this layer.
WIDTH= Specifies the width of the outline. WIDTH= must specify an integer that is greater than or equal to 1 and less than or equal to 20. The defaults is the width of the static outline for this layer.
STYLE= Specifies the style of the outline. STYLE= must specify either SOLID, DASHED, or DOTTED. The defaults is the style of the static outline for this layer.


LAYER Statement Examples

Define a layer using a composite

If the chains data set contains pairs of variables that indicate values for the areas on the left and right sides of the chains, then you can use these variable pairs to define area layers. The following code fragment defines a composite that identifies county boundaries (chains for which the area values on the left and right sides are unequal) and uses that composite to define an area layer:

composite create county / var=(left=countyl,right=countyr)
                          class=area;
run;
polygonal index create county / composite=county
                                out=gmaps.cntyx;
run;
layer create county / composite=county
                      type=area;
run;

Note:   The polygonal index must be defined for the composite in order to display this area layer in a map.  [cautionend]

Define a layer using a category variable

Assume that the spatial database contains a variable named CFCC that has values that identify what each chain represents. Assume also that the values of the CFCC variable for all roads begin with the letter A (A0, A1, and so forth, depending on the category of road). The following code fragment defines a line layer that consists of all features that are roads:

layer create roads / where='cfcc =: "A"'
                     type=line;
run;

Note:   The colon (:) modifier to the equals operator restricts the comparison to only the first n characters of the variable value, where n is the number of characters in the comparison string. In the preceding example, the WHERE clause tests for "where the value of CFCC begins with A."  [cautionend]

Create a theme

This example creates a new theme for the SASUSER.MALL.STORES map, supplied with the SAS/GIS tutorial. The theme uses the sqft variable in the mallstor attribute data set to define the theme.

proc gis;              
   spatial sasuser.mall.mall;
   layer update sasuser.mall.store / theme = (create
                                              themevar = sqft
                                              dataset = sasuser.mallstor
                                              datavar = store
                                              composite = store
                                              link = mallstor
                                              range = discrete
                                              pos = -1
                                              not_current );
   run;
quit;

Update an Existing Theme

Using the sqft theme that was created in the previous example and modify it as follows:

proc gis c=sasuser.mall;
   spatial mall;
   layer update store / theme=(update
                               pos = 1
                               themevar = rent
                               range = levels
                               nlevels = 9
                               area = ((level = first color = blue    )
                                       (level = last  color = cxff0000)
                                       blendcolor));
   run;
quit;


Chapter Contents

Previous

Next

Top of Page

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