Package org.geotools.data.simple

Examples of org.geotools.data.simple.SimpleFeatureCollection.features()


           
            // test the newly ingested granules, which are in a separate coverage
            q.setTypeName("NO2");
            granules = source.getGranules(q);
            assertEquals(2, granules.size());
            it = granules.features();
            f = it.next();
            assertEquals("polyphemus_20130301_NO2.nc", f.getAttribute("location"));
            assertEquals(0, f.getAttribute("imageindex"));
            assertEquals("2013-03-01T00:00:00.000Z", ConvertersHack.convert(f.getAttribute("time"), String.class));
            assertTrue(it.hasNext());
View Full Code Here


            FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
            Query q = new Query(Query.ALL);
            q.setSortBy(new SortBy[] { ff.sort("time", SortOrder.DESCENDING) });
            SimpleFeatureCollection granules = source.getGranules(q);
            assertEquals(1, granules.size());
            it = granules.features();
            assertTrue(it.hasNext());
            SimpleFeature f = it.next();
            assertEquals("20130101.METOPA.GOME2.NO2.DUMMY.nc", f.getAttribute("location"));
            assertEquals(0, f.getAttribute("imageindex"));
            assertEquals("2013-01-01T00:00:00.000Z",
View Full Code Here

            assertEquals(1, reader.getGridCoverageNames().length);

            // check that we have 2 times now
            granules = source.getGranules(q);
            assertEquals(3, granules.size());
            it = granules.features();
            f = it.next();
            assertEquals("20130116.METOPA.GOME2.NO2.DUMMY.nc", f.getAttribute("location"));
            assertEquals(0, f.getAttribute("imageindex"));
            assertEquals("2013-01-16T00:00:00.000Z",
                    ConvertersHack.convert(f.getAttribute("time"), String.class));
View Full Code Here

                schema.getGeometryDescriptor().getUserData().get(Hints.COORDINATE_DIMENSION));
    }

    public void testReadPoint() throws Exception {
        SimpleFeatureCollection fc = dataStore.getFeatureSource(tname(POINT3D)).getFeatures();
        SimpleFeatureIterator fr = fc.features();
        assertTrue(fr.hasNext());
        Point p = (Point) fr.next().getDefaultGeometry();
        assertTrue(new Coordinate(1, 1, 1).equals(p.getCoordinate()));
        fr.close();
    }
View Full Code Here

        fr.close();
    }

    public void testReadLine() throws Exception {
        SimpleFeatureCollection fc = dataStore.getFeatureSource(tname(LINE3D)).getFeatures();
        SimpleFeatureIterator fr = fc.features();
        assertTrue(fr.hasNext());
        LineString ls = (LineString) fr.next().getDefaultGeometry();
        // 1 1 0, 2 2 0, 4 2 1, 5 1 1
        assertEquals(4, ls.getCoordinates().length);
        assertTrue(new Coordinate(1, 1, 0).equals3D(ls.getCoordinateN(0)));
View Full Code Here

        SimpleFeatureType schema = tb.buildFeatureType();
       
        // compute the output features
        SimpleFeatureBuilder fb = new SimpleFeatureBuilder(schema);
        ListFeatureCollection result = new ListFeatureCollection(schema);
        SimpleFeatureIterator fi = fc.features();
        while(fi.hasNext()) {
            SimpleFeature f = fi.next();
            fb.add(((Geometry) f.getDefaultGeometry()).buffer(distance));
            result.add(fb.buildFeature(null));
        }
View Full Code Here

        Function sdo_nn = ff.function("sdo_nn", params.toArray(new Expression[params.size()]));
        PropertyIsEqualTo equalsFilter = ff.equal(sdo_nn, ff.literal(true), false);
        Query query = new Query(tname("NEIGHBORS"), equalsFilter);
       
        SimpleFeatureCollection features = source.getFeatures(query);
        return features.features();
    }

    private Point point(double x, double y) {
        return geomFactory.createPoint(new Coordinate(x, y));
    }
View Full Code Here

                fCollection = fs.getFeatures(q);
                typeName = fCollection.getSchema().getTypeName();
                assertTrue("GenStreams".equals(typeName));
                assertTrue("the_geom".equals(fCollection.getSchema().getGeometryDescriptor()
                        .getLocalName()));
                SimpleFeatureIterator iterator = fCollection.features();
                try {
                    while (iterator.hasNext()) {
                        SimpleFeature f = iterator.next();
                        checkPoints(f, 0.0);
                    }
View Full Code Here

                fCollection = fs.getFeatures(q);
                typeName = fCollection.getSchema().getTypeName();
                assertTrue("GenStreams".equals(typeName));
                assertTrue("the_geom".equals(fCollection.getSchema().getGeometryDescriptor()
                        .getLocalName()));
                iterator = fCollection.features();
                try {
                    while (iterator.hasNext()) {
                        SimpleFeature f = iterator.next();
                        checkPoints(f, 5.0);
                    }
View Full Code Here

                fCollection = fs.getFeatures(q);
                typeName = fCollection.getSchema().getTypeName();
                assertTrue("GenStreams".equals(typeName));
                assertTrue("the_geom".equals(fCollection.getSchema().getGeometryDescriptor()
                        .getLocalName()));
                iterator = fCollection.features();
                try {
                    while (iterator.hasNext()) {
                        SimpleFeature f = iterator.next();
                        checkPoints(f, 10.0);
                    }
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.