Requirements:
- CKAN 2.10+
- Python 3.8+
- GeoPackage files
- geopandas library (installed automatically)
Installation:
pip install ckanext-gpkg-view
Or from source:
git clone https://github.com/DataShades/ckanext-gpkg-view.git
cd ckanext-gpkg-view
pip install -e .
Add to ckan.plugins and default views:
ckan.plugins = gpkg_view
ckan.views.default_views = gpkg_view
Map provider configuration (uses same config as ckanext-spatial):
ckanext.spatial.common_map.type = custom
ckanext.spatial.common_map.custom.url = https://tile.openstreetmap.org/{z}/{x}/{y}.png
ckanext.spatial.common_map.attribution = ‘© OpenStreetMap contributors © CARTO’
ckanext.spatial.common_map.subdomains = abcd
ckanext.spatial.common_map.maxZoom = 20
GPKG-specific configuration:
Maximum file size for GPKG files (default: 25MB)
ckanext.gpkg_view.max_file_size = 25600000
Cache duration in seconds (default: 6 hours)
ckanext.gpkg_view.cache_duration = 21600
Enable/disable caching (default: true)
ckanext.gpkg_view.cache_enabled = true
Simplification tolerance in CRS units (default: 0 = no simplification)
Higher values = more simplification, smaller files, less detail
ckanext.gpkg_view.simplify_tolerance = 0
Testing: pytest –ckan-ini=test.ini