Beispiel #1
0
        public void MultiPoint()
        {
            var expected = MakeFeatureCollection("MULTIPOINT(10 40, 40 30, 20 20, 30 10)");
            var actual   = GeoJsonConversions.ToGeoJson(GeoJsonConversions.FromGeoJson(expected));

            AssertJson(expected, actual);
        }
Beispiel #2
0
        public void MultiPolygon()
        {
            var expected = MakeFeatureCollection("MULTIPOLYGON (((30 20, 45 40, 10 40, 30 20)), ((15 5, 40 10, 10 20, 5 10, 15 5)))");
            var actual   = GeoJsonConversions.Deserialize(GeoJsonConversions.Serialize(expected));

            AssertJson(expected, actual);
        }
Beispiel #3
0
        public void MultiLineString()
        {
            var expected = MakeFeatureCollection("MULTILINESTRING((10 10, 20 20, 10 40), (40 40, 30 30, 40 20, 30 10), (50 50, 60 60, 50 90))");
            var actual   = GeoJsonConversions.ToGeoJson(GeoJsonConversions.FromGeoJson(expected));

            AssertJson(expected, actual);
        }
Beispiel #4
0
        public void Points()
        {
            var expected = MakeFeatureCollection(new string[] { "POINT(1.2 -2.1)", "POINT(2.4 -4.8)" });
            var actual   = GeoJsonConversions.ToGeoJson(GeoJsonConversions.FromGeoJson(expected));

            AssertJson(expected, actual);
        }
Beispiel #5
0
        public void LineString()
        {
            var expected = MakeFeatureCollection("LINESTRING(1.2 -2.1, 2.4 -4.8)");
            var actual   = GeoJsonConversions.ToGeoJson(GeoJsonConversions.FromGeoJson(expected));

            AssertJson(expected, actual);
        }
Beispiel #6
0
        public void MultiPolygonSinglePartWithHole()
        {
            var expected = MakeFeatureCollection("MULTIPOLYGON (((35 10, 45 45, 15 40, 10 20, 35 10), (20 30, 35 35, 30 20, 20 30)))");
            var actual   = GeoJsonConversions.Deserialize(GeoJsonConversions.Serialize(expected));

            AssertJson(expected, actual);
        }
Beispiel #7
0
        public void PolygonWithHole()
        {
            var expected = MakeFeatureCollection("POLYGON ((35 10, 45 45, 15 40, 10 20, 35 10), (20 30, 35 35, 30 20, 20 30))");
            var actual   = GeoJsonConversions.ToGeoJson(GeoJsonConversions.FromGeoJson(expected));

            AssertJson(expected, actual);
        }
Beispiel #8
0
        public void Point()
        {
            var expected = MakeFeatureCollection("POINT(1.2 -2.1)");
            var actual   = GeoJsonConversions.ToGeoJson(GeoJsonConversions.FromGeoJson(expected));

            AssertJson(expected, actual);
        }
Beispiel #9
0
        public void MultiPolygonSinglePart()
        {
            var expected = MakeFeatureCollection("MULTIPOLYGON (((30 20, 45 40, 10 40, 30 20)))");
            var actual   = GeoJsonConversions.ToGeoJson(GeoJsonConversions.FromGeoJson(expected));

            AssertJson(expected, actual);
        }
Beispiel #10
0
        public void MultiPolygonWithHole()
        {
            var expected = MakeFeatureCollection("MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20)))");
            var actual   = GeoJsonConversions.ToGeoJson(GeoJsonConversions.FromGeoJson(expected));

            AssertJson(expected, actual);
        }
Beispiel #11
0
        public void Polygon()
        {
            var expected = MakeFeatureCollection("POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))");
            var actual   = GeoJsonConversions.ToGeoJson(GeoJsonConversions.FromGeoJson(expected));

            AssertJson(expected, actual);
        }
Beispiel #12
0
        public void MultiLineStringSinglePart()
        {
            var expected = MakeFeatureCollection("MULTILINESTRING((1.2 -2.1, 2.4 -4.8))");
            var actual   = GeoJsonConversions.ToGeoJson(GeoJsonConversions.FromGeoJson(expected));

            AssertJson(expected, actual);
        }
Beispiel #13
0
        public void MultiPointAlternativeSyntax()
        {
            var expected = MakeFeatureCollection("MULTIPOINT((10 40), (40 30), (20 20), (30 10))");
            var actual   = GeoJsonConversions.ToGeoJson(GeoJsonConversions.FromGeoJson(expected));

            AssertJson(expected, actual);
        }
Beispiel #14
0
        public async Task MultiLineString()
        {
            var expected = MakeFeatureCollection("MULTILINESTRING((10 10, 20 20, 10 40), (40 40, 30 30, 40 20, 30 10), (50 50, 60 60, 50 90))");
            var bytes    = await GeoJsonConversions.SerializeAsync(expected);

            var actual = GeoJsonConversions.Deserialize(bytes);

            AssertJson(expected, actual);
        }
Beispiel #15
0
        public async Task Point()
        {
            var expected = MakeFeatureCollection("POINT(1.2 -2.1)");
            var bytes    = await GeoJsonConversions.SerializeAsync(expected);

            var actual = GeoJsonConversions.Deserialize(bytes);

            AssertJson(expected, actual);
        }
Beispiel #16
0
        public void Number()
        {
            var attributes = new Dictionary <string, object>()
            {
                ["test"] = 1
            };
            var expected = MakeFeatureCollection(attributes);
            var actual   = GeoJsonConversions.Deserialize(GeoJsonConversions.Serialize(expected));

            AssertJson(expected, actual);
        }
        public void String()
        {
            var attributes = new Dictionary <string, object>()
            {
                ["test"] = "test"
            };
            var expected = MakeFeatureCollection(attributes);
            var actual   = GeoJsonConversions.ToGeoJson(GeoJsonConversions.FromGeoJson(expected));

            AssertJson(expected, actual);
        }
        public void NumberFiveAttribs()
        {
            var attributes = new Dictionary <string, object>()
            {
                ["test"]  = 1,
                ["test2"] = 1,
                ["test3"] = 1,
                ["test4"] = 1,
                ["test5"] = 1
            };
            var expected = MakeFeatureCollection(attributes);
            var actual   = GeoJsonConversions.ToGeoJson(GeoJsonConversions.FromGeoJson(expected));

            AssertJson(expected, actual);
        }
Beispiel #19
0
        public void Mixed()
        {
            var attributes = new Dictionary <string, object>()
            {
                ["test1"] = 1,
                ["test2"] = 1.1,
                ["test3"] = "test",
                ["test4"] = true,
                ["test5"] = "teståöä2",
                ["test6"] = false,
            };
            var expected = MakeFeatureCollection(attributes);
            var actual   = GeoJsonConversions.Deserialize(GeoJsonConversions.Serialize(expected));

            AssertJson(expected, actual);
        }
Beispiel #20
0
        public void NumberTenAttribs()
        {
            var attributes = new Dictionary <string, object>()
            {
                ["test"]   = 1,
                ["test2"]  = 1,
                ["test3"]  = 1,
                ["test4"]  = 1,
                ["test5"]  = 1,
                ["test6"]  = 1,
                ["test7"]  = 1,
                ["test8"]  = 1,
                ["test9"]  = 1,
                ["test10"] = 1
            };
            var expected = MakeFeatureCollection(attributes);
            var actual   = GeoJsonConversions.Deserialize(GeoJsonConversions.Serialize(expected));

            AssertJson(expected, actual);
        }