Package org.opengis.filter

Examples of org.opengis.filter.FilterFactory


        SimpleFeature feature = editFeature.get(monitor);
        feature.setAttribute(xpath, oldValue);
        ILayer layer = editLayer.get(monitor);
        FeatureStore<SimpleFeatureType, SimpleFeature> resource = layer.getResource(FeatureStore.class, null);
        AttributeDescriptor attributeType = layer.getSchema().getDescriptor(xpath);
        FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
    Id id = filterFactory.id(
                FeatureUtils.stringToId(filterFactory, feature.getID()));
        resource.modifyFeatures(attributeType, oldValue, id);
    }
View Full Code Here


            noChange=true;
            return;
        }
           
        SimpleFeatureType featureType = editFeature.getFeatureType();
        FilterFactory factory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        subProgressMonitor = new SubProgressMonitor(monitor,1);
        subProgressMonitor.done();
        filter = factory.id(FeatureUtils.stringToId(factory, editFeature.getID()));
        FeatureCollection<SimpleFeatureType, SimpleFeature>  results = store.getFeatures(filter);

        FeatureIterator<SimpleFeature> reader = results.features();
        try {
            if (reader.hasNext()) {
View Full Code Here

        monitor.worked(1);
        feature = featureProvider.get(new SubProgressMonitor(monitor, 1));
        if( feature==null )
            return false;
        oldLayer = layerProvider.get(new SubProgressMonitor(monitor, 1));
        FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
    oldLayer.getResource(FeatureStore.class, null).removeFeatures(
                filterFactory.id(FeatureUtils.stringToId(filterFactory, feature.getID())));
        map.getEditManagerInternal().setEditFeature(null, null);
        return true;
    }
View Full Code Here

            MultiLineString.class.isAssignableFrom(type) )
          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

            }
        });
    }

    private Filter createFidFiler( String id ) {
        FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(GeoTools
                .getDefaultHints());
        Filter filterId = filterFactory.id(FeatureUtils.stringToId(filterFactory, id));
        return filterId;
    }
View Full Code Here

                if (oldFilter == null || oldFilter == Filter.EXCLUDE
                        || oldFilter.equals(Filter.EXCLUDE)) {
                    layer.setFilter(target(layer, filter));
                } else {

                    FilterFactory createFilterFactory = CommonFactoryFinder
                            .getFilterFactory(GeoTools.getDefaultHints());

                    if (!and) {
                        Filter logicFilter;
                        logicFilter = createFilterFactory.and(oldFilter, target(layer, filter));
                        layer.setFilter(logicFilter);
                    } else {
                        Filter logicFilter;
                        logicFilter = createFilterFactory.or(oldFilter, target(layer, filter));
                        layer.setFilter(logicFilter);
                    }
                }
            } else {
                layer.setFilter(Filter.EXCLUDE);
View Full Code Here

                new Coordinate(0,55),
                new Coordinate(0,50),
        });
        Polygon polygon = fac.createPolygon(ring, new LinearRing[0]);
        FeatureStore<SimpleFeatureType, SimpleFeature> store = map.getMapLayers().get(0).getResource(FeatureStore.class, new NullProgressMonitor());       
        FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
    store.modifyFeatures(features[0].getFeatureType().getGeometryDescriptor(), polygon,
                filterFactory.id(FeatureUtils.stringToId(filterFactory, features[0].getID())));
   
        EditBlackboard bb = handler.getEditBlackboard();
       
        PrimitiveShape shell = bb.newGeom(null, null).getShell();
        handler.setCurrentShape(shell);
View Full Code Here

        Polygon polygon2 = fac.createPolygon(ring2, new LinearRing[0]);

        Geometry geom=fac.createMultiPolygon(new Polygon[]{polygon1, polygon2});
       
        FeatureStore<SimpleFeatureType, SimpleFeature> store = map.getMapLayers().get(0).getResource(FeatureStore.class, new NullProgressMonitor());
        FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
    store.removeFeatures(filterFactory.id(FeatureUtils.stringToId(filterFactory, features[1].getID())));
        store.modifyFeatures(features[0].getFeatureType().getGeometryDescriptor(), geom,
                filterFactory.id(FeatureUtils.stringToId(filterFactory, features[0].getID())));
        EditBlackboard bb = handler.getEditBlackboard();
       
        PrimitiveShape shell = bb.newGeom(null, null).getShell();
        handler.setCurrentShape(shell);
        bb.addPoint(25,0, shell);
View Full Code Here

              destination.addFeatureListener(listener);
                List<FeatureId> fids = destination.addFeatures(c);

                performedZoom = displayCopiedFeatures(env);

                FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(GeoTools
                        .getDefaultHints());
                addedFeaturesFilter = filterFactory.id(new HashSet(fids));
            } finally {
                targetLayer.eSetDeliver(true);
                destination.removeFeatureListener(listener);
            }
            if(performedZoom) {
View Full Code Here

        CreateNewOrSelectExitingFeatureCommand command=new CreateNewOrSelectExitingFeatureCommand("newID", layer, fac.createPoint(new Coordinate(10,10))); //$NON-NLS-1$
        command.setMap(map);
        NullProgressMonitor nullProgressMonitor = new NullProgressMonitor();
        command.run(nullProgressMonitor);
       
        FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        Filter filter = filterFactory.id(FeatureUtils.stringToId(filterFactory, original.getID()));
        filter = filterFactory.not(filter);
    SimpleFeature feature=resource.getFeatures(
        filter).features().next();
        assertEquals(2, getCount());
        assertEquals(new Coordinate(10,10), ((Geometry) feature.getDefaultGeometry()).getCoordinates()[0]);
        assertFalse( feature.getID().equals(original));
        command.rollback(nullProgressMonitor);
       
        assertEquals(1, getCount());
        feature=resource.getFeatures(filterFactory.id(FeatureUtils.stringToId(filterFactory,original.getID()))).features().next();
        assertEquals(original.getID(), feature.getID());
        assertFalse( new Coordinate(10,10).equals(((Geometry) feature.getDefaultGeometry()).getCoordinates()[0] ));
       
    }
View Full Code Here

TOP

Related Classes of org.opengis.filter.FilterFactory

Copyright © 2018 www.massapicom. 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.