Docs › Formats › GeoPackage

GeoPackage

GeoPackage is the OGC's modern, open replacement for Shapefile — a single SQLite database file that holds one or many vector layers along with their CRS metadata. It solves most of Shapefile's problems (long field names, UTF-8 encoding, no companion files, multiple layers per file, no 2 GB cap) and is well-supported across QGIS, ArcGIS and ogr2ogr.

File extension: .gpkg · Read: ✓ · Write: ✓ · Multi-layer:

CLI examples

mapshaper basemap.gpkg -info
mapshaper basemap.gpkg -o format=geojson regions.geojson
mapshaper -i basemap.gpkg layers=provinces,cities -info
mapshaper provinces.shp -o provinces.gpkg
mapshaper a.shp b.shp -o combined.gpkg

Format-specific input options

  • layers= — comma-separated list of layer names to import. Useful for picking a subset out of a large multi-layer GeoPackage. Omit to import everything.

Format-specific output options

There are no GeoPackage-specific -o options. The format honors the general flags (precision=, gzip, zip, etc.) where they apply.

Practical notes

  • By default, every vector layer in the file is imported as a separate Mapshaper layer. To pick a subset, use the layers= option on the CLI; in the web app, tick the with advanced options checkbox in the import dialog to bring up a per-layer selection list.
  • When multiple layers are exported to a single .gpkg, each becomes a separate layer table inside the database, named after the source layer.
  • Raster tile layers (the OGC GeoPackage spec also covers tiles) are ignored — Mapshaper is vector-only.

External resources