Public Function ConvertListBack(ByVal targetList As GeoCalcNET.CoordPointCollection, ByVal sourceList As GeoCalcNET.CoordPointCollection) As Integer
public System.Int32 ConvertListBack(GeoCalcNET.CoordPointCollection targetList, GeoCalcNET.CoordPointCollection sourceList)
The ConvertListBack method takes two CoordPointCollection arguments, the first of which is the list of CoordPoints to be converted, and the second of which is the list that will store the CoordPoints that result from the conversion. The method will take the CoordPoints in the first CoordPointCollection, which must each have a type that matches the TargetCoordSys, convert them to the corresponding CoordPoints in the SourceCoordSys, and store the results in the second CoordPointCollection. If any of the CoordPoints has a type that does not match the type of its respective CoordSys, a GeoCalcException will be thrown. The method returns an Integer value indicating the number of points that were successfully converted.
Private Sub GeoCalcNET_CoordTransform_ConvertListBack(ByVal ct As GeoCalcNET.CoordTransform)
Dim sourceCPC As New GeoCalcNET.CoordPointCollection
sourceCPC.PointStyle = ct.SourceCoordSys.PointStyle.Clone()
Dim targetCPC As New GeoCalcNET.CoordPointCollection
targetCPC.PointStyle = ct.TargetCoordSys.PointStyle.Clone()
Dim pt1 As GeoCalcNET.CoordPoint = ct.TargetCoordSys.PointStyle.Clone()
pt1.SetInUnits(1, 2)
targetCPC.AddPoint(pt1)
Dim pt2 As GeoCalcNET.CoordPoint = ct.TargetCoordSys.PointStyle.Clone()
pt2.SetInUnits(-1, 2)
targetCPC.AddPoint(pt2)
Dim numConverted As Integer = ct.ConvertListBack(targetCPC, sourceCPC)
MessageBox.Show("converted " + numConverted.ToString() + " of " + targetCPC.Count.ToString())
End Sub
private void GeoCalcNET_CoordTransform_ConvertListBack(GeoCalcNET.CoordTransform ct)
{
GeoCalcNET.CoordPoint sourcePt = (GeoCalcNET.CoordPoint)ct.SourceCoordSys.PointStyle.Clone();
GeoCalcNET.CoordPointCollection sourceCPC = new GeoCalcNET.CoordPointCollection();
sourceCPC.PointStyle = sourcePt;
GeoCalcNET.CoordPoint targetPt = (GeoCalcNET.CoordPoint)ct.TargetCoordSys.PointStyle.Clone();
GeoCalcNET.CoordPointCollection targetCPC = new GeoCalcNET.CoordPointCollection();
targetCPC.PointStyle = targetPt;
targetPt.SetInUnits(22, 95.3);
targetCPC.AddPoint(targetPt);
int numConverted = ct.ConvertListBack(targetCPC, sourceCPC);
MessageBox.Show("converted " + numConverted.ToString() + " of " + targetCPC.Count.ToString());
}