提交 0eabe18c authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Add some tests

上级 32729d8d
...@@ -106,6 +106,7 @@ public class TestGeometryUtils extends TestBase { ...@@ -106,6 +106,7 @@ public class TestGeometryUtils extends TestBase {
testGeometry("POINT (-1E32 1.000001)", "POINT (-1E32 1.000001)", testGeometry("POINT (-1E32 1.000001)", "POINT (-1E32 1.000001)",
"POINT (-100000000000000000000000000000000 1.000001)", 2); "POINT (-100000000000000000000000000000000 1.000001)", 2);
testGeometry("POINT Z (2.7 -3 34)", 3); testGeometry("POINT Z (2.7 -3 34)", 3);
assertEquals("POINT Z (1 2 3)", EWKTUtils.ewkb2ewkt(EWKTUtils.ewkt2ewkb("POINTz(1 2 3)")));
} }
private void testLineString() throws Exception { private void testLineString() throws Exception {
...@@ -226,6 +227,7 @@ public class TestGeometryUtils extends TestBase { ...@@ -226,6 +227,7 @@ public class TestGeometryUtils extends TestBase {
private void testDimensionM() { private void testDimensionM() {
byte[] ewkb = EWKTUtils.ewkt2ewkb("POINT M (1 2 3)"); byte[] ewkb = EWKTUtils.ewkt2ewkb("POINT M (1 2 3)");
assertEquals("POINT M (1 2 3)", EWKTUtils.ewkb2ewkt(ewkb)); assertEquals("POINT M (1 2 3)", EWKTUtils.ewkb2ewkt(ewkb));
assertEquals("POINT M (1 2 3)", EWKTUtils.ewkb2ewkt(EWKTUtils.ewkt2ewkb("POINTm(1 2 3)")));
Point p = (Point) JTSUtils.ewkb2geometry(ewkb); Point p = (Point) JTSUtils.ewkb2geometry(ewkb);
CoordinateSequence cs = p.getCoordinateSequence(); CoordinateSequence cs = p.getCoordinateSequence();
assertEquals(4, cs.getDimension()); assertEquals(4, cs.getDimension());
...@@ -240,6 +242,7 @@ public class TestGeometryUtils extends TestBase { ...@@ -240,6 +242,7 @@ public class TestGeometryUtils extends TestBase {
private void testDimensionZM() { private void testDimensionZM() {
byte[] ewkb = EWKTUtils.ewkt2ewkb("POINT ZM (1 2 3 4)"); byte[] ewkb = EWKTUtils.ewkt2ewkb("POINT ZM (1 2 3 4)");
assertEquals("POINT ZM (1 2 3 4)", EWKTUtils.ewkb2ewkt(ewkb)); assertEquals("POINT ZM (1 2 3 4)", EWKTUtils.ewkb2ewkt(ewkb));
assertEquals("POINT ZM (1 2 3 4)", EWKTUtils.ewkb2ewkt(EWKTUtils.ewkt2ewkb("POINTzm(1 2 3 4)")));
Point p = (Point) JTSUtils.ewkb2geometry(ewkb); Point p = (Point) JTSUtils.ewkb2geometry(ewkb);
CoordinateSequence cs = p.getCoordinateSequence(); CoordinateSequence cs = p.getCoordinateSequence();
assertEquals(4, cs.getDimension()); assertEquals(4, cs.getDimension());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论