The AddSymbol method adds a symbol to an annotation set.

Example


; Start the application
e = ENVI()
 
; Open an input file
file = FILEPATH('qb_boulder_msi', $
  ROOT_DIR=e.ROOT_DIR, SUBDIRECTORY = ['data'])
raster = e.OpenRaster(file)
 
; Display the raster layer
View = e.GetView()
RasterLayer = View.CreateLayer(raster)
 
; Create an annotation set using Geographic Lat/Lon
; WGS-84 as the spatial reference
annotation = ENVIAnnotationSet(/GEOGRAPHIC)
 
; Label a school
annotation.AddSymbol, $
  -105.20959689, 40.00281598, $ ; X and Y coordinates
  CHARACTER='?', $ ; Square flag symbol
  FONT_SIZE=20, NAME='School marker'
 
annotation.AddText, $
  -105.20959689, 40.00425381, $ ; X and Y coordinates
  'Nevin Platt Middle School', $
  NAME='School label'
 
; Save the annotation set
outFile = e.GetTemporaryFilename()
annotation.Save, outFile
 
; Display the annotation layer
AnnLayer = View.CreateLayer(annotation)

Syntax


ENVIAnnotationSet.AddSymbol, X, Y [, Keywords=value]

Arguments


X

Specify a floating-point value with the X coordinate of the symbol.

Y

Specify a floating-point value with the Y coordinate of the symbol.

Keywords


ANCHOR_POINT (optional)

Specify a two-element array of values that range from 0.0 to 1.0. The first value is the horizontal position, and the second value is the vertical position. The values 0 and 1 represent the edges of the symbol. Together, the values indicate the location within the symbol that will be anchored to the specified X and Y coordinates.

BACKGROUND_COLOR (optional)

Specify a three-element byte array or string with a color name for the symbol background, when BACKGROUND_METHOD is set to 1 or 2. The default color is based on the current ENVI preference setting.

BACKGROUND_METHOD (optional)

Specify a string or integer indicating the background method to use for the symbol. The choices are:

  • None or 0
  • Full or 1
  • Outline or 2 (default)

The following image shows the different choices:

CHARACTER (optional)

Specify a string indicating the symbol to use for the selected FONT_NAME.

For the "ENVI Symbols" font, use the characters shown in the following tables:

Character

Symbol

<space>

!

"

#

$

%

&

'
(See note)

(

)

*

+

,

-

.

/

0

1

2

3

4

5

Character

Symbol

6

7

8

9

:

;

=

>

?

@

A

B

C

D

E

F

G

H

I

J

K

L

Character

Symbol

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

[

\

]

^

_

`
(accent)

satellite dish

Note: To use the penguin symbol, insert the single quote between two double quotes, as follows:

CHARACTER="'"

ERROR (optional)

Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.

When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.

See Manage Errors for more information on error handling in ENVI programming.

FONT_NAME (optional)

Specify a string with the font name to use. The default value is based on the current ENVI preference setting. If the font is not installed on your system, Helvetica will be used.

FONT_SIZE (optional)

Specify a floating-point value with the font size to use. The default value is 16.

FONT_STYLE (optional)

Specify a string or integer indicating the font style to use. The choices are:

  • Normal or 0
  • Bold or 1 (Default)
  • Italic or 2
  • Bold Italic or 3

GLYPH_COLOR (optional)

Specify a three-element byte array or string with the symbol color. The default color is based on the current ENVI preference setting.

NAME (optional)

Set this keyword to a string with a custom name for the annotation item. This name will appear in the Layer Manager. The default value is "Symbol."

ROTATE_WITH_VIEW (optional)

Set this keyword to rotate the symbol accordingly whenever you rotate the view, instead of always orienting the symbol "north up" (the default behavior).

SCALE_ON_ZOOM (optional)

Set this keyword to resize the symbol accordingly whenever you zoom in or out of the display.

Version History


ENVI 5.6.1

Introduced

API Version


4.3

See Also


ENVIAnnotationSet