When working with Geopackage featuretables, I am noticing that the file sizes are not updating after I remove features. The changes are being updated, but the size of the file remains the same.
Example (Removes everything for testing)
try
{
// Define query to select all features
QueryParameters queryParams = new QueryParameters
{
WhereClause = "1=1" // Select all features
};
// Query all features in the table
FeatureQueryResult features = featureTable.QueryFeaturesAsync(queryParams).Result;
// Collect all ObjectIds to delete features in bulk
List<Feature> objectIds = new List<Feature>();
foreach (Feature feature in features)
{
objectIds.Add(feature);
}
// Delete features in bulk
featureTable.DeleteFeaturesAsync(objectIds).Wait();
}
catch (Exception ex)
{
Console.WriteLine($"Error clearing features: {ex.Message}");
}
// Close the GeoPackage
newGeoPackage.Close();
Thanks for looking!