Package org.geotools.data

Examples of org.geotools.data.DataStore.dispose()


        SimpleFeatureSource featureSource;
        featureSource = dataStore.getFeatureSource(postgisTypeName);
        try {
            testRender(featureSource);
        } finally {
            dataStore.dispose();
        }
    }

    @Test
    public void testRenderShapefile() throws Exception {
View Full Code Here


        SimpleFeatureSource featureSource;
        featureSource = dataStore.getFeatureSource(shapefileTypeName);
        try {
            testRender(featureSource);
        } finally {
            dataStore.dispose();
        }
    }

    @Test
    public void testRenderArcSDE() throws Exception {
View Full Code Here

        SimpleFeatureSource featureSource;
        featureSource = dataStore.getFeatureSource(typeName);
        try {
            testFeatureSource(featureSource);
        } finally {
            dataStore.dispose();
        }
    }

    @Test
    public void testFeatureSourcePostGIS() throws IOException {
View Full Code Here

        featureSource = dataStore.getFeatureSource(postgisTypeName);

        try {
            testFeatureSource(featureSource);
        } finally {
            dataStore.dispose();
        }
    }

    @Test
    public void testFeatureSourceShapefile() throws IOException {
View Full Code Here

        featureSource = dataStore.getFeatureSource(shapefileTypeName);

        try {
            testFeatureSource(featureSource);
        } finally {
            dataStore.dispose();
        }
    }

    private DataStore getPostGISDataStore() throws IOException {
        Map<String, Serializable> params = new HashMap<String, Serializable>();
View Full Code Here

            }
            double avg = runTime / numRuns;
            log("--- Avg iteration time with FeatureSource for " + numRuns + " runs: "
                    + (avg / 1000D) + "s");
        } finally {
            ds.dispose();
        }
        log("-----------------------------------------------------");
    }

    @Test
View Full Code Here

            }

        } finally {
            if (ds != null) {
                ds.dispose();
            }

            if (it != null) {
                it.close();
            }
View Full Code Here

    @Override
    public String getTypeName(URL url) throws IOException {
        DataStore ds = createDataStore(url);
        String[] names = ds.getTypeNames(); // should be exactly one
        ds.dispose();
        return ((names == null || names.length == 0) ? null : names[0]);
    }

}
View Full Code Here

        ShapefileDataStoreFactory maker = new ShapefileDataStoreFactory();

        doubleWrite(type, one, getTempFile(), maker, false);
        doubleWrite(type, one, getTempFile(), maker, true);
        s1.dispose();
    }

    private DataStore createDataStore(ShapefileDataStoreFactory fac, URL url, boolean memoryMapped)
            throws IOException {
        Map params = new HashMap();
View Full Code Here

        store.addFeatures(one);
        assertEquals(one.size(), store.getCount(Query.ALL));
        store.addFeatures(one);

        assertEquals(one.size() * 2, store.getCount(Query.ALL));
        s.dispose();
    }

    void test(String f) throws Exception {
        File file = copyShapefiles(f); // Work on File rather than URL from
        // JAR.
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.