bool ToGeodeticBase(const CoordPoint &inputPoint, GeodeticPoint &outputPoint) const
The ToGeodeticBase method converts a CoordPoint given in this CoordSys to a GeodeticPoint in the base GeodeticCoordSys. The base GeodeticCoordSys uses the same HorizontalDatum as is used by this CoordSys, except it always uses the Greenwich PrimeMeridian. The method takes two arguments, the first of which is the point to be converted, and the second of which is the point that will store the result of the method. The method returns a boolean value indicating the success of the operation.
void CoordSys_ToGeodeticBase(GEOCALCPBW_NAMESPACE::DataSource & data)
{
GEOCALCPBW_NAMESPACE::GeocentricCoordSys * cs = GEOCALCPBW_NAMESPACE::GeocentricCoordSys::CreateGeocentricCoordSys();
GEOCALCPBW_NAMESPACE::HorizontalDatum * datum = data.GetHorizontalDatum(L"BMG", L"WGS84");
GEOCALCPBW_NAMESPACE::CartesianPoint * ptStyle = data.GetCartesianPoint(L"BMG", L"CARTESIAN_POINT_METERS");
cs->set_Datum(*datum);
cs->set_PointStyle(*ptStyle);
GEOCALCPBW_NAMESPACE::CartesianPoint * sourcePt = (GEOCALCPBW_NAMESPACE::CartesianPoint *)cs->get_PointStyle().CloneCoordPoint();
GEOCALCPBW_NAMESPACE::GeodeticPoint * targetPt = data.GetGeodeticPoint(L"BMG", L"GEODETIC_POINT_DEGREES");
sourcePt->set_InUnits(144, 67, 941);
if(! cs->ToGeodeticBase(*sourcePt, *targetPt))
{
AfxMessageBox("ToGeodeticBase failed");
}
GEOCALCPBW_NAMESPACE::Disposal::Dispose(datum);
GEOCALCPBW_NAMESPACE::Disposal::Dispose(ptStyle);
GEOCALCPBW_NAMESPACE::Disposal::Dispose(sourcePt);
GEOCALCPBW_NAMESPACE::Disposal::Dispose(targetPt);
GEOCALCPBW_NAMESPACE::Disposal::Dispose(cs);
}