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


  >  Docs Center  >  ENVI API  >  Data Control  >  ENVIMosaicRaster::Hydrate

ENVIMosaicRaster::Hydrate

ENVIMosaicRaster::Hydrate

Use the Hydrate static function method to create the object from its dehydrated form. The dehydrated form consists of a hash containing the object’s properties and values. The Hydrate and Dehydrate methods let you store the object state in memory and restore it later.

Representing an object as a hash is necessary for running ENVI analytics with the ENVI Task Engine and the ENVI Services Engine.

See the ENVIHydrate function if you are creating a general IDL routine that will restore multiple object types.

Example


The example uses sample images from the ENVI Resource DVD (in the mosaic folder). The images are also available from the ENVI Tutorials web page. Click the "ENVI Tutorial Data" hyperlink. Copy the images to your local drive, and update the file location with your own directory.

PRO ENVIMosaicRasterHydrateExample
  COMPILE_OPT IDL2
   
  ; Start the application
  e = ENVI(/HEADLESS)
   
  ; Select input scenes
  files = REVERSE(FILE_SEARCH('C:\MyData\', 'airphoto*.dat'))
  scenes = !NULL
  FOR i=0, N_ELEMENTS(files)-1 DO BEGIN
     raster = e.OpenRaster(files[i], DATA_IGNORE_VALUE=0)
     scenes = [scenes, raster]
  ENDFOR
   
  ; Create a mosaic raster
  mosaic = ENVIMosaicRaster(scenes)
   
  ; Retrieve the dehydrated hash
  dehydratedForm = mosaic.Dehydrate()
  mosaic.Close
   
  ; Restore the object
  newImage = ENVIMosaicRaster.Hydrate(dehydratedForm)
  Print, newImage, /IMPLIED_PRINT
END

Syntax


Result = ENVIMosaicRaster.Hydrate(DehydratedForm, ERROR=value)

Return Value


The result is a reference to a new object instance of this virtual raster class.

Arguments


DehydratedForm

Key

Description

factory

Required. A string value of MosaicRaster indicating what object type the hash represents.

scenes

Required. An array of ENVIRaster that comprise the mosaic raster. Each file must have the same number of bands and the same data type. You must define at least one raster with the SCENES property to create the mosaic. Input files can be georeferenced to different coordinate systems; the first scene in the SCENES array defines the output projection for the mosaic raster. Example:

"scenes": [
{
"url": "/usr/local/harris/envi/mydata/airphoto1.dat",
"factory": "URLRaster"
},
{
"url": "/usr/local/harris/envi/mydata/airphoto2.dat",
"factory": "URLRaster"
},
{
"url": "/usr/local/harris/envi/mydata/airphoto3.dat",
"factory": "URLRaster"
},
{
"url": "/usr/local/harris/envi/mydata/airphoto4.dat",
"factory": "URLRaster"
},
{
"url": "/usr/local/harris/envi/mydata/airphoto5.dat",
"factory": "URLRaster"
},
{
"url": "/usr/local/harris/envi/mydata/airphoto6.dat",
"factory": "URLRaster"
}
]

color_matching_actions

An array of strings that indicates how each element of the Scenes array should be treated with regard to color matching: as a reference image, an adjusted image, or no color matching. The number of elements in this array must match the number of input scenes in the Scenes array. Valid strings are adjust, none, or reference. Example:

"color_matching_actions": ["none","adjust","none","reference","adjust","adjust"]

color_matching_method

A string that indicates the color matching method. Set to histogram matching or none. Example:

"color_matching_method": "none"

color_matching_stats

A string that indicates what parts of the reference and adjusted images are used to compute statistics for color matching. Set to entire scene or overlapping area. Example:

"color_matching_stats": "entire scene"

data_ignore_value

A pixel value that will be used to fill areas where no valid data appear in the output raster. This value may be different than the input data-ignore value. The value must be within the range of the input scenes' data type (e.g., floating-point, byte, integer, etc.) Example:

"data_ignore_value": 255.0

feathering_distance

An integer number of pixels used for edge or seamline feathering. Example:

"feathering_distance": [99, 99, 99, 99, 99, 99]

feathering_method

A string that indicates the feathering method to use. Set to edge, none, seamline. Example:

"feathering_method": "seamline"

name

A string that identifies the raster.

resampling

A string that indicates the resampling method. Set to nearest neighbor, bilinear, or cubic convolution. Example:

"resampling": "nearest neighbor"

seam_polygons

An ENVIVector containing seam polygons that you want to restore. Example:

"seam_polygons": {
   "url": "/usr/local/harris/envi/mydata/myseamlines.shp"
   "factory": "URLVector"
 }

seamline_method

A string that indicates the method used to automatically generate seamlines. Set to geometry or none. Example:

"seamline_method": "none"

Keywords


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.

Version History


ENVI 5.4

Introduced

ENVI 5.4, Service Pack 1

Renamed the background key to data_ignore_value

API Version


3.2

See Also


ENVIMosaicRaster, ENVIMosaicRaster::Dehydrate, ENVIHydratable, ENVIHydrate



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