Upload GeoPackage (.gpkg) file to PostGIS

Last updated on August 20, 2022.

GeoPackage is a spatial data format compatible with SQLite. Lots of GIS data comes in GeoPackage formats, so it's important to be able to convert it to other file formats and upload it into your spatial database for processing, potentially in machine learning and data science workflows.

Lots of useful files come as .gpkg files, including GADM administrative country maps. The GeoPackage file format was actually initially designed for mobile applications, and conveniently allows for opening GeoPackage files in SQLite.

Below, anyone can upload a GeoPackage file before downloading it as an .sql file. If you self-host your database, you could upload that .sql file via psql or opt to host the database on Bunting GIS on the free trial.

GeoPackage Format Support:

  • CRS automatically detected (WGS84 default)

Once the file is converted to PostGIS, you can either download the file as .sql and upload to your database with psql, or host the file with us for free. This file fits on our free plan, which is under 128MB of storage and shared compute time. Larger datasets can be stored for $2.50/GB/month.

Uploading to PostGIS (self-host)

To load your .psql file into your PostGIS instance (local, Amazon RDS, or other), you can use the psql command line tool.

psql -U postgres -h localhost -d postgres -f downloaded_file.sql