WRAPPER_API static Projection* CreateProjection(ClassType classType, HorizontalDatum &datum)
The CreateProjection constructor creates a new instance of the Projection class. The constructor requires two arguments, the first of which gives the type of the Projection according to the ClassType enumeration, and the second of which gives the HorizontalDatum from which points will be projected. The Parameters for the new projection will need to be set before the Projection can be used.
void Projection_CreateProjection(GEOCALCPBW_NAMESPACE::DataSource & data)
{
GEOCALCPBW_NAMESPACE::HorizontalDatum * datum = data.GetHorizontalDatum(L"BMG", L"IRELAND");
GEOCALCPBW_NAMESPACE::Projection * proj = GEOCALCPBW_NAMESPACE::Projection::CreateProjection(GEOCALCPBW_NAMESPACE::Projection::ClassType::TransverseMercator, *datum);
GEOCALCPBW_NAMESPACE::AngularValue av;
av.set_InDegrees(-8);
proj->get_Parameters().set_AngularItem(L"central_meridian", av);
av.set_InDegrees(53.5);
proj->get_Parameters().set_AngularItem(L"latitude_of_origin", av);
GEOCALCPBW_NAMESPACE::LinearValue lv;
lv.set_InMeters(200000);
proj->get_Parameters().set_LinearItem(L"false_easting", lv);
lv.set_InMeters(250000);
proj->get_Parameters().set_LinearItem(L"false_northing", lv);
proj->get_Parameters().set_FloatItem(L"scale_factor", 1.000035);
GEOCALCPBW_NAMESPACE::Disposal::Dispose(datum);
GEOCALCPBW_NAMESPACE::Disposal::Dispose(proj);
}