Package org.opengis.filter.spatial

Examples of org.opengis.filter.spatial.Disjoint


                        Geometry geometry = (Geometry) literal;
                        Envelope env = geometry.getEnvelopeInternal();
                        return factory.bbox(geometry1, env.getMinX(), env.getMinY(), env.getMaxX(), env.getMaxY(), null );
                    }
                }
                Disjoint disjoint = factory.disjoint(geometry1, geometry2);
                return factory.not( disjoint );
               
            } catch (ClassCastException wrong) {
                throw new SAXException("ogc:propertyName or gml:box required for bbox filter",
                        wrong);
View Full Code Here


        assertNotNull(q);
       
        Not f = (Not) q.getFilter();
        assertNotNull(f);
       
        Disjoint d = (Disjoint) f.getFilter();
        assertNotNull(d);
       
        assertEquals(2, q.getSortBy().size());
    }
View Full Code Here

    }

    public void testDisjointParse() throws Exception {
        FilterMockData.disjoint(document, document);

        Disjoint disjoint = (Disjoint) parse();

        assertNotNull(disjoint.getExpression1());
        assertNotNull(disjoint.getExpression2());
    }
View Full Code Here

    }

    public void testDisjointParse() throws Exception {
        FilterMockData.disjoint(document, document);

        Disjoint disjoint = (Disjoint) parse();

        assertNotNull(disjoint.getExpression1());
        assertNotNull(disjoint.getExpression2());
    }
View Full Code Here

        assertTrue( filter instanceof Not );

        Filter spatialFilter = ((Not) filter).getFilter();
        assertTrue( spatialFilter instanceof Disjoint );

        Disjoint disjoint = (Disjoint) spatialFilter;
        Expression left = disjoint.getExpression1();
        Expression right = disjoint.getExpression2();
               
        assertTrue( left instanceof PropertyName );
       
        assertTrue( right instanceof Literal );
        assertTrue( right.evaluate(null) instanceof Geometry );
View Full Code Here

        init("not-active");
        FilterFactory2 ff = (FilterFactory2) dataStore.getFilterFactory();
        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        Point ls = gf.createPoint(sf.create(new double[] { 0, 0 }, 2));
        Disjoint f = ff.disjoint(ff.property("geo"), ff.literal(ls));
        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

       
        // Test Disjoint
        AttributeExpressionImpl expr1 = new AttributeExpressionImpl(testSchema, "testGeometry");
        LineString geom = gf.createLineString(coords);
        LiteralExpressionImpl expr2 = new LiteralExpressionImpl(geom);
        Disjoint disjoint = fac.disjoint(expr1, expr2);

        LOGGER.finer( disjoint.toString());           
        LOGGER.finer( "contains feature: " + disjoint.evaluate(testFeature));
        assertTrue(disjoint.evaluate(testFeature));

        Function function = new GeometryFunction(geom);
        disjoint = fac.disjoint(expr1, function);
        LOGGER.finer( disjoint.toString());           
        LOGGER.finer( "contains feature: " + disjoint.evaluate(testFeature));
        assertTrue(disjoint.evaluate(testFeature));
       
        disjoint = fac.disjoint(expr2, expr1);

        LOGGER.finer( disjoint.toString());           
        LOGGER.finer( "contains feature: " + disjoint.evaluate(testFeature));
        assertTrue(disjoint.evaluate(testFeature));

        coords[0] = new Coordinate(1, 2);
        coords[1] = new Coordinate(3, 0);
        coords[2] = new Coordinate(6, 0);
        geom = gf.createLineString(coords);
        expr2 = new LiteralExpressionImpl(geom);
        disjoint = fac.disjoint(expr1, expr2);

        LOGGER.finer( disjoint.toString());           
        LOGGER.finer( "contains feature: " + disjoint.evaluate(testFeature));
        assertTrue(!disjoint.evaluate(testFeature));

        expr2 = new LiteralExpressionImpl(null);
        disjoint = fac.disjoint(expr1, expr2);

        LOGGER.finer( disjoint.toString());           
        LOGGER.finer( "contains feature: " + disjoint.evaluate(testFeature));
        assertTrue(!disjoint.evaluate(testFeature));

  }
View Full Code Here

      assertTrue(!nullFilter1.equals(new BetweenFilterImpl()));
  }

     public void testGeometryFilter()
  throws IllegalFilterException {
  Disjoint geomFilter1 = ff.disjoint(testExp1, testExp4);
  Disjoint geomFilter2 = ff.disjoint(testExp2, testExp4);
  assertTrue(geomFilter1.equals(geomFilter2));
  geomFilter2 = ff.disjoint(testExp2, new LiteralExpressionImpl(new Double(45)));
  assertTrue(!geomFilter1.equals(geomFilter2));
  tFilter1 = ff.between(ff.literal(1), ff.literal(-1), ff.literal(3));
  assertTrue(!geomFilter1.equals(tFilter1));
View Full Code Here

 
  private Filter filterBBox(ReferencedEnvelope bBox, SimpleFeatureType ft)
    throws FactoryRegistryException, IllegalFilterException
  {
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
    Disjoint filter = ff.disjoint(ff.property(ft.getGeometryDescriptor().getLocalName()),
            ff.literal(JTS.toGeometry((BoundingBox) bBox)));
    return filter;
  }
View Full Code Here

        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        LinearRing shell = gf.createLinearRing(sf.create(new double[] { 4, -1, 4, 5, 6, 5, 6, -1,
                4, -1 }, 2));
        Polygon polygon = gf.createPolygon(shell, null);
        Disjoint dj = ff.disjoint(ff.property(aname("geom")), ff.literal(polygon));
        FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(dj);
        checkSingleResult(features, "r2");
    }
View Full Code Here

TOP

Related Classes of org.opengis.filter.spatial.Disjoint

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.