Package com.vividsolutions.jts.geom.impl

Examples of com.vividsolutions.jts.geom.impl.PackedCoordinateSequenceFactory.create()


    public void testTouchesFilter() throws Exception {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        // should match only "r1"
        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        LineString ls = gf.createLineString(sf.create(new double[] { 1, 1, 1, 3 }, 2));
        Touches is = ff.touches(ff.property(aname("geom")), ff.literal(ls));
        FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(is);
        checkSingleResult(features, "r1");
    }
View Full Code Here


    public void testContainsFilter() throws Exception {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        // should match only "r2"
        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        LinearRing shell = gf.createLinearRing(sf.create(new double[] { 2, -1, 2, 5, 4, 5, 4, -1,
                2, -1 }, 2));
        Polygon polygon = gf.createPolygon(shell, null);
        Contains cs = ff.contains(ff.literal(polygon), ff.property(aname("geom")));
        FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(cs);
        checkSingleResult(features, "r2");
View Full Code Here

    public void testWithinFilter() throws Exception {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        // should match only "r2"
        GeometryFactory gf = new GeometryFactory();
        PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
        LinearRing shell = gf.createLinearRing(sf.create(new double[] { 2, -1, 2, 5, 4, 5, 4, -1,
                2, -1 }, 2));
        Polygon polygon = gf.createPolygon(shell, null);
        Within wt = ff.within(ff.property(aname("geom")), ff.literal(polygon));
        FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(wt);
        checkSingleResult(features, "r2");
View Full Code Here

    public void testDisjointFilter() throws Exception {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        // should match only "r2"
        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
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.