提交 e226e8cd authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Remove dead code from TestGeometryUtils

上级 9e9d4238
...@@ -177,11 +177,7 @@ public class TestGeometryUtils extends TestBase { ...@@ -177,11 +177,7 @@ public class TestGeometryUtils extends TestBase {
// Test WKB->Geometry conversion // Test WKB->Geometry conversion
Geometry geometryFromH2 = JTSUtils.ewkb2geometry(wkbFromJTS); Geometry geometryFromH2 = JTSUtils.ewkb2geometry(wkbFromJTS);
// JTS has locale-specific bugs with NaNs, also such geometries are not assertEquals(jtsWkt.replaceAll(" Z", ""), new WKTWriter(numOfDimensions).write(geometryFromH2));
// fully valid
if (!wkt.contains("NaN")) {
assertEquals(jtsWkt.replaceAll(" Z", ""), new WKTWriter(numOfDimensions).write(geometryFromH2));
}
// Test Geometry->WKB conversion // Test Geometry->WKB conversion
assertEquals(wkbFromJTS, JTSUtils.geometry2ewkb(geometryFromJTS)); assertEquals(wkbFromJTS, JTSUtils.geometry2ewkb(geometryFromJTS));
...@@ -203,19 +199,12 @@ public class TestGeometryUtils extends TestBase { ...@@ -203,19 +199,12 @@ public class TestGeometryUtils extends TestBase {
assertNull(envelopeFromH2); assertNull(envelopeFromH2);
assertNull(GeometryUtils.envelope2wkb(envelopeFromH2)); assertNull(GeometryUtils.envelope2wkb(envelopeFromH2));
} else { } else {
double minX = envelopeFromJTS.getMinX(), maxX = envelopeFromJTS.getMaxX(); assertEquals(envelopeFromJTS.getMinX(), envelopeFromH2[0]);
double minY = envelopeFromJTS.getMinY(), maxY = envelopeFromJTS.getMaxY(); assertEquals(envelopeFromJTS.getMaxX(), envelopeFromH2[1]);
if (Double.isNaN(minX) || Double.isNaN(maxX) || Double.isNaN(minY) || Double.isNaN(maxY)) { assertEquals(envelopeFromJTS.getMinY(), envelopeFromH2[2]);
assertNull(envelopeFromH2); assertEquals(envelopeFromJTS.getMaxY(), envelopeFromH2[3]);
assertNull(GeometryUtils.envelope2wkb(envelopeFromH2)); assertEquals(new WKBWriter(2).write(new GeometryFactory().toGeometry(envelopeFromJTS)),
} else { GeometryUtils.envelope2wkb(envelopeFromH2));
assertEquals(minX, envelopeFromH2[0]);
assertEquals(maxX, envelopeFromH2[1]);
assertEquals(minY, envelopeFromH2[2]);
assertEquals(maxY, envelopeFromH2[3]);
assertEquals(new WKBWriter(2).write(new GeometryFactory().toGeometry(envelopeFromJTS)),
GeometryUtils.envelope2wkb(envelopeFromH2));
}
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论