WKTForceMatch Property

Type

Boolean

 

Access

Get/Set

 

Description

The WKTForceMatch property indicates if GeoCalc should create a new ICoordSys when importing a ICoordSys from a Well-Known Text (WKT) string using the ImportCoordSysFromFile and ImportCoordSysFromString methods, of if an existing ICoordSys should be found that matches the WKT string.  If this property is set to true, then GeoCalc will attempt to find an existing ICoordSys in the DataSource that matches the WKT string.  It will not try to match the names and identifiers given in the WKT, only the parameters.  If this property is set to false, then a new ICoordSys object will 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 ICoordSys in the DataSource that matches the WKT can be a computationally expensive operation.

 

Example

[VB6]

Sub DataSource_WKTForceMatch(data As DataSource, wkt As String)

    data.WKTForceMatch = True

    

    On Error GoTo ImportError

    Dim importedCS As ICoordSys

    Set importedCS = data.ImportCoordSysFromString(wkt)

    

    Exit Sub

ImportError:

    MsgBox (err.Description)

End Sub

 

[Delphi 7]

procedure DataSource_WKTForceMatch(data : DataSource; wkt : WideString);

var

  importedCS : ICoordSys;

begin

  data.WKTForceMatch := true;

  try

    importedCS := data.ImportCoordSysFromString(wkt);

  except

    on e : EOleException do ShowMessage(e.Message);

  end;

end;