CreateGeocentricCoordSys Constructor

WRAPPER_API static GeocentricCoordSys *CreateGeocentricCoordSys()

 

Description

The CreateGeocentricCoordSys constructor creates a new instance of the GeocentricCoordSys class.  The Datum property must be set before the coordinate system can be used.

 

Example

void GeocentricCoordSys_CreateGeocentricCoordSys(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");

}

 

delete datum;

delete ptStyle;

delete sourcePt;

delete targetPt;

delete cs;

}