Object cloneFilter( BinarySpatialOperator bso, Object extraData, Expression ex1, Expression ex2) { return ff.within(ex1, ex2); } }.transform(filter, extraData);
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Expression[] operands = OGCUtils.spatial(node, filterFactory, geometryFactory); return filterFactory.within(operands[0], operands[1]); } }
public BinarySpatialOperator buildSpatialWithinFilter() throws CQLException { Literal geom = this.resultStack.popLiteral(); Expression property = this.resultStack.popExpression(); FilterFactory2 ff = (FilterFactory2) filterFactory; // TODO this cast must be removed. It depends of Geometry // implementation return ff.within(property, geom); }
public Object visit(Within filter, Object arg1) { Expression[][] exps = visitBinarySpatialOp(filter); List combinedFilters = new ArrayList(exps.length); for (int i = 0; i < exps.length; i++) { Expression left = exps[i][0]; Expression right = exps[i][1]; Filter unrolled = ff.within(left, right, filter.getMatchAction()); combinedFilters.add(unrolled); } Filter unrolled = combineOred(combinedFilters); return unrolled; }
/** * @return new instance of {@link Within} operation * @throws CQLException */ public Within buildWithin() throws CQLException { Expression[] params = buildParameters(); return getFilterFactory().within(params[0], params[1]); }
return FILTER_FACT.within(left, right);
static Within withinWithFunction() { return f.within(f.property("the_geom"), function()); }
public Object visit(Within filter, Object extraData) { Expression geometry1 = visit(filter.getExpression1(), extraData); Expression geometry2 = visit(filter.getExpression2(), extraData); return getFactory(extraData).within(geometry1, geometry2, filter.getMatchAction()); }
static Within within() { return f.within(f.property("the_geom"), f.literal(geometry())); }
public static Within within() { return f.within(f.property("the_geom"), f.literal(geometry())); }
Object cloneFilter(BinarySpatialOperator bso, Object extraData, Expression ex1, Expression ex2) { return ff.within(ex1, ex2); } }.transform(filter, extraData);
return factory.within(geometry1, geometry2);
PropertyName expr1 = new AttributeExpressionImpl(testSchema, "testGeometry"); Within filter = fac.within(expr1, expr2); filter = fac.within(expr1, function); LOGGER.finer(filter.toString()); LOGGER.finer("contains feature: " + filter.evaluate(testFeature)); assertTrue(filter.evaluate(testFeature)); filter = fac.within(expr2, expr1); new LiteralExpressionImpl( gf.createPolygon(gf.createLinearRing(coords), new LinearRing[0])); filter = fac.within(expr2, expr1); filter = fac.within(expr2, expr1);
/** Sets up a schema and a test feature. */ protected void setUp() { LOGGER.finer("Setting up FilterCapabilitiesTest"); if (setup) { return; } setup = true; capabilities = new FilterCapabilities(); try { gFilter = fact.within(fact.property("geom"), fact.literal(null)); compFilter = fact.less(fact.property("size"), fact.literal(3)); } catch (IllegalFilterException ife) { LOGGER.fine("Bad filter " + ife); } capabilities.addType(AbstractFilter.LOGIC_OR); capabilities.addType(AbstractFilter.LOGIC_AND); capabilities.addType(AbstractFilter.LOGIC_NOT); capabilities.addType(FilterType.COMPARE_EQUALS); capabilities.addType(FilterType.COMPARE_LESS_THAN); capabilities.addType(AbstractFilter.BETWEEN); }
/** * Same as contains, with roles reversed * * @throws Exception */ public void testWithinFilter() throws Exception { FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); // should match only "r2" GeometryFactory gf = new GeometryFactory(); PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory(); LinearRing shell = gf.createLinearRing(sf.create(new double[] {2, -1, 2, 5, 4, 5, 4, -1, 2, -1}, 2)); Polygon polygon = gf.createPolygon(shell, null); Within wt = ff.within(ff.property(aname("geom")), ff.literal(polygon)); FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(wt); checkSingleResult(features, "r2"); }
Filter areaFilter = ff.within(ff.property(dataGeomName), ff.literal(zoneGeom)); SimpleFeatureCollection zoneCollection = data.subCollection(areaFilter); Results stats =
fac.within( new LiteralExpressionImpl(list), new LiteralExpressionImpl(geom1),
filter = fac.touches(expr1, expr2); assertEquals(filter.getMatchAction(), MatchAction.ANY); filter = fac.within(expr1, expr2); assertEquals(filter.getMatchAction(), MatchAction.ANY); filter = fac.touches(expr1, expr2, MatchAction.ONE); assertEquals(filter.getMatchAction(), MatchAction.ONE); filter = fac.within(expr1, expr2, MatchAction.ALL); assertEquals(filter.getMatchAction(), MatchAction.ALL);