Chapter Contents |
Previous |
Next |
Using Spatial Data with SAS/GIS Software |
LAYER operation <libref.catalog.>layer-entry </ options>; |
Description |
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:
An error occurs if the specified layer entry does not exist.
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.)
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.
_ALL_
. 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.)
An error occurs if there is no existing layer entry with the specified 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 (/).
The following list contains descriptions of additional LAYER statement arguments:
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.
Note: The DETAILON= argument
is effective only when detail coordinates are read for the layer. The DETAILS
argument controls whether detail coordinates are read.
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.
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.
Note: If you specify both the OFFSCALE= and ONSCALE= arguments,
the scale-value for OFFSCALE= must be less than
the scale-value for ONSCALE=.
Note: If
you specify both the ONSCALE= and OFFSCALE= arguments, the scale-value for ONSCALE= must be greater than the scale-value for
OFFSCALE=.
Note: Each area layer must have a polygonal index for the composite
that defines the area boundaries.
Unit-specification can be one of the following:
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.
DEFAULT= options:
POINT= syntax:
DEFAULT = ( POINT = (COLOR = color SIZE = [1..21] FONT=font-name CHARACTER='character' ));
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." |
DEFAULT = (LINE = (COLOR = color WIDTH = [1..20] STYLE = SOLID | DASHED | DOTTED));
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. |
DEFAULT = (CENTERLINE = (ON | OFF COLOR = color WIDTH = [1..20] STYLE = SOLID | DASHED | DOTTED));
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. |
DEFAULT = (AREA = (COLOR = color STYLE = EMPTY | FILLED | HATCH | CROSSHATCH ANGLE = angle-value SPACING = [2..10] ));
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= 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.
CREATE | |
REPLACE | |
UPDATE | |
DELETE |
The following list contains descriptions of the THEME= operations:
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.
For a REPLACE statement, you must also specify both the LINK= argument and the VAR= 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.
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.
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:
THEMEVAR=var-name also specifies the theme to delete or to make current.
If you do not specify RANGE=, DEFAULT is used for numeric variables and DISCRETE is used for character variables.
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.
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.
THEME = (POINT = ((LEVEL = integer | FIRST | LAST COLOR = color | CURRENT SIZE = [1..21] | CURRENT FONT = font1 CHARACTER='char') BLENDCOLOR BLENDSIZE));
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. |
THEME = ( LINE= ((LEVEL = integer | FIRST | LAST COLOR = color | CURRENT WIDTH = [1..20] STYLE = SOLID | DASHED | DOTTED) BLENDCOLOR BLENDWIDTH));
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. |
Note: A centerline does not vary in a single
theme. Its appearance is the same for all range levels.
THEME = (CENTERLINE = (ON | OFF COLOR = color | CURRENT WIDTH = [1..20] STYLE = SOLID | DASHED | DOTTED));
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. |
THEME = (AREA = ((LEVEL = integer | FIRST | LAST COLOR = color | CURRENT STYLE = EMPTY | FILLED | HATCH | CROSSHATCH ANGLE = angle-value SPACING = [2..10]) | CURRENT BLENDCOLOR BLENDSPACING));
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. |
THEME = (OUTLINE = (ON | OFF COLOR = color WIDTH = [1..20] STYLE = SOLID | DASHED | DOTTED));
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 |
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.
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."
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;
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.