Package org.opengis.filter

Examples of org.opengis.filter.FilterFactory2.property()


  }

  @Test
  public void nullFilter() throws Exception {
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
    Filter filter = ff.isNull(ff.property(PARAM_DATE_ATTR));
    Iterator<?> it = layer.getElements(filter, 0, 0);

    int t = 0;
    while (it.hasNext()) {
      Assert.assertTrue("Returned object must be a SimpleFeature", it.next() instanceof SimpleFeature);
View Full Code Here


  }

  @Test
  public void nullFilter() throws Exception {
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
    Filter filter = ff.isNull(ff.property(PARAM_DATE_ATTR));
    Iterator<?> it = layer.getElements(filter, 0, 0);

    int t = 0;
    while (it.hasNext()) {
      Assert.assertTrue("Returned object must be a HibernateTestFeature",
View Full Code Here

        }
       
        FilterFactory2 ff = (FilterFactory2) CommonFactoryFinder.getFilterFactory(null);
       
        String geomProperty = layer.getSchema().getGeometryDescriptor().getLocalName();
        Filter aoiFilter = ff.intersects(ff.property(geomProperty), ff.literal(geometry));
       
        return ff.and(aoiFilter, filter );
    }

    protected void reloadFeatures( final ILayer notifierLayer ) {
View Full Code Here

            bbox = bbox.transform(crs, true);
        }
        FilterFactory2 factory = (FilterFactory2) CommonFactoryFinder.getFilterFactory(GeoTools
                .getDefaultHints());
        Geometry geom = new GeometryFactory().toGeometry(bbox);
        Intersects filter = factory.intersects(factory.property(type.getGeometryDescriptor()
                .getName()), factory.literal(geom));

        layer.getQuery(false);
        final FeatureCollection<SimpleFeatureType, SimpleFeature> results = source
                .getFeatures(filter);
View Full Code Here

      final Geometry splitLineGeom = reprojectSplitLine(splittingLine, layerCrs);

      SimpleFeatureType schema = selectedLayer.getSchema();
      String geomName = schema.getGeometryDescriptor().getLocalName();

      intersectsFilter = ff.intersects(ff.property(geomName), ff.literal(splitLineGeom));

      if (Filter.EXCLUDE.equals(filter)) {
              filter = intersectsFilter;
          } else {
              filter = ff.and(filter, intersectsFilter);
View Full Code Here

                    if (!CRS.equalsIgnoreMetadata(crs,dataCRS)) {
                        MathTransform transform = CRS.findMathTransform(crs, dataCRS);
                        geometry = JTS.transform(geometry, transform);
                    }
                    String the_geom = schema.getGeometryDescriptor().getName().getLocalPart();
                    Filter spatialFilter = ff.intersects( ff.property(the_geom), ff.literal( geometry ) );
                    if( filter != null ){
                        return ff.and( filter, spatialFilter );
                    }
                    else {
                        return spatialFilter;
View Full Code Here

            } catch (Exception e) {
                bbox = boundingBox;
            }
            String geom = getSchema().getGeometryDescriptor().getName().getLocalPart();
            Object bboxGeom = new GeometryFactory().toGeometry(bbox);
            bboxFilter = factory.intersects(factory.property(geom), factory.literal(bboxGeom));

        } catch (Exception e) {
            ProjectPlugin.getPlugin().log(e);
        }
        return bboxFilter;
View Full Code Here

                        continue;
                    }
                    String targetGeomName = targetType.getGeometryDescriptor().getLocalName();
   
                    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2( GeoTools.getDefaultHints() );
                    Filter cut= ff.not( ff.within( ff.property( targetGeomName ), ff.literal(hole) ) );
                   
                    //put it on style blackboard
                    //Key:  ProjectBlackboardConstants    String LAYER__DATA_QUERY = "org.locationtech.udig.project.view"; //$NON-NLS-1$
                    IStyleBlackboard styleBlackboard = layer.getStyleBlackboard();
                    styleBlackboard.put(ProjectBlackboardConstants.LAYER__DATA_QUERY, cut);
View Full Code Here

        if( !bbox.getCoordinateReferenceSystem().equals( crs )) {
            bbox = bbox.transform(crs, true);
        }
        FilterFactory2 factory = (FilterFactory2) CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        Geometry geom = new GeometryFactory().toGeometry(bbox);
        Intersects filter = factory.intersects(factory.property(type.getGeometryDescriptor().getName()), factory.literal(geom));
       
        layer.getQuery(false);
        final FeatureCollection<SimpleFeatureType, SimpleFeature>  results = source.getFeatures( filter );
//        if( results.getCount() == 0 ) {
//            return null; // no content!
View Full Code Here

        try {

            SimpleFeatureType schema = layer.getSchema();
            Name geom = getGeometryAttDescriptor(schema).getName();

            Filter bboxFilter = factory.bbox(factory.property(geom), boundingBox);

            return bboxFilter;
        } catch (Exception e) {
            ProjectPlugin.getPlugin().log(e);
            return Filter.EXCLUDE;
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.