SPATREF::COORDOPDEF Class Reference

Coordinate Operation Definition (CoordOpDef). More...

#include <mi32/spatref.h>

List of all members.

Public Types

enum  AUTOPROJECT {
  AUTOPROJECT_UTM = 1, AUTOPROJECT_TM_WMS = 2, AUTOPROJECT_Orthographic = 3, AUTOPROJECT_Equirectangular = 4,
  AUTOPROJECT_Gnomonic = 5, AUTOPROJECT_AzimuthalEquidistant = 6, AUTOPROJECT_Stereographic = 7
}
enum  IDNUM {
  IDNUM_Undefined = -1, IDNUM_None = 0, IDNUM_UPS_North = 25382, IDNUM_UPS_South = 25383,
  IDNUM_PlateCarree = 26200, IDNUM_UserDefinedBase = IdNumUserDefinedBase
}

Public Member Functions

 COORDOPDEF (const COORDOPDEF &rhs)
 COORDOPDEF ()
 ~COORDOPDEF ()
ERRVALUE Assign (const XMLNODE *xmlnode)
ERRVALUE Assign (IDNUM IdNum)
ERRVALUE Assign (const IDENTIFIER &Id)
ERRVALUE Create (const MISTRING &name, const MILIST< COORDOPDEF > &StepList)
ERRVALUE Create (AUTOPROJECT autoproj, const DPOINT2D &center)
ERRVALUE Create (const MISTRING &name, const COORDOPMETHOD &method, const COORDOPPARMLIST &parmlist)
bool FindPredefined ()
void GetDisplay (MISTRING &string, int indent, GETDISPLAY flags=GETDISPLAY_None) const
const IDENTIFIERLISTGetIdList () const
IDNUM GetIdNum () const
const COORDOPMETHODGetMethod () const
const MISTRINGGetName () const
ERRVALUE GetParm (COORDOPPARM::IDNUM idnum, COORDOPPARM &parm) const
const COORDOPPARMLISTGetParmList () const
ERRVALUE GetParmValue (COORDOPPARM::IDNUM idnum, MISTRING &value) const
ERRVALUE GetParmValue (COORDOPPARM::IDNUM idnum, bool &value) const
ERRVALUE GetParmValue (COORDOPPARM::IDNUM idnum, double &value, int unitid) const
ERRVALUE GetParmValue (COORDOPPARM::IDNUM idnum, double &value, const UOM::UNIT &unit) const
const COORDREFSYSGetSourceCRS () const
const MILIST< COORDOPDEF > & GetStepList () const
const COORDREFSYSGetTargetCRS () const
const TEXTRESITEMLISTGetValidAreaList () const
XMLNODEGetXML (XMLNODE *parentnode, const char *nodename="CoordOp") const
bool HasParmValue (COORDOPPARM::IDNUM idnum) const
bool IsConcatenated () const
bool IsImplemented () const
COORDOPDEFoperator= (const COORDOPDEF &rhs)
void SetMethod (COORDOPMETHOD::IDNUM MethodIdNum)
void SetMethod (const COORDOPMETHOD &CoordOpMethod)
ERRVALUE SetParm (COORDOPPARM::IDNUM idnum, double value, const UOM::IDNUM unitid)
ERRVALUE SetParm (COORDOPPARM::IDNUM idnum, double value, const UOM::UNIT &unit)
ERRVALUE SetParm (COORDOPPARM::IDNUM idnum, int value)
ERRVALUE SetParm (COORDOPPARM::IDNUM idnum, bool value)
ERRVALUE SetParm (const COORDOPPARM &parm)

Detailed Description

Coordinate Operation Definition (CoordOpDef).

The primary use of a CoordOpDef in an application is to define a specific projection. There are three basic ways to set up a CoordOpDef.

1. Use an identifier. The easiest way to create a valid CRS is through the use of a well-known identifier and the Assign() method. To determine available identifiers, the CRS selection window found in various TNT processes may be helpful. First select the desired CRS or Projection from the Predefined list. Then, on the 'Details' tab, toggle on the 'Show all component IDs' button. The "Other identifiers" list will show the available IDs for the selected projection (and other CRS components). If an application is reading data in one of the defined codespaces, eg EPSG, OGC_WKT (Well-Known Text) or UTM, then the id can be determined by the application and combined with the codespace. For example:

Create UTM projection in any 'zone' (zones values range from 1 - 60 for north and -1 to -60 for south):

      IDENTIFIER id(CODESPACE_UTM,zone);
      if ((err = CoordOpDef.Assign(id)) < 0) ...

Create projection for Nebraska State Plane 1983 using EPSG identifier:

      IDENTIFIER id(CODESPACE_EPSG,12630);   // Id for Nebraska SPCS 1983
      if ((err = CoordOpDef.Assign(id)) < 0) ...

2. Use the Create() method with AUTOPROJECT enum. This is useful for creating a projection based on a specified point in geographic (longitude/latitude) coordinates. For example:

Create UTM projection with zone determined from point.

      CoordOpDef.Create(COORDOPDEF::AUTOPROJECT_UTM,point);

3. Create using specific operation (projection) method and parameters. This is the most complex way to create a CoordOpDef. The set of parameters varies based on which operation method is being used. To determine the parameters needed, use the CRS window, choose the desired projection operation method on the Projection tab and the set of parameters will be shown.

In the following examples, these definitions are common:

      COORDOPMETHOD Method;
      UOM::UNIT UnitMeter, UnitDegree, UnitUnity;
      UOM::SYSTEM::FindUnit(UOM::MEASURE::TYPE_Length,UNIT_Length_Meter,UnitMeter);
      UOM::SYSTEM::FindUnit(UOM::MEASURE::TYPE_PlaneAngle,UNIT_PlaneAngle_Degree,UnitDegree);
      UOM::SYSTEM::FindUnit(UOM::MEASURE::TYPE_Scale,UNIT_Scale_Unity,UnitUnity);

Create Transverse Mercator projection definition:

      if ((err = Method.Assign(COORDOPMETHOD::IDNUM_Projection_TransverseMercator)) < 0) return (err);
      CoordOpDef.SetMethod(Method);
      if ((err = CoordOpDef.SetParm(COORDOPPARM::IDNUM_ScaleFactorAtNaturalOrigin,1.0,UnitUnity)) < 0) return (err);
      if ((err = CoordOpDef.SetParm(COORDOPPARM::IDNUM_LongitudeOfNaturalOrigin,center.x,UnitDegree)) < 0) return (err);
      if ((err = CoordOpDef.SetParm(COORDOPPARM::IDNUM_LatitudeOfNaturalOrigin,center.y,UnitDegree)) < 0) return (err);
      if ((err = CoordOpDef.SetParm(COORDOPPARM::IDNUM_FalseEasting,500000.0,UnitMeter)) < 0) return (err);
      if ((err = CoordOpDef.SetParm(COORDOPPARM::IDNUM_FalseNorthing,0.0,UnitMeter)) < 0) return (err);

Create Lambert Conformal Conic (2SP) projection definition:

      if ((err = CoordOpDef.SetParm(COORDOPPARM::IDNUM_LatitudeOf1stStandardParallel,30.0,UnitDegree)) < 0) return (err);
      if ((err = CoordOpDef.SetParm(COORDOPPARM::IDNUM_LatitudeOf2ndStandardParallel,45.0,UnitDegree)) < 0) return (err);
      if ((err = CoordOpDef.SetParm(COORDOPPARM::IDNUM_LongitudeOfFalseOrigin,-100.0,UnitDegree)) < 0) return (err);
      if ((err = CoordOpDef.SetParm(COORDOPPARM::IDNUM_LatitudeOfFalseOrigin,25.0,UnitDegree)) < 0) return (err);
      if ((err = CoordOpDef.SetParm(COORDOPPARM::IDNUM_EastingAtFalseOrigin,0.0,UnitMeter)) < 0) return (err);
      if ((err = CoordOpDef.SetParm(COORDOPPARM::IDNUM_NorthingAtFalseOrigin,0.0,UnitMeter)) < 0) return (err);

Member Enumeration Documentation

Automatic projection operations.

Enumerator:
AUTOPROJECT_UTM 

Derive UTM zone from center longitude.

AUTOPROJECT_TM_WMS 

Same as UTM but centered on arbitrary meridian.

AUTOPROJECT_Orthographic 
AUTOPROJECT_Equirectangular 
AUTOPROJECT_Gnomonic 
AUTOPROJECT_AzimuthalEquidistant 
AUTOPROJECT_Stereographic 
Enumerator:
IDNUM_Undefined 
IDNUM_None 
IDNUM_UPS_North 

Universal Polar Stereographic North zone.

IDNUM_UPS_South 

Universal Polar Stereographic South zone.

IDNUM_PlateCarree 

Plate Carree (equirectangular with origin at intersection of equator and prime meridian).

IDNUM_UserDefinedBase 

Base for dynamically assigned user-defined IDs.


Constructor & Destructor Documentation

SPATREF::COORDOPDEF::COORDOPDEF (  ) 

Default constructor.

SPATREF::COORDOPDEF::COORDOPDEF ( const COORDOPDEF rhs  ) 

Copy constructor.

SPATREF::COORDOPDEF::~COORDOPDEF (  ) 

Destructor.


Member Function Documentation

ERRVALUE SPATREF::COORDOPDEF::Assign ( const XMLNODE xmlnode  ) 

Assign from XMLNODE.

ERRVALUE SPATREF::COORDOPDEF::Assign ( IDNUM  IdNum  ) 

Assign by MicroImages ID number.

ERRVALUE SPATREF::COORDOPDEF::Assign ( const IDENTIFIER Id  ) 

Assign by IDENTIFIER.

ERRVALUE SPATREF::COORDOPDEF::Create ( const MISTRING name,
const MILIST< COORDOPDEF > &  StepList 
)

Create concatenated operation with specified steps.

Parameters:
name Operation name
StepList List of steps
ERRVALUE SPATREF::COORDOPDEF::Create ( AUTOPROJECT  autoproj,
const DPOINT2D center 
)

Create using specified automatic projection type and center point.

Parameters:
autoproj Projection type
center Center of projection (longitude, latitude) in degrees
ERRVALUE SPATREF::COORDOPDEF::Create ( const MISTRING name,
const COORDOPMETHOD method,
const COORDOPPARMLIST parmlist 
)

Create operation definition with specified method and parameter list.

Parameters:
name Operation name
method Method
parmlist Parameter list
bool SPATREF::COORDOPDEF::FindPredefined (  ) 

Find equivalent definition in predefined list and set this CRS to match if found.

Returns:
true if found (or already uses predefined ID), false if not.
void SPATREF::COORDOPDEF::GetDisplay ( MISTRING string,
int  indent,
GETDISPLAY  flags = GETDISPLAY_None 
) const

Get multiline string suitable for display.

Parameters:
string String returned, will be initially cleared if indent is 0
indent Indent level
flags Flags for extra items to display
const IDENTIFIERLIST& SPATREF::COORDOPDEF::GetIdList (  )  const

Get identifer list.

IDNUM SPATREF::COORDOPDEF::GetIdNum (  )  const

Get MicroImages identification number.

const COORDOPMETHOD& SPATREF::COORDOPDEF::GetMethod (  )  const

Get operation method.

const MISTRING& SPATREF::COORDOPDEF::GetName (  )  const

Get name.

ERRVALUE SPATREF::COORDOPDEF::GetParm ( COORDOPPARM::IDNUM  idnum,
COORDOPPARM parm 
) const
const COORDOPPARMLIST& SPATREF::COORDOPDEF::GetParmList (  )  const

Get list of parameters.

ERRVALUE SPATREF::COORDOPDEF::GetParmValue ( COORDOPPARM::IDNUM  idnum,
MISTRING value 
) const

Get value for string parameter.

Parameters:
idnum Parameter ID number
value Value returned if available
ERRVALUE SPATREF::COORDOPDEF::GetParmValue ( COORDOPPARM::IDNUM  idnum,
bool &  value 
) const

Get value for boolean parameter.

Parameters:
idnum Parameter ID number
value Value returned if available
ERRVALUE SPATREF::COORDOPDEF::GetParmValue ( COORDOPPARM::IDNUM  idnum,
double &  value,
int  unitid 
) const

Get value for numeric parameter in specified unit ID.

Parameters:
idnum Parameter ID number
value Value returned if available
unitid Unit ID
ERRVALUE SPATREF::COORDOPDEF::GetParmValue ( COORDOPPARM::IDNUM  idnum,
double &  value,
const UOM::UNIT unit 
) const

Get value for numeric parameter in specified unit.

Parameters:
idnum Parameter ID number
value Value returned if available
unit Unit to return value in
const COORDREFSYS& SPATREF::COORDOPDEF::GetSourceCRS (  )  const

Get source coordinate reference system.

const MILIST<COORDOPDEF>& SPATREF::COORDOPDEF::GetStepList (  )  const

Get list of operation steps for concatenated operation.

const COORDREFSYS& SPATREF::COORDOPDEF::GetTargetCRS (  )  const

Get target coordinate reference system.

const TEXTRESITEMLIST& SPATREF::COORDOPDEF::GetValidAreaList (  )  const

Get list of valid area names.

XMLNODE* SPATREF::COORDOPDEF::GetXML ( XMLNODE parentnode,
const char *  nodename = "CoordOp" 
) const

Get XMLNODE representation.

Parameters:
nodename Parent for contain node to be created
bool SPATREF::COORDOPDEF::HasParmValue ( COORDOPPARM::IDNUM  idnum  )  const

Determine if has specified parameter with value set.

Parameters:
idnum Parameter ID number
bool SPATREF::COORDOPDEF::IsConcatenated (  )  const

Determine if is 'concatenated' coordinate operation.

bool SPATREF::COORDOPDEF::IsImplemented (  )  const

Determine if uses implemented operation method(s).

COORDOPDEF& SPATREF::COORDOPDEF::operator= ( const COORDOPDEF rhs  ) 

Assignment.

void SPATREF::COORDOPDEF::SetMethod ( COORDOPMETHOD::IDNUM  MethodIdNum  ) 

Set operation method using IDNUM.

void SPATREF::COORDOPDEF::SetMethod ( const COORDOPMETHOD CoordOpMethod  ) 

Set operation method.

ERRVALUE SPATREF::COORDOPDEF::SetParm ( COORDOPPARM::IDNUM  idnum,
double  value,
const UOM::IDNUM  unitid 
)

Set parameter by ID number, numeric value and unit IDNUM.

ERRVALUE SPATREF::COORDOPDEF::SetParm ( COORDOPPARM::IDNUM  idnum,
double  value,
const UOM::UNIT unit 
)

Set parameter by ID number, numeric value and UNIT.

ERRVALUE SPATREF::COORDOPDEF::SetParm ( COORDOPPARM::IDNUM  idnum,
int  value 
)

Set parameter by ID number and unitless integer value.

ERRVALUE SPATREF::COORDOPDEF::SetParm ( COORDOPPARM::IDNUM  idnum,
bool  value 
)

Set parameter by ID number and boolean value.

ERRVALUE SPATREF::COORDOPDEF::SetParm ( const COORDOPPARM parm  ) 

Set parameter value.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:40:27 2012 for TNTsdk 2012 by  doxygen 1.6.1