예제 #1
0
        public void Polygons()
        {
            var wkt = new WktSanitizer();

            Assert.Equal("POLYGON ((0 0, 1 1, 2 2, 0 0))", wkt.Sanitize("POLYGON ((0 0, 1 1, 2 2, 0 0))"));
            Assert.Equal("POLYGON ((0 0, 1 1, 2 2, 0 0))", wkt.Sanitize("POLYGON ((0 0 0, 1 1 1, 2 2 2, 0 0 0))"));
            Assert.Equal("POLYGON ((0 0, 1 1, 2 2, 0 0))", wkt.Sanitize("POLYGON ((0 0 0 0, 1 1 1 1, 2 2 2 2, 0 0 0 0))"));
            Assert.Equal("POLYGON ((0 0, 1 1, 2 2, 0 0))", wkt.Sanitize("POLYGON Z ((0 0 0, 1 1 1, 2 2 2, 0 0 0))"));
            Assert.Equal("POLYGON ((0 0, 1 1, 2 2, 0 0))", wkt.Sanitize("POLYGON M ((0 0 0, 1 1 1, 2 2 2, 0 0 0))"));
            Assert.Equal("POLYGON ((0 0, 1 1, 2 2, 0 0))", wkt.Sanitize("POLYGON ZM ((0 0 0 0, 1 1 1 1, 2 2 2 2, 0 0 0 0))"));
        }
예제 #2
0
        public void Points()
        {
            var wkt = new WktSanitizer();

            Assert.Equal("POINT (0 0)", wkt.Sanitize("POINT (0 0)"));
            Assert.Equal("POINT (0 0)", wkt.Sanitize("POINT (0 0 0)"));
            Assert.Equal("POINT (0 0)", wkt.Sanitize("POINT (0 0 0 0)"));
            Assert.Equal("POINT (0 0)", wkt.Sanitize("POINT Z (0 0 0)"));
            Assert.Equal("POINT (0 0)", wkt.Sanitize("POINT M (0 0 0)"));
            Assert.Equal("POINT (0 0)", wkt.Sanitize("POINT ZM (0 0 0 0)"));
        }
예제 #3
0
        public void LineStrings()
        {
            var wkt = new WktSanitizer();

            Assert.Equal("LINESTRING (0 0, 1 1)", wkt.Sanitize("LINESTRING (0 0, 1 1)"));
            Assert.Equal("LINESTRING (0 0, 1 1)", wkt.Sanitize("LINESTRING (0 0 0, 1 1 1)"));
            Assert.Equal("LINESTRING (0 0, 1 1)", wkt.Sanitize("LINESTRING (0 0 0 0, 1 1 1 1)"));
            Assert.Equal("LINESTRING (0 0, 1 1)", wkt.Sanitize("LINESTRING Z (0 0 0, 1 1 1)"));
            Assert.Equal("LINESTRING (0 0, 1 1)", wkt.Sanitize("LINESTRING M (0 0 0, 1 1 1)"));
            Assert.Equal("LINESTRING (0 0, 1 1)", wkt.Sanitize("LINESTRING ZM (0 0 0 0, 1 1 1 1)"));
        }
예제 #4
0
        public void Rectangle()
        {
            var wkt = new WktSanitizer();

            Assert.Equal("10.8 34.9 89.0 78.2", wkt.Sanitize("10.8 34.9 89.0 78.2"));
        }