Esempio n. 1
0
        public void TestSTBoundingDiagonalWithFits()
        {
            using (var db = new PostGisTestDataConnection(TestDatabaseConnectionString))
            {
                db.TestGeometries
                .Value(g => g.Id, 1)
                .Value(g => g.Geometry, () => GeometryConstructors.STMakePoint(0, 0).STBuffer(10))
                .Insert();

                var bbBoxDiagonal1 = db.TestGeometries
                                     .Select(g => g.Geometry.STBoundingDiagonal(false).STAsText())
                                     .Single();
                Assert.AreEqual("LINESTRING(-10 -10,10 10)", bbBoxDiagonal1);

                var bbBoxDiagonal2 = db.TestGeometries
                                     .Select(g => GeometryAccessors.STBoundingDiagonal(g.Geometry.STAsText(), false).STAsText())
                                     .Single();
                Assert.AreEqual("LINESTRING(-10 -10,10 10)", bbBoxDiagonal2);

                Assert.IsNull(db.Select(() => GeometryAccessors.STBoundingDiagonal((NTSG)null, false)));
            }
        }