Package org.opengis.filter.spatial

Examples of org.opengis.filter.spatial.Crosses


    }

    public void testCrossesParse() throws Exception {
        FilterMockData.crosses(document, document);

        Crosses crosses = (Crosses) parse();

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


    }

    public void testCrossesParse() throws Exception {
        FilterMockData.crosses(document, document);

        Crosses crosses = (Crosses) parse();

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

        assertEquals("WHERE SDO_RELATE(\"SHAPE\", ?, 'mask=contains querytype=WINDOW') = 'TRUE' ",
                encoded);
    }

    public void testCrossesFilter() throws Exception {
        Crosses crosses = ff.crosses(ff.property("GEOM"), ff.literal(gf
                .createLineString(new Coordinate[] { new Coordinate(-10.0d, -10.0d),
                        new Coordinate(10d, 10d) })));
        String encoded = encoder.encodeToString(crosses);
        assertEquals("WHERE SDO_RELATE(\"GEOM\", ?, 'mask=overlapbdydisjoint querytype=WINDOW') = 'TRUE' ", encoded);
    }
View Full Code Here

        init("not-active");
        FilterFactory2 ff = (FilterFactory2) dataStore.getFilterFactory();
        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        LineString ls = gf.createLineString(sf.create(new double[] { 0, 0, 2, 2 }, 2));
        Crosses f = ff.crosses(ff.property("geo"), ff.literal(ls));
        SimpleFeatureCollection features = featureSource.getFeatures(f);
        assertEquals(1, features.size());
        SimpleFeatureIterator fsi = features.features();
        assertTrue(fsi.hasNext());
        assertEquals(fsi.next().getID(), "not-active.12");
View Full Code Here

        init("not-active");
        FilterFactory2 ff = (FilterFactory2) dataStore.getFilterFactory();
        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        LineString ls = gf.createLineString(sf.create(new double[] { 0, 0, 1, 1 }, 2));
        Crosses f = ff.crosses(ff.property("geo"), ff.literal(ls));
        SimpleFeatureCollection features = featureSource.getFeatures(f);
        assertEquals(0, features.size());
    }
View Full Code Here

    }

    public void testCrosses() throws Exception {
        Filter test = parseDocument("crosses.xml");
        assertTrue(test instanceof Crosses);
        Crosses cr = (Crosses) test;
        assertEquals("the_geom", ((PropertyName) cr.getExpression1()).getPropertyName());
        assertTrue(((Literal) cr.getExpression2()).getValue() instanceof LineString);
        LOGGER.fine("parsed filter is " + test);
    }
View Full Code Here

        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        // should match only "r2"
        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        LineString ls = gf.createLineString(sf.create(new double[] { 2, 3, 4, 3 }, 2));
        Crosses cs = ff.crosses(ff.property(aname("geom")), ff.literal(ls));
        FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(cs);
        checkSingleResult(features, "r2");
    }
View Full Code Here

TOP

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

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.