/// <summary> /// Adds the specified <see cref="InnerBoundary"/> to this instance. /// </summary> /// <param name="boundary"> /// The <c>InnerBoundary</c> to add to this instance. /// </param> /// <exception cref="System.ArgumentNullException">boundary is null.</exception> /// <exception cref="System.InvalidOperationException"> /// boundary belongs to another <see cref="Element"/>. /// </exception> public void AddInnerBoundary(InnerBoundary boundary) { this.AddChild(boundary); }
private Polygon CreateKmlPolygon(IPolygon polygon) { var kmlPolygon = new Polygon(); var ring = new LinearRing { Coordinates = new CoordinateCollection() }; kmlPolygon.OuterBoundary = new OuterBoundary { LinearRing = ring }; foreach (var coordinate in polygon.ExteriorRing.Coordinates) { ring.Coordinates.Add(new Vector(coordinate.Y, coordinate.X)); } foreach (var interiorRing in polygon.InteriorRings) { var innerBoundary = new InnerBoundary(); kmlPolygon.AddInnerBoundary(innerBoundary); ring = new LinearRing { Coordinates = new CoordinateCollection() }; innerBoundary.LinearRing = ring; foreach (var coordinate in interiorRing.Coordinates) { ring.Coordinates.Add(new Vector(coordinate.Y, coordinate.X)); } } return kmlPolygon; }