Java Code Examples for mil.nga.geopackage.GeoPackage#getTables()

The following examples show how to use mil.nga.geopackage.GeoPackage#getTables() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GeoPackageTestUtils.java    From geopackage-android with MIT License 4 votes vote down vote up
/**
 * Test the GeoPackage vacuum
 *
 * @param activity   activity
 * @param geoPackage GeoPackage
 */
public static void testVacuum(Activity activity, GeoPackage geoPackage) {

    GeoPackageManager manager = GeoPackageFactory.getManager(activity);
    long size = manager.size(geoPackage.getName());

    for (String table : geoPackage.getTables()) {

        geoPackage.deleteTable(table);

        geoPackage.vacuum();

        long newSize = manager.size(geoPackage.getName());
        TestCase.assertTrue(size > newSize);
        size = newSize;

    }

}
 
Example 2
Source File: GeoPackageTestUtils.java    From geopackage-java with MIT License 4 votes vote down vote up
/**
 * Test the GeoPackage vacuum
 * 
 * @param geoPackage
 *            GeoPackage
 */
public static void testVacuum(GeoPackage geoPackage) {

	String path = geoPackage.getPath();
	File file = new File(path);
	long size = file.length();

	for (String table : geoPackage.getTables()) {

		geoPackage.deleteTable(table);

		TestCase.assertEquals(size, file.length());

		geoPackage.vacuum();

		long newSize = file.length();
		TestCase.assertTrue(size > newSize);
		size = newSize;

	}

}