Coordinate Reference System (CRS). More...
#include <mi32/spatref.h>
Coordinate Reference System (CRS).
A CRS consists of a Datum, a Coordinate System (CoordSys) and, if projected, a Coordinate Operation Definition (CoordOpDef).
To setup a CRS, either Assign() or Create() is typically used.
Typically either a Geographic (longitude/latitude) or a Projected (easting/northing) CRS is created as follows:
2D Geographic CRS with axes in degrees using the datum from an existing Projected CRS (ProjCRS):
COORDREFSYS GeogCRS; GeogCRS.Create(COORDSYS::IDNUM_Ellipsoidal2D_Deg,ProjCRS.GetDatum());
2D Projected CRS, easting/northing axes in meters, WGS84 datum, existing projection operation definition (ProjOpDef): (for documentation on defining the projection operation, see COORDOPDEF)
COORDREFSYS ProjCRS; ProjCRS.Create(COORDSYS::IDNUM_Projected2D_EN_m,DATUM::IDNUM_WGS_1984,ProjOpDef);
Coordinate reference system ID numbers.
Note, not all IDs in database are listed.
| SPATREF::COORDREFSYS::COORDREFSYS | ( | ) |
Default constructor.
| SPATREF::COORDREFSYS::COORDREFSYS | ( | const COORDREFSYS & | rhs | ) |
Copy constructor.
| SPATREF::COORDREFSYS::~COORDREFSYS | ( | ) |
Destructor.
| ERRVALUE SPATREF::COORDREFSYS::Assign | ( | const OLDPROJPARM & | projparm | ) |
Assign from legacy projection parameter structure.
Assign from MISTRING.
| string | String representation previously generated by GetString(). |
| ERRVALUE SPATREF::COORDREFSYS::Assign | ( | const IDENTIFIER & | Id | ) |
Assign by IDENTIFIER.
The specified id will be used to search the spatial reference database (spatref.xml).
| Id | Identifier to lookup |
| void SPATREF::COORDREFSYS::Clear | ( | ) |
Clear coordinate reference system, resetting to undefined.
| ERRVALUE SPATREF::COORDREFSYS::ComputeAngleToNorth | ( | const DPOINT2D & | point, | |
| double & | angle, | |||
| int | angleunitid | |||
| ) | const |
Compute angle between projected CRS and true north at specified point.
| point | Point to compute at | |
| angle | Angle in specified unit returned | |
| angleunitid | Unit to return angle in (UNIT_PlaneAngle_...) |
| ERRVALUE SPATREF::COORDREFSYS::ComputeDistance | ( | const DPOINT2D & | point1, | |
| const DPOINT2D & | point2, | |||
| double & | distance, | |||
| MEASUREMETHOD | method = MEASUREMETHOD_Automatic, |
|||
| UOM::IDNUM | LengthUnitIdNum = UOM::IDNUM_Length_Meter | |||
| ) | const |
Compute distance between pair of points.
| point1 | First point | |
| point2 | Second point | |
| distance | Distance returned | |
| method | Measurement method |
| ERRVALUE SPATREF::COORDREFSYS::ComputeLength | ( | const POLYLINE & | polyline, | |
| double & | length, | |||
| MEASUREMETHOD | method = MEASUREMETHOD_Automatic, |
|||
| UOM::IDNUM | LengthUnitIdNum = UOM::IDNUM_Length_Meter | |||
| ) | const |
Compute length of polyline.
| polyline | Polyline | |
| length | Length returned | |
| method | Measurement method |
| ERRVALUE SPATREF::COORDREFSYS::Create | ( | const MILIST< COORDREFSYS > & | CoordRefSysList | ) |
Create compound coordinate reference system.
| CoordRefSysList | List of coordinate reference systems |
| ERRVALUE SPATREF::COORDREFSYS::Create | ( | COORDSYS::IDNUM | CoordSysIdNum, | |
| const DATUM & | Datum, | |||
| const COORDOPDEF::IDNUM | CoordOpDefId | |||
| ) |
Create projected coordinate reference system.
| CoordSysIdNum | Coordinate system IDNUM, must be for TYPE_Projected | |
| Datum | Datum | |
| CoordOpDefId | Coordinate operation definition IDNUM |
| ERRVALUE SPATREF::COORDREFSYS::Create | ( | COORDSYS::IDNUM | CoordSysIdNum, | |
| const DATUM & | Datum, | |||
| const COORDOPDEF & | CoordOp | |||
| ) |
Create projected coordinate reference system.
| CoordSysIdNum | Coordinate system IDNUM, must be for TYPE_Projected | |
| Datum | Datum | |
| CoordOp | Coordinate operation definition for projection |
| ERRVALUE SPATREF::COORDREFSYS::Create | ( | const COORDSYS & | CoordSys, | |
| const DATUM & | Datum, | |||
| const COORDOPDEF & | CoordOp | |||
| ) |
Create projected coordinate reference system.
| CoordSys | Coordinate system, must be TYPE_Projected | |
| Datum | Datum | |
| CoordOp | Coordinate operation definition for projection |
| ERRVALUE SPATREF::COORDREFSYS::Create | ( | COORDSYS::IDNUM | CoordSysIdNum, | |
| const DATUM & | Datum | |||
| ) |
Create non-projected coordinate reference system.
| CoordSysIdNum | Coordinate system IDNUM, must not be for TYPE_Projected | |
| Datum | Datum |
Create non-projected coordinate reference system.
| CoordSys | Coordinate system, must not be TYPE_Projected | |
| Datum | Datum |
| bool SPATREF::COORDREFSYS::FindPredefined | ( | ) |
Find equivalent definition in predefined list and set this CRS to match if found.
| const COORDAXIS& SPATREF::COORDREFSYS::GetAxis | ( | int | axisidx | ) | const |
Get coordinate axis using index.
| axisidx | 0-based position of axis |
| const MILIST<COORDREFSYS>& SPATREF::COORDREFSYS::GetComponentList | ( | ) | const |
Get list of component coordinate reference systems if compound.
Returns empty list if not compound.
| const COORDOPDEF& SPATREF::COORDREFSYS::GetCoordOpDef | ( | ) | const |
Get coordinate operation definition for projected CRS.
| const COORDSYS& SPATREF::COORDREFSYS::GetCoordSys | ( | ) | const |
Get coordinate system reference.
| const DATUM& SPATREF::COORDREFSYS::GetDatum | ( | ) | const |
Get datum reference.
| bool SPATREF::COORDREFSYS::GetDatumTransOp | ( | const DATUM & | datum, | |
| COORDOPDEF & | CoordOpDef | |||
| ) | const |
Get COORDOPDEF for datum transformation.
| datum | Datum to transform to or from | |
| CoordOpDef | Coordinate operation definition returned |
| const COORDOPDEFLIST& SPATREF::COORDREFSYS::GetDatumTransOpList | ( | ) | const |
Get COORDOPDEFLIST for datum transformations.
| int SPATREF::COORDREFSYS::GetDimension | ( | ) | const |
Get total dimension of CRS.
| void SPATREF::COORDREFSYS::GetDisplay | ( | MISTRING & | string, | |
| int | indent = 0, |
|||
| 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::COORDREFSYS::GetIdList | ( | ) | const |
Get identifer list.
| IDNUM SPATREF::COORDREFSYS::GetIdNum | ( | ) | const |
Get MicroImages identification number.
| int SPATREF::COORDREFSYS::GetLegacyProjParm | ( | OLDPROJPARM & | projparm | ) | const |
Get legacy projection parameter structure for CRS.
| projparm | Legacy structure returned |
| const MISTRING& SPATREF::COORDREFSYS::GetName | ( | ) | const |
Get name.
Get string representation suitable for serializing and INI file storage.
| string | String returned |
| const TEXTRESITEMLIST& SPATREF::COORDREFSYS::GetValidAreaList | ( | ) | const |
Get list of valid area names.
| XMLNODE* SPATREF::COORDREFSYS::GetXML | ( | XMLNODE * | parentnode, | |
| const char * | nodename = "CoordRefSys" | |||
| ) | const |
Get XMLNODE representation.
| nodename | Parent for contain node to be created |
| bool SPATREF::COORDREFSYS::HasCoordSysType | ( | COORDSYS::TYPE | CoordSysType | ) | const |
Determine if has coordinate system of specified type.
| bool SPATREF::COORDREFSYS::HasDatumType | ( | DATUM::TYPE | DatumType | ) | const |
Determine if has datum of specified type.
| bool SPATREF::COORDREFSYS::HasOwnDatumTransOpList | ( | ) | const |
Determine if operation has own datum transformation operation list.
| bool SPATREF::COORDREFSYS::IniRead | ( | INIHANDLE | hdl, | |
| const char * | group, | |||
| const char * | field | |||
| ) |
Read definition from INI file.
| ERRVALUE SPATREF::COORDREFSYS::IniWrite | ( | INIHANDLE | hdl, | |
| const char * | group, | |||
| const char * | field | |||
| ) | const |
Write definition to INI file.
| bool SPATREF::COORDREFSYS::IsCompound | ( | ) | const |
Determine if this is a compound coordinate reference system.
| bool SPATREF::COORDREFSYS::IsDefined | ( | ) | const |
Determine if coordinate reference system is defined.
| bool SPATREF::COORDREFSYS::IsLocal | ( | ) | const |
Determine if is locally-defined coordinate reference system.
Local coordinate reference systems cannot automatically be converted to non-local.
| bool SPATREF::COORDREFSYS::IsProjected | ( | ) | const |
Determine if coordinate reference system is 'projected'.
A projected CRS has a defined coordinate operation.
| COORDREFSYS& SPATREF::COORDREFSYS::operator= | ( | const COORDREFSYS & | rhs | ) |
Assignment.
| ERRVALUE SPATREF::COORDREFSYS::SetCoordOpDef | ( | const COORDOPDEF & | CoordOpDef | ) |
Set coordinate operation definition.
May only be used on non-compound CRS. If results in change, any CRS identifiers will be cleared.
| ERRVALUE SPATREF::COORDREFSYS::SetCoordSys | ( | COORDSYS::IDNUM | CoordSysIdNum | ) |
Set coordinate system by IDNUM.
May only be used on non-compound CRS. If results in change, any CRS identifiers will be cleared.
Set coordinate system.
May only be used on non-compound CRS. If results in change, any CRS identifiers will be cleared.
| ERRVALUE SPATREF::COORDREFSYS::SetDatum | ( | DATUM::IDNUM | DatumIdNum | ) |
Set datum by IDNUM.
May only be used on non-compound CRS. If results in change, any CRS identifiers will be cleared.
Set datum.
May only be used on non-compound CRS. If results in change, any CRS identifiers will be cleared.
| ERRVALUE SPATREF::COORDREFSYS::SetDatumTransOpList | ( | const COORDOPDEFLIST & | DatumTransOpList | ) |
Set datum transformation operation definition list.
The datum used by this COORDREFSYS must match the datum used by the source COORDREFSYS for each specified operation or an error will be returned. The target datum is determined by the specified operation. More than one datum transformation operation may be registered with a COORDREFSYS, but only one per target datum.
| void SPATREF::COORDREFSYS::SetId | ( | const IDENTIFIER & | Id | ) |
Set identifer.
Primarily intended for system use only.
| void SPATREF::COORDREFSYS::SetName | ( | const MISTRING & | name | ) |
Set name of coordinate reference system.
May only be used on non-predefined CRS.
| name | Name to set |
| ERRVALUE SPATREF::COORDREFSYS::Validate | ( | bool | FixIfPossible, | |
| bool | CheckOpCreate | |||
| ) |
Validate coordinate reference system definition.
| FixIfPossible | Fix errors if possible | |
| CheckOpCreate | Check coordinate operation creation |
1.6.1