Package org.opengis.filter

Examples of org.opengis.filter.Filter


    log.debug("Get features, was {}", features);
    if (null == features) {
      features = new ArrayList<InternalFeature>();
      response.setFeatures(features);
      VectorLayer layer = context.get(PipelineCode.LAYER_KEY, VectorLayer.class);
      Filter filter = context.get(PipelineCode.FILTER_KEY, Filter.class);
      int offset = context.get(PipelineCode.OFFSET_KEY, Integer.class);
      int maxResultSize = context.get(PipelineCode.MAX_RESULT_SIZE_KEY, Integer.class);
      int featureIncludes = context.get(PipelineCode.FEATURE_INCLUDES_KEY, Integer.class);
      NamedStyleInfo style = context.get(PipelineCode.STYLE_KEY, NamedStyleInfo.class);
      CrsTransform transformation = context.getOptional(PipelineCode.CRS_TRANSFORM_KEY, CrsTransform.class);
View Full Code Here


    Authentication auth2 = getFilterAuthentication();
    auth2.setSecurityServiceId("ss2");
    authentications.add(auth1);
    authentications.add(auth2);
    securityContext.setAuthentications("token", authentications);
    Filter filter = securityContext.getFeatureFilter(LAYER_ID);
    Assert.assertNotNull(filter);
    // these tests are (geotools) implementation dependent
    Assert.assertEquals("org.geotools.filter.LikeFilterImpl", filter.getClass().getName());
    Assert.assertEquals("[ name is like bla% ]", filter.toString());
  }
View Full Code Here

    Authentication auth2 = getFilterAuthentication();
    auth2.setSecurityServiceId("ss2");
    authentications.add(auth1);
    authentications.add(auth2);
    securityContext.setAuthentications("token", authentications);
    Filter filter = securityContext.getFeatureFilter(LAYER_ID);
    Assert.assertNotNull(filter);
    // these tests are (geotools) implementation dependent
    Assert.assertEquals("org.geotools.filter.AndImpl", filter.getClass().getName());
    Assert.assertEquals("[[ name is like bla% ] AND [ name is like bla% ]]", filter.toString());
  }
View Full Code Here

  }

  @Test
  @DirtiesContext
  public void testSaveOrUpdateAttributeWritable() throws Exception {
    Filter filter;
    List<InternalFeature> oldFeatures;
    List<InternalFeature> newFeatures;
    InternalFeature feature;
    CoordinateReferenceSystem crs = beanLayer.getCrs();
View Full Code Here

  }

  @Test
  @DirtiesContext
  public void testSaveOrUpdateFeatureWritable() throws Exception {
    Filter filter;
    List<InternalFeature> oldFeatures;
    List<InternalFeature> newFeatures;
    InternalFeature feature;
    CoordinateReferenceSystem crs = beanLayer.getCrs();
View Full Code Here

  }

  @Test
  @DirtiesContext
  public void testSaveOrUpdateDeleteFeature() throws Exception {
    Filter filter;
    List<InternalFeature> oldFeatures;
    List<InternalFeature> newFeatures;
    CoordinateReferenceSystem crs = beanLayer.getCrs();

    login("marino");
View Full Code Here

  }

  @Test
  @DirtiesContext
  public void testSaveOrUpdateCreateFeature() throws Exception {
    Filter filter;
    List<InternalFeature> oldFeatures;
    List<InternalFeature> newFeatures;
    InternalFeature feature;
    CoordinateReferenceSystem crs = beanLayer.getCrs();
    GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel());
View Full Code Here

    if (vectorLayerRasterizingInfo.isPaintGeometries()) {
      // apply the normal styles
      List<Rule> rules = new ArrayList<Rule>();
      for (FeatureStyleInfo featureStyle : vectorLayerRasterizingInfo.getStyle().getFeatureStyles()) {
        // create the filter
        Filter styleFilter;
        if (featureStyle.getFormula() != null && featureStyle.getFormula().length() > 0) {
          styleFilter = filterService.parseFilter(featureStyle.getFormula());
        } else {
          styleFilter = Filter.INCLUDE;
        }
        // create the rules
        rules.addAll(createRules(layerType, styleFilter, featureInfo, featureStyle));
      }
      // create the style
      FeatureTypeStyle normalStyle = styleBuilder.createFeatureTypeStyle(typeName,
          rules.toArray(new Rule[rules.size()]));
      style.featureTypeStyles().add(normalStyle);
      // apply the selection style
      rules.clear();
      if (vectorLayerRasterizingInfo.getSelectedFeatureIds() != null) {
        // create the filter
        Filter fidFilter = filterService.createFidFilter(vectorLayerRasterizingInfo.getSelectedFeatureIds());
        // create the rules
        rules.addAll(createRules(layerType, fidFilter, featureInfo,
            vectorLayerRasterizingInfo.getSelectionStyle()));
      }
      // create the style
View Full Code Here

    List<Rule> rules = new ArrayList<Rule>();
    // for mixed geometries we add a filter to distinguish between geometry types
    if (layerType == LayerType.GEOMETRY) {
      // add the configured filter to a filter that selects point features only
      Rule pointRule = styleBuilder.createRule(createGeometrySymbolizer(LayerType.POINT, featureStyle));
      Filter pointFilter = filterService.createGeometryTypeFilter(geomName, "Point");
      Filter multiPointFilter = filterService.createGeometryTypeFilter(geomName, "MultiPoint");
      Filter pointsFilter = filterService.createLogicFilter(pointFilter, "or", multiPointFilter);
      pointRule.setFilter(filterService.createLogicFilter(pointsFilter, "and", filter));
      pointRule.setTitle(featureStyle.getName() + "(Point)");

      // add the configured filter to a filter that selects line features only
      Rule lineRule = styleBuilder.createRule(createGeometrySymbolizer(LayerType.LINESTRING, featureStyle));
      Filter lineFilter = filterService.createGeometryTypeFilter(geomName, "LineString");
      Filter multiLineFilter = filterService.createGeometryTypeFilter(geomName, "MultiLineString");
      Filter linesFilter = filterService.createLogicFilter(lineFilter, "or", multiLineFilter);
      lineRule.setFilter(filterService.createLogicFilter(linesFilter, "and", filter));
      lineRule.setTitle(featureStyle.getName() + "(Line)");

      // add the configured filter to a filter that selects polygon features only
      Rule polygonRule = styleBuilder.createRule(createGeometrySymbolizer(LayerType.POLYGON, featureStyle));
      Filter polygonFilter = filterService.createGeometryTypeFilter(geomName, "Polygon");
      Filter multiPolygonFilter = filterService.createGeometryTypeFilter(geomName, "MultiPolygon");
      Filter polygonsFilter = filterService.createLogicFilter(polygonFilter, "or", multiPolygonFilter);
      polygonRule.setFilter(filterService.createLogicFilter(polygonsFilter, "and", filter));
      polygonRule.setTitle(featureStyle.getName() + "(Polygon)");
      rules.add(pointRule);
      rules.add(lineRule);
      rules.add(polygonRule);
View Full Code Here

  public void update(Object feature) throws LayerException {
    FeatureSource<SimpleFeatureType, SimpleFeature> source = getFeatureSource();
    if (source instanceof FeatureStore<?, ?>) {
      SimpleFeatureStore store = (SimpleFeatureStore) source;
      String featureId = getFeatureModel().getId(feature);
      Filter filter = filterService.createFidFilter(new String[] {featureId});
      if (transactionManager != null) {
        store.setTransaction(transactionManager.getTransaction());
      }
      List<Name> names = new ArrayList<Name>();
      Map<String, Attribute> attrMap = getFeatureModel().getAttributes(feature);
View Full Code Here

TOP

Related Classes of org.opengis.filter.Filter

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.