This utility uses NGA's Geopackage Optimizer in order to pre-optimize Geopackages for use on the web (MAGE).
You will need to have a somewhat recent version of Node.js installed; you can download and install the appropriate version for your operating system, from the official download page.
- download this utility, as a ZIP file
- extract the ZIP to a location of your choosing
- move to the location where you extracted the zip: e.g.
cd /home/jim/desktop
- in a terminal, run
npm i
to install the required dependencies
Pre-process every geopackage before you upload it using the instructions below.
- open a terminal and navigate to the location where you extracted the ZIP, e.g.
cd /home/jim/desktop/gpkg-optimizer
- execute the
optimize.sh
script, giving two arguments: the input GPKG path and the output GPKG path
./optimize.sh 'input_gpkg_path' 'output_gpkg_path'
- this may take a lot of time depending on the complexity of the Geopackage you are processing -- be patient
- once complete, locate the output GPKG and use this when uploading a new layer within MAGE
Given:
- you have extracted the ZIP to
/home/jim/desktop/gpkg-optimizer
- you have a Geopackage you'd like to process and it is stored at
/home/jim/desktop/my_geopackage.gpkg
Execute the following commands within your terminal:
- move to the location where you extracted the zip:
cd /home/jim/desktop/gpkg-optimizer
- optimize the Geopackage:
./optimize.sh '/home/jim/desktop/my_geopackage.gpkg' '/home/jim/desktop/my_geopackage_optimized.gpkg'
- upload
/home/jim/desktop/my_geopackage_optimized.gpkg
to MAGE