use of com.sldeditor.filter.v2.function.property.IsBetween in project sldeditor by robward-scisys.
the class FilterManager method getFilterConfigList.
/**
* Gets the filter config list.
*
* @return the filter config list
*/
@Override
public List<FilterConfigInterface> getFilterConfigList() {
List<FilterConfigInterface> filterConfigList = new ArrayList<FilterConfigInterface>();
// Logic filters
filterConfigList.add(new And());
filterConfigList.add(new Or());
filterConfigList.add(new Not());
filterConfigList.add(new IsEqualTo());
filterConfigList.add(new IsNotEqualTo());
filterConfigList.add(new IsLessThan());
filterConfigList.add(new IsLessThanEqualTo());
filterConfigList.add(new IsGreaterThan());
filterConfigList.add(new IsGreaterThanEqualTo());
filterConfigList.add(new IsBetween());
filterConfigList.add(new IsNull());
filterConfigList.add(new IsLike());
// Temporal
filterConfigList.add(new After());
filterConfigList.add(new Before());
filterConfigList.add(new During());
filterConfigList.add(new TEquals());
filterConfigList.add(new TOverlaps());
filterConfigList.add(new TContains());
// Geometry
filterConfigList.add(new BBox());
filterConfigList.add(new Beyond());
filterConfigList.add(new Contains());
filterConfigList.add(new Crosses());
filterConfigList.add(new Disjoint());
filterConfigList.add(new DWithin());
filterConfigList.add(new Equals());
filterConfigList.add(new Intersects());
filterConfigList.add(new Overlaps());
filterConfigList.add(new Touches());
filterConfigList.add(new Within());
return filterConfigList;
}
use of com.sldeditor.filter.v2.function.property.IsBetween in project sldeditor by robward-scisys.
the class FilterNodeTest method testSetFilter.
/**
* Test method for
* {@link com.sldeditor.filter.v2.expression.FilterNode#setFilter(org.opengis.filter.Filter, com.sldeditor.filter.v2.function.FilterConfigInterface)}.
*/
@Test
public void testSetFilter() {
FilterFactory ff = CommonFactoryFinder.getFilterFactory();
FilterNode node = new FilterNode();
// BinaryComparisonAbstract
Filter filter = ff.greaterOrEqual(ff.literal(45), ff.literal(23));
node.setFilter(filter, null);
node.addFilter();
String actual = node.toString();
String expected = "Filter : " + Localisation.getString(ExpressionPanelv2.class, "FilterNode.filterNotSet");
assertTrue(actual.compareTo(expected) == 0);
assertEquals(filter, node.getFilter());
FilterConfigInterface filterConfig = new IsGreaterThan();
node.setFilter(filter, filterConfig);
assertEquals(filterConfig, node.getFilterConfig());
expected = "Filter : PropertyIsGreaterThan";
actual = node.toString();
assertTrue(actual.compareTo(expected) == 0);
// PropertyIsLike
filter = ff.like(ff.literal("abc def ghi"), "abc");
filterConfig = new IsLike();
node.setFilter(filter, filterConfig);
expected = "Filter : Like";
actual = node.toString();
assertTrue(actual.compareTo(expected) == 0);
// BinarySpatialOperator
Hints hints = new Hints(Hints.CRS, DefaultGeographicCRS.WGS84);
PositionFactory positionFactory = GeometryFactoryFinder.getPositionFactory(hints);
GeometryFactory geometryFactory = GeometryFactoryFinder.getGeometryFactory(hints);
PrimitiveFactory primitiveFactory = GeometryFactoryFinder.getPrimitiveFactory(hints);
AggregateFactory aggregateFactory = GeometryFactoryFinder.getAggregateFactory(hints);
WKTParser wktParser = new WKTParser(geometryFactory, primitiveFactory, positionFactory, aggregateFactory);
Geometry geometry = null;
try {
geometry = wktParser.parse("POINT( 48.44 -123.37)");
} catch (ParseException e) {
e.printStackTrace();
fail();
}
filter = ff.overlaps("property", geometry);
filterConfig = new Overlaps();
node.setFilter(filter, filterConfig);
expected = "Filter : Overlaps";
actual = node.toString();
assertTrue(actual.compareTo(expected) == 0);
// Is Between
filter = ff.between(ff.literal(25), ff.literal(5), ff.literal(50));
filterConfig = new IsBetween();
node.setFilter(filter, filterConfig);
expected = "Filter : PropertyIsBetween";
actual = node.toString();
assertTrue(actual.compareTo(expected) == 0);
// Is Null
filter = ff.isNull(ff.literal(12));
filterConfig = new IsNull();
node.setFilter(filter, filterConfig);
expected = "Filter : IsNull";
actual = node.toString();
assertTrue(actual.compareTo(expected) == 0);
// BinaryTemporalOperator
filter = ff.after(ff.literal(12), ff.literal(312));
filterConfig = new After();
node.setFilter(filter, filterConfig);
expected = "Filter : After";
actual = node.toString();
assertTrue(actual.compareTo(expected) == 0);
// Logic filter
filter = ff.and(ff.after(ff.literal(12), ff.literal(312)), ff.between(ff.literal(25), ff.literal(5), ff.literal(50)));
filterConfig = new And();
node.setFilter(filter, filterConfig);
expected = "Filter : And";
actual = node.toString();
assertTrue(actual.compareTo(expected) == 0);
node.addFilter();
}
Aggregations