ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Geometry Namespace / IGeometryEngine Interface / ReverseOrientation Method
The polygon or polyline whose orientation will be reversed.
Example

In This Topic
    ReverseOrientation Method (IGeometryEngine)
    In This Topic
    Reverse the orientation of the geometry.
    Syntax
    Multipart ReverseOrientation( 
       Multipart multipart
    )
    Function ReverseOrientation( _
       ByVal multipart As Multipart _
    ) As Multipart

    Parameters

    multipart
    The polygon or polyline whose orientation will be reversed.

    Return Value

    A geometry whose directionality has been reversed.
    Exceptions
    ExceptionDescription
    Multipart is null or empty.
    Remarks
    Geometry must be either a Polygon or a Polyline. ReverseOrientation changes the direction of the curve without changing the spatial position of the curve. The From Point and To Point of each Segment are interchanged.
    Caution should be taken in using ReverseOrientation on Polygons. Since ReverseOrientation changes the direction of each Ring within the Polygon, all Exterior Rings become Interior Rings and vice versa.

    GeometryEngine Reverse Orientation

    Example
    Reverse the order of points in a Polygon
    List<Coordinate2D> list2D = new List<Coordinate2D>();
    list2D.Add(new Coordinate2D(1.0, 1.0));
    list2D.Add(new Coordinate2D(1.0, 2.0));
    list2D.Add(new Coordinate2D(2.0, 2.0));
    list2D.Add(new Coordinate2D(2.0, 1.0));
    
    Polygon polygon = PolygonBuilderEx.CreatePolygon(list2D);
    
    Geometry g = GeometryEngine.Instance.ReverseOrientation(polygon);
    Polygon gPolygon = g as Polygon;
    
    // gPolygon.Points[0] = 1.0, 1.0
    // gPolygon.Points[1] = 2.0, 1.0
    // gPolygon.Points[2] = 2.0, 2.0
    // gPolygon.Points[3] = 1.0, 2.0
    // gPolygon.Points[4] = 1.0, 1.0
    // gPolygon.Area = -1 * polygon.Area
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also