Click or drag to resize

LineStringReverse Property

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Returns a LineString with the points in the opposite order to this LineString.

Namespace:  Telogis.GeoBase.Geometry
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
public LineString Reverse { get; }

Property Value

Type: LineString
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)}
);

// Create a new LineString with points in the opposite direction 
Telogis.GeoBase.Geometry.LineString reverseLine = newLine.Reverse;

// Write out the reverse LineString points
IEnumerator<LatLon> reversePoints = reverseLine.GetEnumerator();
while (reversePoints.MoveNext()) {
    Console.WriteLine("LatLon of reverseLine LineString point: {0} ", reversePoints.Current);
}
// Prints points in reverse order of newLine:
// LatLon of reversePoints LineString point: 33.582953,-117.740873
// LatLon of reversePoints LineString point: 33.582902,-117.725361
// LatLon of reversePoints LineString point: 33.594195,-117.726176
// LatLon of reversePoints LineString point: 33.594096,-117.741204
See Also