Esempio n. 1
0
        public void TestSTCoordDim()
        {
            using (var db = new PostGisTestDataConnection(TestDatabaseConnectionString))
            {
                const string Wkt = "CIRCULARSTRING(1 2 3, 1 3 4, 5 6 7, 8 9 10, 11 12 13)";
                db.TestGeometries
                .Value(g => g.Id, 1)
                .Value(g => g.Geometry, () => GeometryInput.STGeomFromText(Wkt))
                .Insert();

                Assert.AreEqual(
                    3,
                    db.TestGeometries
                    .Where(g => g.Id == 1)
                    .Select(g => g.Geometry.STCoordDim())
                    .Single());

                Assert.IsNull(db.Select(() => GeometryAccessors.STCoordDim((NTSG)null)));
                Assert.AreEqual(3, db.Select(() => GeometryAccessors.STCoordDim("CIRCULARSTRING(1 2 3, 1 3 4, 5 6 7, 8 9 10, 11 12 13)")));
            }
        }