Esempio n. 1
0
        public void GeoRssFromFile2()
        {
            var xr = XmlReader.Create(new FileStream(TestContext.CurrentContext.TestPath("../Samples/noa-ers-georss.xml"), FileMode.Open, FileAccess.Read));

            MultiPolygon geom = GeoRssHelper.Deserialize(xr).ToGeometry() as MultiPolygon;

            Assert.IsNotNull(geom);

            xr = XmlReader.Create(new FileStream(TestContext.CurrentContext.TestPath("../Samples/noa-ers-georss.xml"), FileMode.Open, FileAccess.Read));

            MultiPolygon geom2 = GeoRssHelper.Deserialize(xr).ToGeometry() as MultiPolygon;

            geom.Polygons.Add(geom2.Polygons[0]);

            geom.ToGeoRss();
        }
Esempio n. 2
0
        public void Gml32MultiSurfaceToGeorss()
        {
            var fs = new FileStream(TestContext.CurrentContext.TestPath("../Samples/multisurface32-2.xml"), FileMode.Open, FileAccess.Read);

            XmlReader reader = XmlReader.Create(fs);

            var gml = GmlHelper.Deserialize(reader);

            fs.Close();

            MultiPolygon geom = (MultiPolygon)Terradue.GeoJson.Gml321.Gml321Extensions.ToGeometry(gml);

            XmlDocument doc = new XmlDocument();

            doc.Load(geom.ToGeoRss().CreateReader());
            doc.Save(TestContext.CurrentContext.TestPath("../out/georssfromgml32.xml"));
        }