GDAL
Using GDAL to load a GeoPackage into a database
Requirements
Instructions
1
Use the ogrinfo program to list information about the GeoPackage
ogrinfo wtr_ntwk_waterlinkset.gpkgINFO: Open of `C:\wtr_ntwk_waterlinkset.gpkg'
using driver `GPKG' successful.
1: wtr_ntwk_waterlinkset
2: wtr_ntwk_waterlinkset_wtrlinkref (None)2
Use ‘Summary Only’ (-so) and ‘List all features of all layers’ (-al) arguments to view summary information about the layers within the GeoPackage
-so) and ‘List all features of all layers’ (-al) arguments to view summary information about the layers within the GeoPackageogrinfo wtr_ntwk_waterlinkset.gpkg -so -alINFO: Open of `C:\wtr_ntwk_waterlinkset.gpkg'
using driver `GPKG' successful.
Layer name: wtr_ntwk_waterlinkset
Geometry: Unknown (any)
Feature Count: 116
Extent: (209562.134000, 79229.510000) - (341688.834000, 853194.875000)
Layer SRS WKT:
PROJCRS["OSGB 1936 / British National Grid",
[...]3
Load the GeoPackage into a PostgreSQL database using the ogr2ogr program
ogr2ogr -f PostgreSQL "PG:user=example_user password=example_password dbname=postgres host=localhost port=5432 active_schema=example_schema" wtr_ntwk_waterlinkset.gpkgschemaname | tablename
---------------+---------------------------------
example_schema | wtr_ntwk_waterlinkset
example_schema | wtr_ntwk_waterlinkset_wtrlinkrefLast updated
Was this helpful?