Polygon Class
Updated: June 30, 2017
Polygon geometry class in the Azure DocumentDB database service.
A polygon is represented by the set of "polygon rings". Each ring is closed line string. First ring defines external ring. All subsequent rings define "holes" in the external ring.
Rings must be specified using Left Hand Rule: traversing the ring in the order of its points, should result in internal area of the polygon being to the left side.
Assembly: Microsoft.Azure.Documents.Client (in Microsoft.Azure.Documents.Client.dll)
| Name | Description | |
|---|---|---|
![]() | Polygon | Initializes a new instance of the Polygon class in the Azure DocumentDB database service. |
![]() | Polygon | Initializes a new instance of the Polygon class in the Azure DocumentDB database service. |
![]() | Polygon | Initializes a new instance of the Polygon class, from external ring (the polygon contains no holes) in the Azure DocumentDB database service. |
| Name | Description | |
|---|---|---|
![]() | Gets additional properties in the Azure DocumentDB database service. (Inherited from Geometry.) | |
![]() | Gets bounding box for this geometry in the Azure DocumentDB database service. (Inherited from Geometry.) | |
![]() | Gets the Coordinate Reference System for this geometry in the Azure DocumentDB database service. (Inherited from Geometry.) | |
![]() | Gets the polygon rings in the Azure DocumentDB database service. | |
![]() | Gets geometry type in the Azure DocumentDB database service. (Inherited from Geometry.) |
| Name | Description | |
|---|---|---|
![]() | Equals | Determines whether the specified Polygon is equal to the current Polygon in the Azure DocumentDB database service. (Overrides GeometryEquals.) |
![]() | Equals | Determines if this Polygon is equal to the other in the Azure DocumentDB database service. |
![]() | GetHashCode | Serves as a hash function for the Polygon type in the Azure DocumentDB database service. (Overrides GeometryGetHashCode.) |
![]() | GetType | (Inherited from Object.) |
![]() | ToString | (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | Distance | Distance in meters between two geometries in the Azure DocumentDB database service. (Defined by GeometryOperationExtensions.) |
![]() | Intersects | Checks if geometry1 intersects with geometry2. (Defined by GeometryOperationExtensions.) |
![]() | IsDefined | Determines if a certain property is defined or not. (Defined by TypeCheckFunctionsExtensions.) |
![]() | IsNull | Determines if a certain property is null or not. (Defined by TypeCheckFunctionsExtensions.) |
![]() | IsPrimitive | Determines if a certain property is of premitive JSON type. (Defined by TypeCheckFunctionsExtensions.) |
![]() | IsValid | Determines if the geometry specified is valid and can be indexed or used in queries by Azure DocumentDB database service. If a geometry is not valid, it will not be indexed. Also during query time invalid geometries are equivalent to undefined. (Defined by GeometryOperationExtensions.) |
![]() | IsValidDetailed | Determines if the geometry specified is valid and can be indexed or used in queries by Azure DocumentDB database service. If a geometry is not valid, it will not be indexed. Also during query time invalid geometries are equivalent to undefined. (Defined by GeometryOperationExtensions.) |
![]() | Within | Determines if innerGeometry is fully contained inside outerGeometry in the Azure DocumentDB database service. (Defined by GeometryOperationExtensions.) |
This example shows how to define a polygon which covers small portion of the Earth:
var polygon = new Polygon( new[] { new Position(20.0, 20.0), new Position(30.0, 20.0), new Position(30.0, 30.0), new Position(20.0, 30.0) new Position(20.0, 20.0) });
This example shows how to define a polygon which covers area more than one hemisphere: (Notice that only order of coordinates was reversed).
var polygon = new Polygon( new[] { new Position(20.0, 20.0), new Position(20.0, 30.0), new Position(30.0, 30.0), new Position(30.0, 20.0) new Position(20.0, 20.0) });
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

