public static void AreEqual(XmlNodeList polygonNodes, MultiPolygon multiPolygon) { for (int i = 0; i < polygonNodes.Count; i++) { AreEqual(polygonNodes[i], multiPolygon.Polygons[i]); } }
private static void WriteBoundary(XmlWriter writer, MultiPolygon boundary) { if (boundary == null || boundary.Polygons == null || boundary.Polygons.Count == 0) return; // Guidance pattern only supports a single polygon-based boundary var polygon = boundary.Polygons[0]; ShapeWriter.WritePolygon(writer, polygon); }
public static void WritePolygon(XmlWriter writer, MultiPolygon multiPolygon) { if (multiPolygon.Polygons == null || multiPolygon.Polygons.Count == 0) return; foreach (var polygon in multiPolygon.Polygons) { WritePolygon(writer, polygon); } }
public PLN Map(MultiPolygon polygon, BoundaryType type, string name) { var isoPolygon = new PLN { A = ConvertPolygonType(type), B = name }; var exteriors = polygon.Polygons.Select(p => p.ExteriorRing).SelectMany(x => Map(x, LSGA.Item1)); var interiors = polygon.Polygons.SelectMany(p => p.InteriorRings).SelectMany(x => Map(x, LSGA.Item2)); isoPolygon.Items = exteriors.Concat(interiors).ToArray(); return isoPolygon; }
public static MultiPolygon LoadPolygon(XmlNodeList polygonNodes) { var multiPolygon = new MultiPolygon(); multiPolygon.Polygons = new List<Polygon>(); foreach (XmlNode polygonNode in polygonNodes) { var polygon = LoadPolygon(polygonNode); if (polygon == null) return null; multiPolygon.Polygons.Add(polygon); } if (multiPolygon.Polygons.Count == 0) return null; return multiPolygon; }
public void GivenMultiPolygonWhenCreatedThenTypeShouldBeMultiPolygon() { var shape = new MultiPolygon(); Assert.AreEqual(ShapeTypeEnum.MultiPolygon, shape.Type); }