Exemplo n.º 1
0
 public static void AreEqual(XmlNodeList polygonNodes, MultiPolygon multiPolygon)
 {
     for (int i = 0; i < polygonNodes.Count; i++)
     {
         AreEqual(polygonNodes[i], multiPolygon.Polygons[i]);
     }
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
0
        public void GivenMultiPolygonWhenCreatedThenTypeShouldBeMultiPolygon()
        {
            var shape = new MultiPolygon();

            Assert.AreEqual(ShapeTypeEnum.MultiPolygon, shape.Type);
        }