Example #1
0
        public void TestSTGeomFromKML()
        {
            using (var db = new PostGisTestDataConnection(TestDatabaseConnectionString))
            {
                var ewkt1 = db.Select(() => GeometryInput.STGeomFromKML("<LineString><coordinates>-71.1663, 42.2614 -71.1667, 42.2616</coordinates></LineString>").STAsEWKT());
                Assert.AreEqual("SRID=4326;LINESTRING(-71.1663 42.2614,-71.1667 42.2616)", ewkt1);

                var ewkt2 = db.Select(() => GeometryInput.STGeomFromKML(null).STAsEWKT());
                Assert.IsNull(ewkt2);
            }
        }