This function returns a compound widget used to specify latitude and longitude values, and it returns the base ID of the widget. An interactive ENVI Classic session is required to run this function.


Result = WIDGET_GEO(Base [, AUTO_MANAGE={0 | 1}] [, DEFAULT=array] [, DMS=0], LAT_ONLY [, PROMPT=string], UVALUE=value)



This is the ID of the widget base.


AUTO_MANAGE (optional)

Use this keyword to specify how ENVI Classic auto-manages the widget with AUTO_WID_MNG. The keyword value specifies if the widget must have a defined value. Setting this keyword to a value of 1 requires that the widget has either a default value or a value that you enter. Setting this keyword to 0 does not require a value. Do not use this keyword for user-managed widgets.

DEFAULT (optional)

Use this keyword to specify a two-element array of floating-point values representing the default latitude and longitude in decimal degrees. If you set the keyword LAT_ONLY, then DEFAULT is a single-element, floating-point array.

DMS (optional)

This keyword is set by default to put latitude and longitude in degrees, minutes and seconds. Set DMS to 0 to allow decimal degrees.


Set this keyword to show only latitude values.

PROMPT (optional)

Use this keyword to specify a string array for the prompt string. If you do not specify any values, then the prompt array is set to [‘Lat’,‘Lon’].


Use this keyword to assign a “user value” to the widget. This value may be of any data type and organization. The user value exists entirely for your convenience. For widgets managed by the ENVI Classic function AUTO_WID_MNG, UVALUE is a tag name in the returned anonymous structure. For user-managed widgets, you can set and use UVALUE however you wish. You must set UVALUE for all compound widgets.


Create a simple compound widget to enter a latitude and longitude value. If the values are entered successfully, then print the result.

  compile_opt IDL2
  base = widget_auto_base(title='Simple Lat/Lon')
  wg = widget_geo(base, /dms, uvalue='geo', /auto)
  result = auto_wid_mng(base)
  if (result.accept eq 0) then return
  print, 'Latitude: ', result.geo[0]
  print, 'Longitude: ', result.geo[1]

API Version