GetWKTForceMatch Method

WRAPPER_API bool GetWKTForceMatch() const

 

Description

The GetWKTForceMatch method returns a boolean value that indicates if GeoCalc should create a new CoordSys when importing a CoordSys from a Well-Known Text (WKT) string using the ImportCoordSysFromFile and ImportCoordSysFromString methods, or if an existing CoordSys should be found that matches the WKT string.  If this method returns true, then GeoCalc will attempt to find an existing CoordSys in the DataSource that matches the WKT string.  It will not try to match names and identifiers given in the WKT, only the parameters.  If this method returns false, then a new CoordSys object will always be constructed to match the WKT, even if an exact match already exists in the DataSource.  It should be noted that the process of finding a CoordSys in the DataSource that matches the WKT can be a computationally expensive operation.

 

Example

void DataSource_GetWKTForceMatch(GEOCALCPBW_NAMESPACE::DataSource & data, BmgChar * wktString)

{

bool b = data.GetWKTForceMatch();

GEOCALCPBW_NAMESPACE::CoordSys * importedCS = 0;

try

{

importedCS = data.ImportCoordSysFromString(wktString);

}

catch(GEOCALCPBW_NAMESPACE::GeoCalcException & ex)

{

// then the import failed

}

if(importedCS) GEOCALCPBW_NAMESPACE::Disposal::Dispose(importedCS);

}