Skip To Content ArcGIS for Developers Sign In Dashboard

Polygon Class

class Esri::ArcGISRuntime::Polygon

A geometry with an area shape defined by a collection of parts. More...

Header: #include <Polygon>
Since: Esri::ArcGISRuntime 100.0
Inherits: Esri::ArcGISRuntime::Multipart

This class was introduced in Esri::ArcGISRuntime 100.0.

Public Functions

Polygon(const Esri::ArcGISRuntime::Geometry &other)
Polygon(Esri::ArcGISRuntime::Polygon &&other)
Polygon(const Esri::ArcGISRuntime::Polygon &other)
Polygon()
Esri::ArcGISRuntime::Polygon &operator=(Esri::ArcGISRuntime::Polygon &&other)
Esri::ArcGISRuntime::Polygon &operator=(const Esri::ArcGISRuntime::Polygon &other)
virtual ~Polygon() override
bool isValid() const
Esri::ArcGISRuntime::Polyline toPolyline() const

Detailed Description

A Polygon geometry represents the shape and location of an area, for example, a country, island, or a lake. A polygon can be used as the geometry of features and graphics, or as input or output of tasks or geoprocessing operations, such as the output of a drive-time analysis or a GeometryEngine::buffer operation.

Each part of a multipart polygon is a series of connected Segments forming a closed ring. Each part must not cross any other part but may lie completely inside or outside another part. For example, a polygon representing the state of Hawaii would comprise eight disjoint parts, one representing each island. A polygon representing the country of South Africa, which completely surrounds the enclave of Lesotho, would comprise two parts, one contained inside the other.

Polygon is similar to Polyline in that they are both composed of a series of connected segments. Like Polyline, the Polygon class is a Multipart, which provides members for iterating the segments and points of each part in a Polyline. Unlike parts in a Polyline, however, each part of a polygon defines a closed area, so the end point of the last segment in the part is always in the same location as the start point of the first segment, forming a closed boundary.

When defining a polygon part, there is no need to explicitly close it by repeating the start point as the last point. Polygon parts are always interpreted as enclosed areas by ArcGIS Runtime. However, you may need to simplify a polygon created with Runtime before storing it in a geodatabase or using it in geometry operations that rely on topological consistency.

Polygon is immutable. Use PolygonBuilder to create new instances of Polygon.

Member Function Documentation

Polygon::Polygon(const Esri::ArcGISRuntime::Geometry &other)

Converting constructor from other Geometry.

See also Downcast helper functions.

Polygon::Polygon(Esri::ArcGISRuntime::Polygon &&other)

Move constructor from other Polygon.

Polygon::Polygon(const Esri::ArcGISRuntime::Polygon &other)

Copy constructor from other Polygon.

Polygon::Polygon()

Default constructor.

Esri::ArcGISRuntime::Polygon &Polygon::operator=(Esri::ArcGISRuntime::Polygon &&other)

Move operator from other Polygon.

Esri::ArcGISRuntime::Polygon &Polygon::operator=(const Esri::ArcGISRuntime::Polygon &other)

Assignment operator from other Polygon.

[override virtual] Polygon::~Polygon()

Destructor.

bool Polygon::isValid() const

Gets whether this Polygon is valid.

A Polygon is valid if it is not empty and geometryType is GeometryType::Polygon.

Returns true if valid.

This function was introduced in Esri::ArcGISRuntime 100.2.

Esri::ArcGISRuntime::Polyline Polygon::toPolyline() const

Creates a polyline containing paths for all the rings in this polygon.

This function was introduced in Esri::ArcGISRuntime 100.3.


Feedback on this topic?