PolygonN
Base Type: Polygon
A class for a polygon represented in normalized form.
Property |
Type |
Description |
---|---|---|
Extent |
Bounding extent of the polygon. | |
HasID |
bool |
True if the polygon is composed of points that define a id property. |
HasM |
bool |
True if the polygon is composed of points that define an M (measure) property. |
HasZ |
bool |
True if the polygon is composed of points that define a Z (3rd dimension) property. |
RingArray |
Ring[] |
An array of rings that define the polygon. |
SpatialReference |
The spatial reference associated with the polygon. |
Remarks
This type should be used to construct a polygon and will be used when a service operation returns a polygon. See the Polygon discussion for more information.
Examples
C#
// Ring 1
PointN pnt1a = new PointN();
pnt1a.X = 10.0;
pnt1a.Y = 30.0;
PointN pnt2a = new PointN();
pnt2a.X = 10.0;
pnt2a.Y = 45.0;
PointN pnt3a = new PointN();
pnt3a.X = 25.0;
pnt3a.Y = 45.0;
PointN pnt4a = new PointN();
pnt4a.X = 25.0;
pnt4a.Y = 30.0;
PointN pnt5a = new PointN();
pnt5a.X = 10.0;
pnt5a.Y = 30.0;
PointN[] pnts1a = new PointN[] { pnt1a, pnt2a, pnt3a, pnt4a, pnt5a };
Ring ring1 = new Ring();
ring1.PointArray = pnts1a;
// Ring 2
PointN pnt1b = new PointN();
pnt1b.X = 15.0;
pnt1b.Y = 35.0;
PointN pnt2b = new PointN();
pnt2b.X = 15.0;
pnt2b.Y = 50.0;
PointN pnt3b = new PointN();
pnt3b.X = 30.0;
pnt3b.Y = 50.0;
PointN pnt4b = new PointN();
pnt4b.X = 30.0;
pnt4b.Y = 35.0;
PointN pnt5b = new PointN();
pnt5b.X = 15.0;
pnt5b.Y = 35.0;
PointN[] pnts1b = new PointN[] { pnt1b, pnt2b, pnt3b, pnt4b, pnt5b };
Ring ring2 = new Ring();
ring2.PointArray = pnts1b;
// Multipart Polygon (2 overlapping rings)
Ring[] rings = new Ring[] { ring1, ring2 };
PolygonN polygon1 = new PolygonN();
polygon1.RingArray = rings;
2/28/2020