///<summary> /// Returns the boundary, or the empty geometry if this Geometry is empty. ///</summary> ///<remarks>For a discussion /// of this function, see the OpenGIS Simple Features Specification. As stated in SFS /// Section 2.1.13.1, "the boundary of a Geometry is a set of Geometries of the next lower dimension."</remarks> ///<returns>Returns the closure of the combinatorial boundary of this Geometry</returns> public override Geometry GetBoundary() { if (IsEmpty()) { return(_geometryFactory.CreateGeometryCollection(null)); } //LineString[] allRings = new LineString[_geometries.Length]; ArrayList allRings = new ArrayList(); for (int i = 0; i < _geometries.Length; i++) { Polygon polygon = (Polygon)_geometries[i]; GeometryCollection rings = (GeometryCollection)polygon.GetBoundary(); for (int j = 0; j < rings.GetNumGeometries(); j++) { //allRings[j] = rings[j-i] as LineString; allRings.Add(rings.GetGeometryN(j)); } } return(_geometryFactory.CreateMultiLineString(GeometryFactory.ToLineStringArray(allRings))); }