public void TestSTAsSVG() { using (var db = new PostGisTestDataConnection(TestDatabaseConnectionString)) { var geometry1 = db.Select(() => GeometryInput.STGeomFromText("POLYGON((0 0,0 1,1 1,1 0,0 0))")); var svg1 = db.Select(() => GeometryOutput.STAsSVG(geometry1)); Assert.AreEqual("M 0 0 L 0 -1 1 -1 1 0 Z", svg1); Assert.IsNull(db.Select(() => GeometryOutput.STAsSVG(null))); // geography db.TestGeographies .Value(g => g.Id, 1) .Value(g => g.Geography, () => GeometryInput.STGeographyFromText("POINT(30 60)")) .Insert(); var svg2 = db.TestGeographies .Where(g => g.Id == 1) .Select(g => g.Geography.STAsSVG()) .Single(); Assert.AreEqual( "cx=\"30\" cy=\"-60\"", svg2); } }
public void TestSTAsSVG() { using (var db = new PostGisTestDataConnection(TestDatabaseConnectionString)) { var g1 = db.Select(() => GeometryInput.STGeomFromText("POLYGON((0 0,0 1,1 1,1 0,0 0))")); var svg1 = db.Select(() => GeometryOutput.STAsSVG(g1)); Assert.AreEqual("M 0 0 L 0 -1 1 -1 1 0 Z", svg1); Assert.IsNull(db.Select(() => GeometryOutput.STAsSVG(null))); } }