CCGridInverse Method

WRAPPER_API bool CCGridInverse(const GeodeticPoint &refPoint, const GeodeticPoint &contactPoint, BmgChar *locationString) const;

 

Description

The CCGridInverse method calculates the Cartesian Coordinate Grid (CCG) string that describes the location of a contact point relative to a reference point.  The method takes three arguments, the first of which is the reference point, the second of which is the contact point, and the third of which is the string that will hold the resulting CCG string.  It returns a boolean value indicating the success of the operation.

If three-dimensional GeodeticPoints are used with this method, the Height coordinates will be ignored.  The Height of the points will be assumed to be 0 so that the calculations will occur on the surface of the Ellipsoid.

 

Example

void Ellipsoid_CCGridInverse(GEOCALCPBW_NAMESPACE::DataSource & dataSource)

{

GEOCALCPBW_NAMESPACE::Ellipsoid * ell = dataSource.GetEllipsoid(L"BMG", L"WGS84");

GEOCALCPBW_NAMESPACE::GeodeticPoint * refPt = dataSource.GetGeodeticPoint(L"BMG", L"GEODETIC_POINT_DEGREES");

GEOCALCPBW_NAMESPACE::GeodeticPoint * contactPt = dataSource.GetGeodeticPoint(L"BMG", L"GEODETIC_POINT_DEGREES");

BmgChar ccgString[8];

refPt->set_InUnits(-94, 48);

contactPt->set_InUnits(-95, 48);

 

if(! ell->CCGridInverse(*refPt, *contactPt, ccgString))

{

AfxMessageBox("CCGridInverse failed");

}

}