<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Geopackage table, update size of table? in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/geopackage-table-update-size-of-table/m-p/1552549#M13073</link>
    <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Example (Removes everything for testing)&lt;/P&gt;&lt;P&gt;try&lt;BR /&gt;{&lt;BR /&gt;// Define query to select all features&lt;BR /&gt;QueryParameters queryParams = new QueryParameters&lt;BR /&gt;{&lt;BR /&gt;WhereClause = "1=1" // Select all features&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;// Query all features in the table&lt;BR /&gt;FeatureQueryResult features = featureTable.QueryFeaturesAsync(queryParams).Result;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Collect all ObjectIds to delete features in bulk&lt;BR /&gt;List&amp;lt;Feature&amp;gt; objectIds = new List&amp;lt;Feature&amp;gt;();&lt;BR /&gt;foreach (Feature feature in features)&lt;BR /&gt;{&lt;BR /&gt;objectIds.Add(feature);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Delete features in bulk&lt;BR /&gt;featureTable.DeleteFeaturesAsync(objectIds).Wait();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine($"Error clearing features: {ex.Message}");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Close the GeoPackage&lt;BR /&gt;newGeoPackage.Close();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for looking!&lt;/P&gt;</description>
    <pubDate>Fri, 25 Oct 2024 21:10:02 GMT</pubDate>
    <dc:creator>SP2501</dc:creator>
    <dc:date>2024-10-25T21:10:02Z</dc:date>
    <item>
      <title>Geopackage table, update size of table?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/geopackage-table-update-size-of-table/m-p/1552549#M13073</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Example (Removes everything for testing)&lt;/P&gt;&lt;P&gt;try&lt;BR /&gt;{&lt;BR /&gt;// Define query to select all features&lt;BR /&gt;QueryParameters queryParams = new QueryParameters&lt;BR /&gt;{&lt;BR /&gt;WhereClause = "1=1" // Select all features&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;// Query all features in the table&lt;BR /&gt;FeatureQueryResult features = featureTable.QueryFeaturesAsync(queryParams).Result;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Collect all ObjectIds to delete features in bulk&lt;BR /&gt;List&amp;lt;Feature&amp;gt; objectIds = new List&amp;lt;Feature&amp;gt;();&lt;BR /&gt;foreach (Feature feature in features)&lt;BR /&gt;{&lt;BR /&gt;objectIds.Add(feature);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Delete features in bulk&lt;BR /&gt;featureTable.DeleteFeaturesAsync(objectIds).Wait();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine($"Error clearing features: {ex.Message}");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Close the GeoPackage&lt;BR /&gt;newGeoPackage.Close();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for looking!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 21:10:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/geopackage-table-update-size-of-table/m-p/1552549#M13073</guid>
      <dc:creator>SP2501</dc:creator>
      <dc:date>2024-10-25T21:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Geopackage table, update size of table?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/geopackage-table-update-size-of-table/m-p/1552561#M13074</link>
      <description>&lt;P&gt;This is pretty typical database behavior. In this case the underlying database is a sqlite database, and it would need a vacuum operation. See:&amp;nbsp;&lt;A href="https://sqlite.org/lang_vacuum.html" target="_blank" rel="noopener"&gt;https://sqlite.org/lang_vacuum.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The SDK doesn't provide vacuum out of the box, but any sqlite API or tool should be able to do this for you.&lt;/P&gt;
&lt;P&gt;If the geodatabase is sync enabled, it still needs to track deleted features, so this can be synchronized with the server later.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 22:52:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/geopackage-table-update-size-of-table/m-p/1552561#M13074</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2024-10-25T22:52:52Z</dc:date>
    </item>
  </channel>
</rss>

