Recently, I had the occasion to attempt to generate an OGC GeoPackage from QGIS and publish it using GeoServer. The use case was fairly straightforward. I had been given data in GML format and needed to publish it. For many valid reasons (such as lack of spatial indexing), GeoServer does not natively support publishing GML data. As a result, I need to convert it to something that GeoServer did support.
QGIS opened and displayed the data easily and, from there, I could export it into any number of formats. (Or I could have used OGR.) The feature attributes had very long names and I didn’t want to lose that richness by exporting to shapefile. I was trying to keep my server-side life simple, so I was hoping to avoid setting up an RDBMS data store for this purpose. It was then that I noticed QGIS supports exporting to GeoPackge, so I decided to give it a go.
For purposes of this post, I am using a shapefile of building footprints of Leonardtown, Maryland. The process is the same for a GML file, however.
As shown below, you initiate the process like any other by right-clicking and choosing “Save As…” in the context menu.