Examples of literal()


Examples of org.opengis.filter.FilterFactory.literal()

    @Test
    public void testBackendRemovedIssue() throws Exception{
      FeatureStore<SimpleFeatureType, SimpleFeature> fs = (FeatureStore<SimpleFeatureType, SimpleFeature>) store
        .getFeatureSource(featureType.getName().getLocalPart());
        FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        Expression expr2 = factory.literal("1");
    Expression expr1 = factory.property(IssuesListTestHelper.ISSUE_ID_ATTR);
    Filter filter = factory.equals(expr1, expr2);
        fs.removeFeatures(filter);
        list.refresh();
        for( IIssue issue : list ) {
View Full Code Here

Examples of org.opengis.filter.FilterFactory.literal()

        IIssue issue = list.get(0);
        issue.setDescription(newDescription);
        ((IRemoteIssuesList)list).save(issue);
        FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());

        Expression expr2 = factory.literal(issue.getId());
    Expression expr1 = factory.property(IssuesListTestHelper.ISSUE_ID_ATTR);
    Filter filter = factory.equals(expr1, expr2);

        SimpleFeature next = store.getFeatureSource(featureType.getName().getLocalPart()).getFeatures(filter).features().next();
        assertEquals(newDescription, next.getAttribute(IssuesListTestHelper.DESCRIPTION_ATTR));
View Full Code Here

Examples of org.opengis.filter.FilterFactory.literal()

          syms[0]=builder.createLineSymbolizer(baseColor,2);
        if( Point.class.isAssignableFrom(type) ||
            MultiPoint.class.isAssignableFrom(type)){
          PointSymbolizer point = builder.createPointSymbolizer(builder.createGraphic());
          FilterFactory filterFactory = builder.getFilterFactory();
          point.getGraphic().setSize( filterFactory.literal(10));
            for( GraphicalSymbol symbol : point.getGraphic().graphicalSymbols() ){
                if( symbol instanceof Mark){
                    Mark mark = (Mark) symbol;
                    mark.setFill( builder.createFill( baseColor ));
                }
View Full Code Here

Examples of org.opengis.filter.FilterFactory.literal()

          newValues[8]=viewMemento;
         
          FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools
        .getDefaultHints());
    Expression expr1 = factory.property(getAttributeMapper().getId());
    Expression expr2 = factory.literal(issue.getId());
    PropertyIsEqualTo filter = factory.equals(expr1, expr2);
    getFeatureStore().modifyFeatures(attributeType, newValues, filter);
  }

View Full Code Here

Examples of org.opengis.filter.FilterFactory.literal()

   
    Filter filter = null;
   
        for( IIssue issue : changed ) {
            String id=issue.getId();
            Expression expr2 = factory.literal(id);
            PropertyIsEqualTo tmp = factory.equals(expr1, expr2);
           
            if( filter==null )
                filter=tmp;
            else
View Full Code Here

Examples of org.opengis.filter.FilterFactory.literal()

    @Test
    public void testIsValid() throws Exception {
        FilterFactory fac=CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
       
        String attributeName = "string";
        PropertyIsEqualTo filter = fac.equals(fac.property(attributeName), fac.literal("Value"));
       
        SimpleFeatureTypeBuilder builder=new SimpleFeatureTypeBuilder();
        builder.setName("test");
        builder.restriction(filter).add(attributeName, String.class);
       
View Full Code Here

Examples of org.opengis.filter.FilterFactory.literal()

                    FeatureSource fs = remoteStore.getFeatureSource(TOPP_STATES);
                    remoteStatesAvailable = Boolean.TRUE;
                    // check a basic response can be answered correctly
                    DefaultQuery dq = new DefaultQuery(TOPP_STATES);
                    FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
                    dq.setFilter(ff.greater(ff.property("PERSONS"), ff.literal(20000000)));
                    FeatureCollection fc = fs.getFeatures(dq);
                    if(fc.size() != 1) {
                        logger.log(Level.WARNING, "Remote database status invalid, there should be one and only one " +
                                "feature with more than 20M persons in topp:states");
                        remoteStatesAvailable = Boolean.FALSE;
View Full Code Here

Examples of org.opengis.filter.FilterFactory.literal()

        final FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
        request.setEnv(Collections.singletonMap("myParam", 23));
        DummyRasterMapProducer producer = new DummyRasterMapProducer() {
            @Override
            public void produceMap() throws WmsException {
                assertEquals(23, ff.function("env", ff.literal("myParam")).evaluate(null));
                assertEquals(10, ff.function("env", ff.literal("otherParam"), ff.literal(10)).evaluate(null));
            }
        };
        response = new GetMapResponse(Collections.singleton((GetMapProducer) producer));
        response.execute(request);
View Full Code Here

Examples of org.opengis.filter.FilterFactory.literal()

        request.setEnv(Collections.singletonMap("myParam", 23));
        DummyRasterMapProducer producer = new DummyRasterMapProducer() {
            @Override
            public void produceMap() throws WmsException {
                assertEquals(23, ff.function("env", ff.literal("myParam")).evaluate(null));
                assertEquals(10, ff.function("env", ff.literal("otherParam"), ff.literal(10)).evaluate(null));
            }
        };
        response = new GetMapResponse(Collections.singleton((GetMapProducer) producer));
        response.execute(request);
       
View Full Code Here

Examples of org.opengis.filter.FilterFactory.literal()

        request.setEnv(Collections.singletonMap("myParam", 23));
        DummyRasterMapProducer producer = new DummyRasterMapProducer() {
            @Override
            public void produceMap() throws WmsException {
                assertEquals(23, ff.function("env", ff.literal("myParam")).evaluate(null));
                assertEquals(10, ff.function("env", ff.literal("otherParam"), ff.literal(10)).evaluate(null));
            }
        };
        response = new GetMapResponse(Collections.singleton((GetMapProducer) producer));
        response.execute(request);
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.