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


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

ENVIRPCRasterSpatialRef::Hydrate

ENVIRPCRasterSpatialRef::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


; Start the application
e = ENVI(/HEADLESS)
 
; Define the spatial reference object data
 
rpcLineDenCoeff = [8.2062290D+008, 146530.90D, 2350871.0D, $
  -465666.30D, 1709.5350D, -1829.8090D, -1122.8140D, -109.65130D, $
  -236.17350D, -113.09640D, -1.0511430D, -0.59464460D, 0.28530330D, $
  0.36169420D, -0.14511410D, 0.12011280D, -0.037436850D, -1.3185750D, $
  -0.32494720D, 0.030033410D]
 
rpcLineNumCoeff = [1.5322480d+008, 4206503.0D, -9.9999990d+008, $
  -577846.10D, -164510.60D, -492.93490D, 657289.40D, -558932.00D, $
  -2868272.0D, 303.33970D, 2065.4790D, -97.933320D, -2082.4690D, $
  28.393320D, -1707.6330D, 281.19970D, 76.317960D, -2031.7740D, $
  1607.2070D, -0.048244400D]
 
rpcOffsets = [2536.0000D, 3003.0000D, 32.833100D, -117.23340D, 33.000000D]
 
rpcSampDenCoeff = [5.1351520d+008, 91693.590D, 1471087.0D, -291396.60D, $
  1069.7630D, -1145.0260D, -702.61510D, -68.615710D, -147.78860D, $
  -70.771530D, -0.65776600D, -0.37210640D, 0.17853220D, 0.22633480D, $
  -0.090807010D, 0.075162100D, -0.023426580D, -0.82511530D, $
  -0.20333980D, 0.018793790D]
 
rpcSampNumCoeff = [2.8127720d+008, 9.9999990d+008, 1970968.0D, $
  -6127672.0D, 2552674.0D, -211183.60D, -70378.780D, 177598.70D, $
  3700.5000D, 1395.2010D, -263.22950D, -51.521790D, -1299.7060D, $
  -214.88460D, 2026.6580D, 0.93249080D, 19.797070D, -1993.1030D, $
  -141.81680D, 1.3218580D]
 
rpcScales = [2537.0000D, 3004.0000D, 0.027900000D, 0.062500000D, 220.00000D]
 
; Create a custom spatial reference object
spatialRef1 = ENVIRPCRasterSpatialRef( $
  RPC_LINE_DEN_COEFF = rpcLineDenCoeff, $
  RPC_LINE_NUM_COEFF = rpcLineNumCoeff, RPC_OFFSETS = rpcOffsets, $
  RPC_SAMP_DEN_COEFF = rpcSampDenCoeff, $
  RPC_SAMP_NUM_COEFF = rpcSampNumCoeff, RPC_SCALES = rpcScales)
 
; Retrieve the dehydrated hash
dehydratedForm = spatialRef1.Dehydrate()
 
; Restore the object
newSpatialRef = ENVIRPCRasterSpatialRef.Hydrate(dehydratedForm)
Print, newSpatialRef, /IMPLIED_PRINT

Syntax


Result = ENVIRPCRasterSpatialRef.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 RPCRasterSpatialRef indicating what object type the hash represents.

rpc_offsets

Required. A five-element, double-precision array that specifies the Line_Offset, Sample_Offset, Latitude_Offset, Longitude_Offset, and Height_Offset values. Example:

"rpc_offsets" : [2536.0000, 3003.0000, 32.833100, -117.23340, 33.000000]

rpc_scales

Required. A five-element, double-precision array that specifies the Line_Scale, Sample_Scale, Latitude_Scale, Longitude_Scale, and Height_Scale values. Example:

"rpc_scales" : [2537.0000, 3004.0000, 0.027900000, 0.062500000, 220.00000]

rpc_line_num_coeff

Required. A 20-element, double-precision array of RPC line numerator coefficients. Example:

"rpc_line_num_coeff" : [1.5322480d+008, 
4206503.0D, -9.9999990d+008, -577846.10D,
-164510.60D, -492.93490D, 657289.40D,
-558932.00D, -2868272.0D, 303.33970D,
2065.4790D, -97.933320D, -2082.4690D,
28.393320D, -1707.6330D, 281.19970D,
76.317960D, -2031.7740D, 1607.2070D,
-0.048244400D]

rpc_line_den_coeff

Required. A 20-element, double-precision array of RPC line denominator coefficients. Example:

"rpc_line_den_coeff" : [8.2062290D+008, 
146530.90D, 2350871.0D, -465666.30D,
1709.5350D, -1829.8090D, -1122.8140D,
-109.65130D, -236.17350D, -113.09640D,
-1.0511430D, -0.59464460D, 0.28530330D,
0.36169420D, -0.14511410D, 0.12011280D,
-0.037436850D, -1.3185750D, -0.32494720D,
0.030033410D]

rpc_samp_num_coeff

Required. A 20-element, double-precision array of RPC sample numerator coefficients. Example:

"rpc_samp_num_coeff" : [2.8127720d+008, 
9.9999990d+008, 1970968.0D, -6127672.0D,
2552674.0D, -211183.60D, -70378.780D, 177598.70D,
3700.5000D, 1395.2010D, -263.22950D, -51.521790D,
-1299.7060D, -214.88460D, 2026.6580D, 0.93249080D,
19.797070D, -1993.1030D, -141.81680D, 1.3218580D]

rpc_samp_den_coeff

Required. A 20-element, double-precision array of RPC sample denominator coefficients. Example:

"rpc_samp_den_coeff" : [5.1351520d+008, 
91693.590D, 1471087.0D, -291396.60D,
1069.7630D, -1145.0260D, -702.61510D,
-68.615710D, -147.78860D, -70.771530D,
-0.65776600D, -0.37210640D, 0.17853220D,
0.22633480D, -0.090807010D, 0.075162100D,
-0.023426580D, -0.82511530D, -0.20333980D,
0.018793790D]

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


3.3

See Also


ENVIRPCRasterSpatialRef, ENVIRPCRasterSpatialRef::Dehydrate, ENVIHydratable, ENVIHydrate



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