Example #1
0
        public void TestSTPoints()
        {
            using (var db = new PostGisTestDataConnection(TestDatabaseConnectionString))
            {
                const string Wkt = "POLYGON Z ((30 10 4,10 30 5,40 40 6, 30 10 4))";
                db.TestGeometries
                .Value(g => g.Id, 1)
                .Value(g => g.Geometry, () => GeometryInput.STGeomFromText(Wkt))
                .Insert();

                const string ExpectedMultiPoint = "MULTIPOINT Z (30 10 4,10 30 5,40 40 6,30 10 4)";
                Assert.AreEqual(ExpectedMultiPoint, db.TestGeometries.Select(g => g.Geometry.STPoints().STAsText()).Single());
                Assert.AreEqual(ExpectedMultiPoint, db.Select(() => GeometryAccessors.STPoints(Wkt).STAsText()));
                Assert.IsNull(db.Select(() => GeometryAccessors.STPoints((NTSG)null)));
            }
        }