Beispiel #1
0
        public void KmlReadGeometryv2_0()
        {
            // initialize the geometry source.
            var kmlSource = new KmlFeatureStreamSource(
                Assembly.GetExecutingAssembly().GetManifestResourceStream("OsmSharp.Test.Unittests.test.v2.0.kml"));

            // pull all the objects from the stream into the given collection.
            var kmlCollection = new FeatureCollection(kmlSource);
            var features      = new List <Feature>(kmlCollection);

            // test collection contents.
            Assert.AreEqual(1, features.Count);
            Assert.IsInstanceOf(typeof(Point), features[0].Geometry);
        }
Beispiel #2
0
        public void KmlReadGeometryv2_1()
        {
            // initialize the geometry source.
            var kmlSource = new KmlFeatureStreamSource(
                Assembly.GetExecutingAssembly().GetManifestResourceStream("OsmSharp.Test.Unittests.test.v2.1.kml"));

            // pull all the objects from the stream into the given collection.
            var kmlCollection = new FeatureCollection(kmlSource);
            var features      = new List <Feature>(kmlCollection);

            // test collection contents.
            Assert.AreEqual(23, features.Count);
            Assert.IsInstanceOf(typeof(LineString), features[0].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[1].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[2].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[3].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[4].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[5].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[6].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[7].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[8].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[9].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[10].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[11].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[12].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[13].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[14].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[15].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[16].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[17].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[18].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[19].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[20].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[21].Geometry);
            Assert.IsInstanceOf(typeof(LineString), features[22].Geometry);
        }