Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.

  >  Docs Center  >  ENVI API  >  Spatial Read Routines


Spatial Read Routines

Spatial Read Routines

Spatial data are used extensively throughout ENVI, including display data, processing functions, and interactive routines. Read routines are not concerned with the originating source of the request; they must satisfy the data request.

Spatial requests specify x and y starting and ending pixels and the desired band number. The input file unit number for the opened input file is also passed to the routine. Spatial read routines are defined as follows:

PRO myread_spatial, unit, r_data, fid, band, xs, ys, xe, ye,
   $   _extra=_extra


  • unit: The file unit number already open for reading
  • r_data: The parameter variable for the returned data. The read procedure must define this variable before exiting.
  • fid: The file ID of the input image file. (Note: you must use ENVI_FILE_QUERY to obtain the file information; you cannot currently use ENVIRasterToFID.)
  • band: The band position for the desired data. The band variable is a long-integer value ranging from 0 to 1, minus the number of bands.
  • xs: The x starting pixel for the spatial request (in file coordinates)
  • ys: The y starting pixel for the spatial request (in file coordinates)
  • xe: The x ending pixel for the spatial request (in file coordinates)
  • ye: The y ending pixel for the spatial request (in file coordinates)
  • _extra: You must specify this keyword in order to collect keywords not used by custom file readers. The use of _extra prevents errors when calling a routine with a keyword that is not listed in its definition.

The read routine reads the appropriate data from the file and stores the results in the R_DATA parameter. Opening and closing input files is performed externally, and the corresponding file unit is passed as the UNIT parameter.

© 2018 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us