use of com.revolsys.geometry.operation.valid.CoordinateNaNError in project com.revolsys.open by revolsys.
the class IsValidTest method testNaNCoordinate.
public void testNaNCoordinate() throws Exception {
final Point badCoord = new PointDoubleXY(1.0, Double.NaN);
final Point[] pts = { new PointDoubleXY(0.0, 0.0), badCoord };
final Geometry line = this.geometryFactory.lineString(pts);
final IsValidOp isValidOp = new IsValidOp(line);
final boolean valid = isValidOp.isValid();
final GeometryValidationError err = isValidOp.getValidationError();
final Point errCoord = err.getErrorPoint();
assertTrue(err instanceof CoordinateNaNError);
assertTrue(Double.isNaN(errCoord.getY()));
assertEquals(false, valid);
}
Aggregations