How to open a GeoPackage (.gpkg) file on a Mac

A GeoPackage is a single file, which makes it easier to pass around than a Shapefile. Inside, it is a SQLite database that can hold several map layers at once, so opening one usually starts with finding out what is in it.

What is inside a GeoPackage

A .gpkg is an ordinary SQLite file that follows a standard layout. Each layer is a table, and the shapes are stored in a binary geometry column alongside the attributes. One file might hold parks, roads and building outlines together.

Because it is SQLite, sqlite3 city.gpkg will open it and list the tables. The geometry column is a binary blob there, though, and the metadata tables sit next to the data. A reader that understands the format is more pleasant.

Ways to open one

DuckDB's command line (free)

DuckDB reads every format on this page through its spatial extension, which the command line downloads the first time you ask for it:

brew install duckdb
duckdb -c "INSTALL spatial; LOAD spatial; SELECT * FROM ST_Read('city.gpkg') LIMIT 20"

GDAL's ogrinfo (free)

Run on a GeoPackage with no other arguments, it lists the layers:

brew install gdal
ogrinfo city.gpkg

QGIS (free)

The full open-source desktop GIS. If you need to see the shapes on a map, style them or edit them, this is the right tool, and it is free. It is a lot of application to start if all you wanted was to read the attribute table.

Python

geopandas.read_file('city.gpkg') gives you a GeoDataFrame, and is the right answer when the next step is code. It loads the whole file into memory.

Doing it in Datapuddle

  1. Double-click the file in Finder, drag it onto the app icon, or use File ▸ Open….
  2. The first layer opens as a table, with the geometry shown as readable text.
  3. The editor is filled in with SELECT * FROM ST_Read('…') for that file, so the next query is an edit, not a blank page.

To see every layer in the file:

SELECT unnest(layers).name AS layer
FROM ST_Read_Meta('city.gpkg')

And to read one of the others, name it:

SELECT * FROM ST_Read('city.gpkg', layer = 'roads')

Which to use

Download on the Mac App Store 7-day trial, then $39.99 once · Apple silicon, macOS 26 or later

Datapuddle on the Mac App Store — 7 day trial, then $39.99 once. Apple silicon, macOS 26 or later. · Docs Guides · Home