use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class LineSequencerTest method runLineSequencer.
private void runLineSequencer(final String[] inputWKT, final String expectedWKT) throws ParseException {
final List inputGeoms = fromWKT(inputWKT);
final LineSequencer sequencer = new LineSequencer();
sequencer.add(inputGeoms);
final boolean isCorrect = false;
if (!sequencer.isSequenceable()) {
assertTrue(expectedWKT == null);
} else {
final Geometry expected = geometryFactory.geometry(expectedWKT);
final Geometry result = sequencer.getSequencedLineStrings();
final boolean isOK = expected.equalsNorm(result);
if (!isOK) {
// System.out.println("ERROR - Expected: " + expected);
// System.out.println(" Actual: " + result);
}
assertTrue(isOK);
final boolean isSequenced = LineSequencer.isSequenced(result);
assertTrue(isSequenced);
}
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class LineSequencerTest method runIsSequenced.
private void runIsSequenced(final String inputWKT, final boolean expected) throws ParseException {
final Geometry g = geometryFactory.geometry(inputWKT);
final boolean isSequenced = LineSequencer.isSequenced(g);
assertTrue(isSequenced == expected);
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class RelateBoundaryNodeRuleTest method runRelateTest.
void runRelateTest(final String wkt1, final String wkt2, final BoundaryNodeRule bnRule, final String expectedIM) throws ParseException {
final Geometry g1 = this.geometryFactory.geometry(wkt1);
final Geometry g2 = this.geometryFactory.geometry(wkt2);
final IntersectionMatrix im = RelateOp.relate(g1, g2, bnRule);
final String imStr = im.toString();
// System.out.println(imStr);
assertTrue(im.matches(expectedIM));
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class UnaryUnionTest method doTest.
private void doTest(final String expectedWKT, final String... inputWKT) throws ParseException {
Geometry result;
final Collection<Geometry> geoms = GeometryUtils.readWKT(inputWKT);
if (geoms.size() == 0) {
final GeometryFactory geometryFactory = GeometryFactory.DEFAULT_3D;
result = UnaryUnionOp.union(geoms, geometryFactory);
} else {
result = UnaryUnionOp.union(geoms);
}
Assert.assertEquals(GeometryUtils.readWKT(expectedWKT), result);
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class ValidSelfTouchingRingFormingHoleTest method checkIsValidSTR.
private void checkIsValidSTR(final String wkt, final boolean expected) {
final Geometry geom = fromWKT(wkt);
final IsValidOp validator = new IsValidOp(geom);
validator.setSelfTouchingRingFormingHoleValid(true);
final boolean isValid = validator.isValid();
assertTrue(isValid == expected);
}
Aggregations