ReverseOrientation Method (IGeometryEngine)
Reverse the orientation of the geometry.
Parameters
- multipart
- The polygon or polyline whose orientation will be reversed.
Return Value
A geometry whose directionality has been reversed. If the input multipart is empty, then it is returned unchanged.
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
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.