Projection Constructor

WRAPPER_API Projection(ClassType classType, HorizontalDatum &datum)

WRAPPER_API Projection(const Projection &source)

 

Description

The Projection constructor creates a new instance of the Projection class.  The first constructor takes two arguments, the first of which is the type of the Projection, according to the ClassType enumeration, and the second of which is the HorizontalDatum from which points will be projected.  Once constructed, it will still be necessary to set the Parameters need by the Projection.  The second constructor is a copy-constructor, which produces a Projection with the same value as the Projection passed as argument.

When using the first constructor, it is important to note that the Projection object holds a reference to the specified HorizontalDatum.  Therefore, one must be sure not to delete the HorizontalDatum used by the Projection before the Projection itself is deleted.

 

Example

void Projection_Projection(GEOCALCPBW_NAMESPACE::DataSource & data)

{

GEOCALCPBW_NAMESPACE::HorizontalDatum * datum = data.GetHorizontalDatum(L"BMG", L"IRELAND");

GEOCALCPBW_NAMESPACE::Projection proj(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);

}