set_Area Method

WRAPPER_API void set_Area(const Envelope &area)

 

Description

The set_Area method sets the Envelope that defines the area in which the DatumShifts must be valid.

 

Example

void DatumShiftPreferencesEx_setArea(GeoCalcPBW::DataSource & data)

{

GeoCalcPBW::CoordSys * source = data.GetGeodeticCoordSys(_towchar("BMG").c_str(), _towchar("AK83-9").c_str());

GeoCalcPBW::CoordSys * target = data.GetProjectedCoordSys(_towchar("BMG").c_str(), _towchar("AK9-27").c_str());

GeoCalcPBW::Envelope * area = data.GetEnvelope(L"BMG", L"STANDARD_ENVELOPE");

 

GeoCalcPBW::DatumShiftPreferencesEx shiftPrefs;

int flags = GeoCalcPBW::DatumShiftPreferencesEx::BitFlag::BursaWolfe_flag |

GeoCalcPBW::DatumShiftPreferencesEx::BitFlag::Molodensky_flag;

shiftPrefs.set_BitFlags((GeoCalcPBW::DatumShiftPreferencesEx::BitFlag)flags);

shiftPrefs.set_IntermediateIssuer(L"BMG");

shiftPrefs.set_IntermediateCode(L"WGS84");

shiftPrefs.set_OnlyGoThruIntermediate(false);

shiftPrefs.set_Area(*area);

 

GeoCalcPBW::DatumShiftInfoSetCollection shiftSets;

 

if(! data.GetValidDatumShifts(*source, *target, shiftPrefs, shiftSets))

{

AfxMessageBox("GetValidDatumShifts failed");

}

delete source;

delete target;

delete area;

}