ENVIPseudoRasterSpatialRef::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.

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

For additional information, see What are Hydrate and Dehydrate routines used for?

Example

; Start the application

e = ENVI(/HEADLESS)

 

; Define the spatial reference object data

pseudoGeoPoint1 = [1.0000000D, 1.0000000D, -117.07201D, 32.893801D]

pseudoGeoPoint2 = [1002.0000D, 1.0000000D, -116.95856D, 32.873647D]

pseudoGeoPoint3 = [1.0000000D, 1002.0000D, -117.09961D, 32.806283D]

pseudoGeoPoint4 = [1002.0000D, 1002.0000D, -116.98626D, 32.786154D]

 

; Create a custom spatial reference object

spatialRef1 = ENVIPseudoRasterSpatialRef( $

 PSEUDO_GEO_POINT_1=pseudoGeoPoint1, $

  PSEUDO_GEO_POINT_2=pseudoGeoPoint2, $

  PSEUDO_GEO_POINT_3=pseudoGeoPoint3, $

  PSEUDO_GEO_POINT_4=pseudoGeoPoint4)

 

; Retrieve the dehydrated hash

dehydratedForm = spatialRef1.Dehydrate()

 

; Restore the object

newSpatialRef = ENVIPseudoRasterSpatialRef.Hydrate(dehydratedForm)

Print, newSpatialRef, /IMPLIED_PRINT

Syntax

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

Return Value

The result is a reference to a new object instance of the spatial reference.

Arguments

DehydratedForm

Key

Description

factory

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

pseudo_geo_point_1

Required. A four-element array [X Pixel, Y Pixel, Longitude, Latitude] specifying a geographic corner for a non-georeferenced file.

Example:

"pseudo_geo_point_1": [1.0000000000000000,
1.0000000000000000, -117.07201000000001,
32.893801000000003]

pseudo_geo_point_2

Required. A four-element array [X Pixel, Y Pixel, Longitude, Latitude] specifying a geographic corner for a non-georeferenced file.

pseudo_geo_point_3

Required. A four-element array [X Pixel, Y Pixel, Longitude, Latitude] specifying a geographic corner for a non-georeferenced file.

pseudo_geo_point_4

Required. A four-element array [X Pixel, Y Pixel,Longitude, Latitude] specifying a geographic corner for a non-georeferenced file.

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

API Version

4.2

See Also

ENVIPseudoRasterSpatialRef, ENVIPseudoRasterSpatialRef::Dehydrate, ENVIHydratable, ENVIHydrate