public FidTransformeVisitor(FeatureTypeMap map) { super(CommonFactoryFinder.getFilterFactory2(null)); this.map = map; }
@Test public void testMaxVisitorDelegation() throws SchemaException, IOException { MaxVisitor visitor = new MaxVisitor(CommonFactoryFinder.getFilterFactory2().property("value")); assertOptimalVisit(visitor); }
public OGCBBOXTypeBinding() { // (JD) TODO: fix this. The reason we dont use constructor injection to get // the factory is that pico does not do both setter + constructor injection // And since we support setter injection of a crs we just fall back on // common factory finder... since there is actually only one filter factory // impl not a huge deal, but it woul dbe nice to be consistent factory = CommonFactoryFinder.getFilterFactory2(null); }
/** Constructor injection */ public ExpressionDOMParser(FilterFactory2 factory) { ff = factory != null ? factory : CommonFactoryFinder.getFilterFactory2(null); } /** Setter injection */
/** Constructor which flags the operator as between. */ public LogicSAXParser() { this(CommonFactoryFinder.getFilterFactory2()); } /** Constructor injection */
Hints.putSystemDefault(Hints.FILTER_FACTORY, CommonFactoryFinder.getFilterFactory2(null)); Hints.putSystemDefault(Hints.STYLE_FACTORY, CommonFactoryFinder.getStyleFactory(null)); Hints.putSystemDefault(Hints.FEATURE_FACTORY, CommonFactoryFinder.getFeatureFactory(null));
FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
public SelectedChannelTypeImpl(org.opengis.style.SelectedChannelType gray) { filterFactory = CommonFactoryFinder.getFilterFactory2(null); name = gray.getChannelName(); if (gray.getContrastEnhancement() != null) { contrastEnhancement = new ContrastEnhancementImpl(gray.getContrastEnhancement()); } }
@Before public void setUp() throws Exception { sf = (StyleFactory2) CommonFactoryFinder.getStyleFactory(null); ff = CommonFactoryFinder.getFilterFactory2(null); }
private void invertAxisInFilter(Query query) { Filter filter = query.getFilter(); FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); InvertAxisFilterVisitor visitor = new InvertAxisFilterVisitor(ff, new GeometryFactory()); filter = (Filter) filter.accept(visitor, null); query.setFilter(filter); }
protected Filter partialIndexedFilter_2idxfilterResults() { FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(); List<Filter> filters = Arrays.asList( totallyIndexedFilter(), ff.like(ff.property(attLocationName), "*fer*"), totallyIndexedFilter2()); Filter filter = ff.and(filters); return filter; }
@Test public void testMaxVisitorDelegation() throws SchemaException, IOException { MaxVisitor visitor = new MaxVisitor(CommonFactoryFinder.getFilterFactory2().property("value")); assertOptimalVisit(visitor); }
@Before public void setUp() throws Exception { sf = CommonFactoryFinder.getStyleFactory(null); ff = CommonFactoryFinder.getFilterFactory2(null); sb = new StyleBuilder(sf, ff); scale = 2.0; visitor = new RescaleStyleVisitor(scale); }
@Test public void testNoVocabFunction() { FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); Function function = ff.function("Vocab", ff.literal("a"), ff.literal("urn:1234")); try { function.evaluate(null); fail("Should not be able to get this far"); } catch (Exception expected) { } }
private Filter totallyIndexedFilter() { FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(); Filter filter = ff.or( ff.equals(ff.property("st:Station"), ff.literal("st.1")), ff.like(ff.property("st:Station/st:name"), "*fer*")); return filter; }
private Filter partialIndexedFilterXpath() { FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(); Filter filter = ff.and( ff.equals(ff.property("st:Station"), ff.literal("st.1")), ff.like(ff.property("st:Station/st:location/st:name"), "*fer*")); return filter; } }
private Style createCoverageStyle(String bandName) { StyleFactory sf = CommonFactoryFinder.getStyleFactory(null); FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); ContrastEnhancement ce = sf.contrastEnhancement(ff.literal(1.0), ContrastMethod.NORMALIZE); SelectedChannelType sct = sf.createSelectedChannelType(bandName, ce); RasterSymbolizer sym = sf.getDefaultRasterSymbolizer(); ChannelSelection sel = sf.channelSelection(sct); sym.setChannelSelection(sel); return SLD.wrapSymbolizers(sym); }
public void testIntersectsFilter() throws Exception { FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); // should match only "r1" GeometryFactory gf = new GeometryFactory(); PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory(); LineString ls = gf.createLineString(sf.create(new double[] {2, 1, 2, 3}, 2)); Intersects is = ff.intersects(ff.property(aname("geom")), ff.literal(ls)); FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(is); checkSingleResult(features, "r1"); }
public void testContainsFilter() 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); Contains cs = ff.contains(ff.literal(polygon), ff.property(aname("geom"))); FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(cs); checkSingleResult(features, "r2"); }
@BeforeClass public static void setUpBeforeClass() throws Exception { ff = CommonFactoryFinder.getFilterFactory2(null); filters = new Filters(ff); a = ff.greater(ff.property("zone"), ff.literal(7)); b = ff.like(ff.property("suburb"), "N%"); c = ff.equals(ff.property("Subject"), ff.literal("foo")); d = ff.equals(ff.property("Subject"), ff.literal("bar")); }