Wednesday, December 17, 2025

Delete a table or layer from GeoPackage within QGIS

 To delete a table (layer) from a GeoPackage within QGIS, you can use either the Browser panel or the DB Manager.


Method 1: Using the Browser Panel

  1. This is the simplest and most direct way to delete a single table.
  2. Open the Browser panel: If it's not already visible, go to the top menu and select View > Panels > Browser Panel.
  3. Navigate to the GeoPackage: In the Browser panel tree, find the GeoPackage file (.gpkg) you are working with.
  4. Expand the GeoPackage: Click the arrow next to the GeoPackage name to view all the layers (tables) it contains.
  5. Delete the layer: Right-click on the specific layer/table you want to remove and select Delete Layer.
  6. Confirm the deletion: A confirmation window will appear; confirm that you want to delete the layer. 


Method 2: Using the DB Manager

The DB Manager provides a more database-oriented interface and is useful for managing multiple tables or running SQL commands. 

  1. Open the DB Manager: Go to the top menu and select Database > DB Manager.
  2. Connect to the GeoPackage: In the left-hand tree, expand GeoPackage. Right-click on GeoPackage and select New Connection, then browse to your .gpkg file.
  3. Find the table: Expand the connection to your GeoPackage and locate the desired table under Tables or Spatial tables.
  4. Delete the table: Right-click on the table name and select Delete.

That is it!

No comments:

Post a Comment