testRelations(true);
}
public void testRelations(boolean prepare) throws ParseException {
assert !((JtsWktShapeParser)ctx.getWktShapeParser()).isAutoIndex();
//base polygon
JtsGeometry base = (JtsGeometry) ctx.readShapeFromWkt("POLYGON((0 0, 10 0, 5 5, 0 0))");
//shares only "10 0" with base
JtsGeometry polyI = (JtsGeometry) ctx.readShapeFromWkt("POLYGON((10 0, 20 0, 15 5, 10 0))");
//within base: differs from base by one point is within
JtsGeometry polyW = (JtsGeometry) ctx.readShapeFromWkt("POLYGON((0 0, 9 0, 5 5, 0 0))");
//a boundary point of base
Point pointB = ctx.makePoint(0, 0);
//a shared boundary line of base
JtsGeometry lineB = (JtsGeometry) ctx.readShapeFromWkt("LINESTRING(0 0, 10 0)");
//a line sharing only one point with base
JtsGeometry lineI = (JtsGeometry) ctx.readShapeFromWkt("LINESTRING(10 0, 20 0)");
if (prepare) base.index();
assertRelation(CONTAINS, base, base);//preferred result as there is no EQUALS
assertRelation(INTERSECTS, base, polyI);
assertRelation(CONTAINS, base, polyW);