The GIS Procedure |
MAPLABEL<operation> <option> |
Operations |
prints label information to the Output window. If you specify
_ALL_, every label not associated with a layer is printed.
TEXT='string', only labels matching that text are printed. The comparison is case sensitive.
ROW=integer, only the label at that row is printed.
creates a new label or labels. Unlike CREATE operations for other PROC GIS statements, duplicate labels are allowed.
removes the specified labels and, depending on which optional arguments are specified, possibly deletes the label data set. The only valid optional arguments for DELETE are DATASET=, MAP=, LAYER=, TEXT=, IMAGE=, ROW=, and _ALL_. Any others will be ignored.
If you specify
DATASET=data-set-name as the only argument, the label data set is deleted.
MAP=map-entry as the only argument, the label data set reference is removed from the map entry, and the data set is deleted. If you do not specify MAP=, and all of the rows in the label data set are deleted, you are cautioned that any maps using the deleted data set will generate a WARNING when opened.
ROW=, only the label at that data set row is deleted. ROW= and _ALL_ are not allowed together. If you use ROW= and TEXT=, the TEXT= is ignored and the label at that row is deleted.
TEXT='string', every label literal having this exact string is removed from the label data set.
Note: Literal labels are those not associated with a specific layer.
IMAGE=, the specified image is deleted.
_ALL_, every label that is not associated with a layer is removed from the label data set.
Either DATASET= or MAP= is required or no deletions can occur.
Any DELETE operation that deletes all of the rows in the label data set also causes the data set to be deleted. If a data set is deleted, a NOTE is printed to the log. If MAP= is present and the label data set is deleted, the reference to the data set within the map entry is removed.
A note is printed in the log upon completion of a successful deletion.
replaces an existing label specified by TEXT='string' of ROW=. If the label does not exist, a CREATE is performed.
modifies an existing label.
Options |
affects the behavior of the following operations:
In a CONTENTS operation, _ALL_ prints every label that is not associated with a layer to the Output window.
In a DELETE operation, _ALL_ deletes every label not associated with a layer.
_ALL_ has no effect on CREATE, REPLACE, or UPDATE operations. If _ALL_ is detected, it is ignored.
_ALL_ cannot be used in the same statement with ROW= or TEXT= options.
controls the label positioning and is a required argument.
The label is attached to a location on the map. As you move the map in the window, the label moves with the map.
The label is attached to the map window. It remains fixed relative to the window as you move the map in the window.
specifies the text color. The default color is BLACK.
is a SAS color-name, for example GREEN or RED.
is an RGB color, for example CX23A76B.
specifies the label data set to which new labels are appended. If the data set does not exist, it is created.
If you specify a one-level data set name, the WORK library is assumed. If you specify both DATASET= and MAP=, and the map already references a label data set, the data set names are compared. If they are not the same and FORCE was not specified, a warning is printed, and the run group is terminated.
replaces the existing label data set reference in a map when both DATASET= and MAP= are specified. If the map already references a label data set, its data set name is compared to the name specified with DATASET=. If they are not the same, the FORCE option causes the map's label data set reference to be overwritten and a note printed to the log. The map's original label data set is not deleted.
FRONT |
causes an image label to be drawn over the map features. This is the default for image labels. |
BACK |
causes an image label to be drawn beneath the map features. |
specifies the location of an image to use as an image label on the map.
enables you to enter a host directory path to an image file. For example,
IMAGE='C:\My SAS Files\photo.gif'
uses a .IMAGE type catalog entry for the image label. If you omit the library name from the statement, the WORK library is the default.
enables you to use an external file for an image label by specifying an active SAS fileref. The host directory path for this fileref is written to the label data set, not to the fileref.
indicates the map entry on which to display the labels. If you indicate a one-level name, the map entry is assumed to be in the catalog that is specified in the PROC GIS statement or in the most recently issued CATALOG statement.
If the specified map entry already references a label data set, new labels are appended to that data set.
If the map entry does not reference a label data set, you must provide a label data set name with the DATASET= option. The labels are written to that data set, and the data set is then assigned to the specified map.
For the MAPLABEL statement, either MAP= or DATASET= is required. If both are present and the map already has a label data set, its name must match the name specified in the DATASET= option. One exception is if the FORCE option is also used. In that case, the label data set specified by DATASET= is assigned to the map entry. The map's original label data set is unassigned but not deleted.
specifies the distance to move the entire label. X is the number of units to move the label right (positive numbers) or left (negative numbers), and Y is the number of units to move the label up (positive numbers) or down (negative numbers). For example:
To set only the X offset, specify one value, with or without a following comma:
OFFSET = ( 10 real, )
To set both the X and Y offset, specify two values, with or without a comma separating them:
OFFSET = ( 20 pct, 40 pct )
To set only the Y offset, specify one value preceded by a comma:
OFFSET = ( ,-30 pct )
OFFSET= is usually used in conjunction with POSITION= to adjust the position of a label. Moves are relative to the location specified by POSITION=, with OFFSET=(0,0) representing the initial position. You can also apply OFFSET= to the default label position.
The following restrictions apply to the OFFSET= argument:
When both ORIGIN and OFFSET are used, the same units must be specified for both. If no units are specified in the OFFSET= arguments, the unit entered in the ORIGIN= option is used.
OFFSET= is unnecessary with ORIGIN= since ORIGIN= explicitly positions the label and requires no further adjustment. However, if you specify both options, the values of OFFSET= are added to the values of ORIGIN=, and the label is positioned accordingly.
If the resulting location is outside of the GIS window, a WARNING is printed to the log when the map is opened, and the label is moved to be within the window.
specifies a map scale where the label is turned on or off when the map view is zoomed.
specifies the units for ONSCALE.
enables you to specify various combinations of units. Valid values are KM, M, CM, MI, FT, and IN. Real-units is typically KM, M, MI, or FT, and map-units is usually either CM or IN. Long forms of the unit names, for example KILOMETERS or INCH (singular or plural), are also acceptable.
sets the scale units to KM/CM. This is the default if units are omitted.
sets the scale units to MI/IN.
specifies a map scale where the label is turned on or off when the map view is zoomed.
specifies the units for OFFSCALE.
enables you to specify various combinations of units. Valid values are KM, M, CM, MI, FT, and IN. Real-units is typically KM, M, MI, or FT, and map-units is usually either CM or IN. Long forms of the unit names, for example KILOMETERS or INCH (singular or plural), are also acceptable.
sets the scale units to KM/CM. This is the default if units are omitted.
sets the scale units to MI/IN.
specifies the X and Y coordinates for the label. ORIGIN= explicitly positions the label anywhere on the map. Unlike the POSITION= location, the label is not centered about this point. The lower left corner of the label is placed at the specified ORIGIN location.
x indicates the X-coordinate (horizontal axis)
y indicates the Y-coordinate (vertical axis)
Use the following units when attaching labels to the map:
X and Y values are real-world coordinates based on the underlying spatial data. Negative values can be used to signify the western or southern hemispheres if the spatial data contains them.
refers to a percentage of the distance from the lower left corner of this bounding box to the label origin. All SAS/GIS maps have a rectangular bounding box that encompasses the extreme limits of the spatial data as subset by the GIS coverage. When a map is first opened in the GIS Map window, the map scale is set to display this entire box in the window. When the map is resized, the label remains in the same relative location, for example, for x=50, y=50 the label origin remains in the center of the map. Negative values and values greater than 100% can be used to place the origin outside of the coverage extents.
Use the following units when attaching labels to the window:
X and Y values are screen coordinates using pixels. The lower left corner of the window is 0, 0. Negative values are not allowed. If a specified pixel value runs the label outside of the window, the label is shifted horizontally, vertically, or both to be just within the window when the map is opened.
X and Y values are a percentage of the distance from the lower left corner of the map window to the label origin. When the window is resized, the label remains in the same relative location. For example, for x=50, y=50 the label origin remains in the center of the window. Negative values and values greater than 100% are not allowed.
To set only the X coordinate, specify one value with or without a following comma. For example:
ORIGIN = ( 10 pixels, )or
ORIGIN = ( 10 pixels )
To set both the X and Y coordinates, specify two values with or without a comma separating them. The units can be specified for both X and Y or once at the end. For example:
ORIGIN = ( 10 pct, 40 pct )or
ORIGIN = ( 10 pct 40 pct )or
ORIGIN = ( 10 40 pct )or
ORIGIN = ( 10, 40, pct )
To set only the Y coordinate, specify one value preceded by a comma. For example:
ORIGIN = ( , 20 pct )
ORIGIN= overrides the POSITION= option if both options are present. Although using the OFFSET= option with the ORIGIN= option is unnecessary, if you also specify OFFSET=, it is applied after the ORIGIN= request has been processed.
If the specified origin or origin plus offset is outside of the overall map bounding box, a warning is printed to the log. No warning is issued if the label runs out of the box, however.
specifies how labels are treated when they overlap.
All labels you create with the option will be displayed even if they conflict with other labels.
some of the conflicting labels will be suppressed until you zoom in more closely. This is the default setting.
assigns a single label to a position on the map relative to the map's bounding box.
If the label is attached to the map, the label position is determined using the spatial data bounding box, that is the upper, lower, right and left edges of the coverage extents. If the label is attached to the window, the window edges are used.
The following arguments determine the vertical position of the label:
places the label along the upper edge of the map or window.
places the label halfway between the top and bottom edges of the map or window.
aligns the label with the bottom edge of the map or window.
The following arguments determine the horizontal position of the label:
starts the label at the left edge of the map or window.
places the label halfway between the left and right edges of the map or window.
aligns the end of the label with the right edge of the map or window. The label is centered horizontally and vertically at the computed position point. You can adjust the initial label position with the OFFSET= option.
specifies a particular label in the data set to UPDATE, REPLACE, DELETE or print CONTENTS. Not valid for CREATE operations.
specifies the text for a literal label.
For REPLACE, UPDATE, DELETE or CONTENTS operations, string specifies a search string used to locate a specific target label. When TEXT='string' is used to search for a label, string is case sensitive, and an exact match to the value of the search string must be found. For example, TEXT='Paris' will ignore a label having PARIS as its text. It will also ignore a label having 'Paris Metro' as its text.
If ROW= and TEXT= are both present in a REPLACE or UPDATE statement the 'string' entered with TEXT= is not a search string. It becomes the new text for the label at the specified ROW number.
enables the map features to show though the label's bounding box. This is the default if not specified.
blocks the display of map features within the label's rectangular bounding box.
These options apply to text labels and image labels stored as catalog entries. They have no effect on image labels stored in an external file.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.