Package org.geotools.data.simple

Examples of org.geotools.data.simple.SimpleFeatureIterator


        String typeName = tmpFile.getName().substring(0, tmpFile.getName().lastIndexOf(".csv"));
        SimpleFeatureCollection fc = s.getFeatureSource(typeName).getFeatures();
        assertEquals(features.size(), fc.size());
        // Read
        int c = 0;
        SimpleFeatureIterator it = fc.features();
        try {
            while (it.hasNext()) {
                SimpleFeature f = it.next();
                assertNotNull(f);
                assertNotNull(f.getDefaultGeometry());
                c++;
            }
        } finally {
            it.close();
        }
        assertEquals(fc.size(), c);
    }
View Full Code Here


        String typeName = tmpFile.getName().substring(0, tmpFile.getName().lastIndexOf(".gmt"));
        SimpleFeatureCollection fc = s.getFeatureSource(typeName).getFeatures();
        assertEquals(features.size(), fc.size());
        // Read
        int c = 0;
        SimpleFeatureIterator it = fc.features();
        try {
            while (it.hasNext()) {
                SimpleFeature f = it.next();
                assertNotNull(f);
                assertNotNull(f.getDefaultGeometry());
                c++;
            }
        } finally {
            it.close();
        }
        assertEquals(fc.size(), c);
    }
View Full Code Here

        assertEquals(5, s.getTypeNames().length);
        SimpleFeatureCollection fc = s.getFeatureSource("waypoints").getFeatures();
        assertEquals(features.size(), fc.size());
        // Read
        int c = 0;
        SimpleFeatureIterator it = fc.features();
        try {
            while (it.hasNext()) {
                SimpleFeature f = it.next();
                assertNotNull(f);
                assertNotNull(f.getDefaultGeometry());
                c++;
            }
        } finally {
            it.close();
        }
        assertEquals(fc.size(), c);
    }
View Full Code Here

        assertEquals(1, s.getTypeNames().length);
        SimpleFeatureCollection fc = s.getFeatureSource("junk").getFeatures();
        assertEquals(features.size(), fc.size());
        // Read
        int c = 0;
        SimpleFeatureIterator it = fc.features();
        try {
            while (it.hasNext()) {
                SimpleFeature f = it.next();
                assertNotNull(f);
                assertNotNull(f.getDefaultGeometry());
                c++;
            }
        } finally {
            it.close();
        }
        assertEquals(fc.size(), c);
    }
View Full Code Here

        assertEquals(1, s.getTypeNames().length);
        SimpleFeatureCollection fc = s.getFeatureSource("junk").getFeatures();
        assertEquals(features.size(), fc.size());
        // Read
        int c = 0;
        SimpleFeatureIterator it = fc.features();
        try {
            while (it.hasNext()) {
                SimpleFeature f = it.next();
                assertNotNull(f);
                assertNotNull(f.getDefaultGeometry());
                c++;
            }
        } finally {
            it.close();
        }
        assertEquals(fc.size(), c);
    }
View Full Code Here

        assertEquals(1, s.getTypeNames().length);
        SimpleFeatureCollection fc = s.getFeatureSource("georss").getFeatures();
        assertEquals(features.size(), fc.size());
        // Read
        int c = 0;
        SimpleFeatureIterator it = fc.features();
        try {
            while (it.hasNext()) {
                SimpleFeature f = it.next();
                assertNotNull(f);
                assertNotNull(f.getDefaultGeometry());
                c++;
            }
        } finally {
            it.close();
        }
        assertEquals(fc.size(), c);
    }
View Full Code Here

        assertEquals(1, s.getTypeNames().length);
        SimpleFeatureCollection fc = s.getFeatureSource("junk").getFeatures();
        assertEquals(features.size(), fc.size());
        // Read
        int c = 0;
        SimpleFeatureIterator it = fc.features();
        try {
            while (it.hasNext()) {
                SimpleFeature f = it.next();
                assertNotNull(f);
                assertNotNull(f.getDefaultGeometry());
                c++;
            }
        } finally {
            it.close();
        }
        assertEquals(fc.size(), c);
    }
View Full Code Here

        });
        SimpleFeatureCollection fc = s.getFeatureSource("junk").getFeatures(query);
        assertEquals(features.size(), fc.size());
        // Read
        int c = 0;
        SimpleFeatureIterator it = fc.features();
        try {
            while (it.hasNext()) {
                SimpleFeature f = it.next();
                assertNotNull(f);
                assertNotNull(f.getDefaultGeometry());
                c++;
            }
        } finally {
            it.close();
        }
        assertEquals(fc.size(), c);
    }
View Full Code Here

        assertEquals(1, s.getTypeNames().length);
        SimpleFeatureCollection fc = s.getFeatureSource("points").getFeatures();
        assertEquals(features.size(), fc.size());
        // Read
        int c = 0;
        SimpleFeatureIterator it = fc.features();
        try {
            while(it.hasNext()) {
                SimpleFeature f = it.next();
                assertNotNull(f);
                assertNotNull(f.getDefaultGeometry());
                assertNotNull(f.getAttribute("name"));
                c++;
            }
        } finally {
            it.close();
        }
        assertEquals(fc.size(), c);
    }
View Full Code Here

    // SUPPORT METHODS
    // ---------------------------------------------------------------------------------------

    private int countFeatures(SimpleFeatureCollection features) {
        int count = 0;
        SimpleFeatureIterator fi = features.features();
        while(fi.hasNext()) {
            fi.next();
            count++;
        }
        return count;
    }
View Full Code Here

TOP

Related Classes of org.geotools.data.simple.SimpleFeatureIterator

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.