Examples of dwithin()


Examples of org.geotools.filter.FilterFactory.dwithin()

                }
               
                // Add range to filter
                AttributeExpression geomAttb = filterFactory.createAttributeExpression(meta.getFeatureType(), meta.getFeatureType().getDefaultGeometry().getName());
                LiteralExpression pointExpr = filterFactory.createLiteralExpression(request.getPoint());
                DWithin dWithin = filterFactory.dwithin(geomAttb, pointExpr, request.getMaxRange(), request.getUnits());
                if (query.getFilter() == null) {
                    query.addFilter((Filter)dWithin);
                   
                } else {
                    And andFilter = filterFactory.and(Arrays.asList(new Filter[] { (Filter)dWithin, query.getFilter() }));
View Full Code Here

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

          try {
              Expression geometry1 =  (Expression) value[0].getValue();
                    Expression geometry2 = (Expression) value[1].getValue();
                    Literal literal = (Literal) value[2];
                    double distance = ((Number)literal.getValue()).doubleValue();
                    return factory.dwithin(geometry1, geometry2, distance, null );
          }
          catch( ClassCastException wrong){
            throw new SAXException( wrong );
          } catch (IllegalFilterException illegalFilterException) {
            throw new SAXException( illegalFilterException );
View Full Code Here

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

    }

    public void testPointDistance() throws IOException, ParseException {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        Geometry point = new WKTReader().read("POINT(180000 0)");
        DWithin filter = ff.dwithin(ff.property(aname("geom")), ff.literal(point), 15000, "m");
       
        ContentFeatureCollection fc = dataStore.getFeatureSource(tname("ppoint")).getFeatures(filter);
        assertEquals(1, fc.size());
    }
}
View Full Code Here

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

        Expression property = this.resultStack.popExpression();
       
        FilterFactory2  ff = (FilterFactory2) filterFactory; // TODO this cast must be removed. It depends of Geometry implementation

        return ff.dwithin(property, geom, tolerance, unit);
    }

    public DistanceBufferOperator buildSpatialBeyondFilter() throws CQLException {
       
        String unit = this.resultStack.popStringValue();
View Full Code Here

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

        init("not-active");
        FilterFactory2 ff = (FilterFactory2) dataStore.getFilterFactory();
        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        Point ls = gf.createPoint(sf.create(new double[] { 1, 1 }, 2));
        DWithin f = ff.dwithin(ff.property("geo"), ff.literal(ls), 3, SI.METRE.getSymbol());
        SimpleFeatureCollection features = featureSource.getFeatures(f);
        assertEquals(2, features.size());
        SimpleFeatureIterator fsi = features.features();
        assertTrue(fsi.hasNext());
        assertEquals(fsi.next().getID(), "not-active.12");
View Full Code Here

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

   
    // threshold distance
    double distance = 10.0d;
   
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
    Filter filter = ff.dwithin(ff.property("POLYGON"), ff.literal(point), distance, uom.toString());
   
    return featureSource.getFeatures(filter);
}

// distance end
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.