The AddCircle method adds a circle 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 the community park
annotation.AddCircle, $
  -105.22101050, 39.9917, $ ; X and Y coordinates
  [300.0, 200.0], $ ; ellipse axes (m)
  LINE_COLOR='lime green', NAME='Park polygon'
 
annotation.AddText, $
  -105.22118409, 39.99424191, $ ; X and Y coordinates
  'East Boulder!C Community Park', $
  GLYPH_COLOR='lime green', NAME='Park label'
 
; Save the annotation set
outFile = e.GetTemporaryFilename()
 
annotation.Save, outFile
; Display the annotation layer
AnnLayer = View.CreateLayer(annotation)

Syntax


ENVIAnnotationSet.AddCircle, X, Y, Radius [, Keywords=value]

Arguments


X

Specify a floating-point X coordinate for the center of the circle.

Y

Specify a floating-point Y coordinate for the center of the circle.

Radius

Specify one of the following:

  • A scalar floating-point value with the radius of the circle
  • A two-element, floating-point array with the major and minor axis lengths of an ellipse

If the annotation set has a Geographic WGS-84 spatial reference, specify the radius (or major and minor axes) in meters.

Keywords


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.

FILL_CROSSHATCH (optional)

When FILL_MODE is set to 2 (Line), set this property to 1 to enable a crosshatch pattern. The default is 0.

FILL_MODE (optional)

Specify a Boolean value, indicating whether or not to fill the circle.

  • 0: None (default)
  • 1: Solid
  • 2: Line

FILL_ORIENTATION (optional)

When FILL_MODE is set to 2 (Line), specify the angular direction of the line fill. Values can range from 0 to 180. The default is 45.

FILL_SPACING (optional)

When FILL_MODE is set to 2 (Line), specify the spacing between the lines of the fill. Values range from 1 (solid fill) to 50. The default is 5.

LINE_COLOR (optional)

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

LINE_STYLE (optional)

Specify an integer value from 0 to 6, indicating the line style of the circle. The choices are as follows:

Value

Line Style

0

1

2

3

4

5

6

No line

The default is 0 (solid line).

LINE_THICK (optional)

Specify a floating-point value from 1 to 10, indicating the line thickness of the circle. The default value is 2. ENVI will round the value to the nearest integer.

LINE_SHOW (optional)

Specify a Boolean value, indicating whether or not to draw a line around the circle.

  • 1: Line (default)
  • 0: No line

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 "Circle" or "Ellipse."

Version History


ENVI 5.6.1

Introduced

API Version


4.3

See Also


ENVIAnnotationSet