Click or drag to resize

LineStringGetEnumerator Method

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Enumerate all points in the line string.

Namespace:  Telogis.GeoBase.Geometry
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
public IEnumerator<LatLon> GetEnumerator()

Return Value

Type: IEnumeratorLatLon
An enumerator object containing all LatLon points in the line string.
Examples
C#
// Create a LineString from an array of four points
Telogis.GeoBase.Geometry.LineString newLine = new Telogis.GeoBase.Geometry.LineString(
    new Telogis.GeoBase.LatLon[] {
        new Telogis.GeoBase.LatLon(33.594096,-117.741204),
        new Telogis.GeoBase.LatLon(33.594195,-117.726176),
        new Telogis.GeoBase.LatLon(33.582902,-117.725361),
        new Telogis.GeoBase.LatLon(33.582953,-117.740873)}
);

// Enumerate all points in the LineString
IEnumerator<LatLon> points  = newLine.GetEnumerator();

// Write out all points.
while (points.MoveNext())
{
    Console.WriteLine("LatLon of LineString: " + points.Current);
}
// Prints:
// LatLon of LineString: 33.594096,-117.741204
// LatLon of LineString: 33.594195,-117.726176
// LatLon of LineString: 33.582902,-117.725361
// LatLon of LineString: 33.582953,-117.740873
See Also