SetWKTForceMatch Method

WRAPPER_API void SetWKTForceMatch(bool ignore = true)

 

Description

The SetWKTForceMatch method specifies if a new CoordSys should be constructed 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 is called with an argument of 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 is called with an argument of 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_SetWKTForceMatch(GEOCALCPBW_NAMESPACE::DataSource & data, BmgChar * wktString)

{

data.SetWKTForceMatch(true);

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);

}