STK ObjectsSend comments on this topic.
ToArray Method (IAgAreaTypePatternCollection)
See Also
Windows





Windows & Linux

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();
[Unmanaged C++]
public: HRESULT ToArray(
    SAFEARRAY * * ppRetVal
);
[Java]
public AgSafeArray toArray();
[Python - STK API ]
def ToArray(self) -> list:

See Also

Example

List all points in an area target
[C#]
if (areaTarget.AreaType == AgEAreaType.ePattern)
{
    // Get IAgAreaTypePatternCollection interface from AreaTypeData
    IAgAreaTypePatternCollection patternPoints = areaTarget.AreaTypeData as IAgAreaTypePatternCollection;

    // ToArray returns a two dimensional array of latitude and longitude points
    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]
If areaTarget.AreaType = AgEAreaType.ePattern Then
	' Get IAgAreaTypePatternCollection interface from AreaTypeData
	Dim patternPoints As IAgAreaTypePatternCollection = TryCast(areaTarget.AreaTypeData, IAgAreaTypePatternCollection)

	' ToArray returns a two dimensional array of latitude and longitude points
	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
© 2024 Analytical Graphics, Inc. All Rights Reserved.