The GoToLocation method centers the display over the location in the view that you specify using geographic coordinates (default), map coordinates, MGRS coordinates, or data coordinates.

Example


; Launch the application
e = ENVI()
 
; Create an ENVIRaster
file = FILEPATH('qb_boulder_msi', ROOT_DIR=e.ROOT_DIR, $
  SUBDIRECTORY = ['data'])
raster = e.OpenRaster(file)
view = e.GetView()
 
; Create a true-color layer
layer = view.CreateLayer(raster)
 
; Zoom to 400% (4:1)
view.Zoom, 4
 
; Center the display over the boat in
; the lake, using geographic coordinates
view.GoToLocation, -105.2062514D, 39.9974865D, /GEO

Syntax


ENVIView.GoToLocation [, Keywords=value]

Arguments


X

Specify the x-coordinate for the Go To location. To achieve the highest level of accuracy, specify this argument as a double-precision floating-point number.

  • If you set the DATA keyword, specify the zero-based x coordinate (column), measured in the number of pixels from the top-left corner, ignoring any XSTART values.
  • If you set the GEO keyword, specify the longitude in decimal degree format. The value must be between -180 and 180.
  • If you set the MAP keyword, specify the easting coordinate.
  • If you set the MGRS keyword, you do not need to specify this argument.

Y

Specify the y-coordinate for the Go To location. To achieve the highest level of accuracy, specify this argument as a double-precision floating-point number.

  • If you set the DATA keyword, specify the zero-based y coordinate (row), measured in the number of pixels from the top-left corner, ignoring any YSTART values.
  • If you set the GEO keyword, specify the latitude in decimal degree format. The value must be between -90 and 90.
  • If you set the MAP keyword, specify the northing coordinate.
  • If you set the MGRS keyword, you do not need to specify this argument.

Keywords


DATA

Set this keyword to an ENVIRasterLayer object that exists in the specified ENVIView.

ERROR

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.

GEO

Set this keyword to specify the Go To location in latitude and longitude coordinates (for geographic coordinate systems).

MAP

Set this keyword to specify the Go To location in eastings and northings (for projected coordinate systems).

MGRS

Set this keyword to an alphanumeric string specifying Military Grid Reference System (MGRS) coordinates for the Go To location. Northing and easting values can have up to five digits of precision, which represents a 1-square-meter grid.

Version History


ENVI 5

Introduced

API Version


4.2

See Also


ENVIView, ENVIView::GeoLink, ENVIPseudoRasterSpatialRef, ENVIRPCRasterSpatialRef, ENVIStandardRasterSpatialRef