use of org.opengis.filter.spatial.DWithin in project ddf by codice.
the class TestCswRecordMapperFilterVisitor method testVisitDWithin.
@Test
public void testVisitDWithin() {
GeometryFactory geoFactory = new GeometryFactory();
double val = 10;
Expression pt1 = factory.literal(geoFactory.createPoint(new Coordinate(4, 5)));
Expression pt2 = factory.literal(geoFactory.createPoint(new Coordinate(6, 7)));
DWithin filter = factory.dwithin(pt1, pt2, val, "meters");
DWithin duplicate = (DWithin) visitor.visit(filter, null);
assertThat(duplicate.getExpression1(), is(pt1));
assertThat(duplicate.getExpression2(), is(pt2));
assertThat(duplicate.getDistanceUnits(), is(UomOgcMapping.METRE.name()));
assertThat(duplicate.getDistance(), is(val));
}
Aggregations