Name: PostgreSQL-GeoPackage
Owner: EOX IT Services GmbH
Description: Script to store a GeoPackage in PostgreSQL
Created: 2016-08-09 09:47:39.0
Updated: 2017-11-30 15:02:31.0
Pushed: 2016-10-21 13:49:55.0
Homepage: null
Size: 7569
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This repository holds scripts used to evaluated the suitability of PostgreSQL to serve as alternative to SQLite for a container of raster tiles as specified in the GeoPackage standard [OGC 12-128r11].
Follow the Vagrant instructions for a clean environment and connect to it:
ant ssh
ostgreSQL-GeoPackage/
Create a PostgreSQL database and load the GeoPackage schema into the PostgreSQL-GeoPackage:
tedb -E UTF8 -U gpkg gpkg
-U gpkg gpkg -f gpkg-pg_init.sql
Load a SQLite GeoPackage into the PostgreSQL-GeoPackage, dump it again, and validate the result of the round-trip:
kg-pg_loadpkg.py Sample-GeoPackage_Sentinel-2_Vienna_Austria.gpkg "dbname='gpkg' user='gpkg'"
te3 Sample-GeoPackage_Sentinel-2_Vienna_Austria.gpkg .dump > before
ample-GeoPackage_Sentinel-2_Vienna_Austria.gpkg
kg-pg_dump.py "dbname='gpkg' user='gpkg'" Sample-GeoPackage_Sentinel-2_Vienna_Austria
te3 Sample-GeoPackage_Sentinel-2_Vienna_Austria.gpkg .dump > after
before after
Dump a spatial subset of the PostgreSQL-GeoPackage and validate it by visual comparison to a GDAL generated subset:
_translate -of GPKG -srcwin 768 768 256 256 Sample-GeoPackage_Sentinel-2_Vienna_Austria.gpkg Sample-GeoPackage_Sentinel-2_Vienna_Austria_subset_gdal.gpkg
ample-GeoPackage_Sentinel-2_Vienna_Austria.gpkg
kg-pg_dump.py "dbname='gpkg' user='gpkg'" Sample-GeoPackage_Sentinel-2_Vienna_Austria -srcwin 3 3 1 1
Finally, drop the PostgreSQL-GeoPackage:
kg-pg_drop.py "dbname='gpkg' user='gpkg'" Sample-GeoPackage_Sentinel-2_Vienna_Austria
The sample SQLite GeoPackage was created from Sentinel-2 data using GDAL.
Legal notice: Contains modified Copernicus Sentinel data [2016]