Description
Returns the lat lons as a two dimensional
array.
Syntax
[Visual Basic .NET] |
Public Function ToArray() As System.Array
|
[C#] |
public System.Array ToArray();
|
[Managed C++] |
public: System::Array ToArray();
|
[Java] |
public Object[] toArray();
|
[Unmanaged C++] |
public: HRESULT ToArray(
SAFEARRAY ** Array
);
|
Example
List all points in an
area target
[C#] |
Copy Code
|
if (areaTarget.AreaType == AgEAreaType.ePattern)
{
IAgAreaTypePatternCollection patternPoints = areaTarget.AreaTypeData as IAgAreaTypePatternCollection;
Array areaTargetPoints = patternPoints.ToArray();
Console.WriteLine("All points in Area Target");
for (int i = 0; i < areaTargetPoints.GetLength(0); ++i)
{
Console.WriteLine(" Latitude {0} Longitude: {1}",
Convert.ToDouble(areaTargetPoints.GetValue(i, 0)),
Convert.ToDouble(areaTargetPoints.GetValue(i, 1)));
}
}
|
|
List all points in an
area target
[Visual Basic .NET] |
Copy Code
|
If areaTarget.AreaType = AgEAreaType.ePattern
Then
Dim
patternPoints As
IAgAreaTypePatternCollection = TryCast(areaTarget.AreaTypeData,
IAgAreaTypePatternCollection)
Dim
areaTargetPoints As Array = patternPoints.ToArray()
Console.WriteLine("All
points in Area Target")
Dim i
As Integer = 0
While i <
areaTargetPoints.GetLength(0)
Console.WriteLine("
Latitude {0} Longitude: {1}",
Convert.ToDouble(areaTargetPoints.GetValue(i, 0)),
Convert.ToDouble(areaTargetPoints.GetValue(i, 1)))
System.Threading.Interlocked.Increment(i)
End
While
End If
|
|
See Also