Coordinate Operation Definition (CoordOpDef). More...
#include <mi32/spatref.h>
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);
| SPATREF::COORDOPDEF::COORDOPDEF | ( | ) |
Default constructor.
| SPATREF::COORDOPDEF::COORDOPDEF | ( | const COORDOPDEF & | rhs | ) |
Copy constructor.
| SPATREF::COORDOPDEF::~COORDOPDEF | ( | ) |
Destructor.
| 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.
| 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.
| 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.
| 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.
| void SPATREF::COORDOPDEF::GetDisplay | ( | MISTRING & | string, | |
| int | indent, | |||
| GETDISPLAY | flags = GETDISPLAY_None | |||
| ) | const |
Get multiline string suitable for display.
| 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.
| idnum | Parameter ID number | |
| value | Value returned if available |
| ERRVALUE SPATREF::COORDOPDEF::GetParmValue | ( | COORDOPPARM::IDNUM | idnum, | |
| bool & | value | |||
| ) | const |
Get value for boolean parameter.
| 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.
| 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.
| 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.
| nodename | Parent for contain node to be created |
| bool SPATREF::COORDOPDEF::HasParmValue | ( | COORDOPPARM::IDNUM | idnum | ) | const |
Determine if has specified parameter with value set.
| 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.
1.6.1