Extension GPKG View


Extension Basics

Title
GPKG View
Name
ckanext-gpkg-view
Type
Public extension
Description
Preview GeoPackage files as GeoJSON with caching and map visualization
CKAN versions

~2.9, ~2.10, ~2.11

Show details
Download-Url (zip)
Download-Url commit date
2025-06-24
Url to repo
Category
Visualization & Analytics


Background Infos

Description (long)
Show details

The gpkg-view extension provides simple preview functionality for GeoPackage (.gpkg) files in CKAN. It converts GeoPackage files to GeoJSON format for display and includes caching capabilities to avoid re-reading files on subsequent views. The extension integrates with map providers using the same configuration as ckanext-spatial, supporting custom tile layers from OpenStreetMap, CARTO, and other sources. Configuration options include maximum file size limits, cache duration, cache enable/disable, and geometry simplification tolerance for performance optimization.

Version
0.0.4
Version release date
2025-06-24
Contact name
DataShades
Contakt email
Contact Url
(not set)


Installation Guide

Configuration hints

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

Plugins to configure (ckan.ini)
gpkg_view
CKAN Settings (ckan.ini)
# ckan.views.default_views = gpkg_view # ckanext.spatial.common_map.type = custom # ckanext.spatial.common_map.subdomains = abcd # ckanext.spatial.common_map.maxZoom = 20 # ckanext.gpkg_view.max_file_size = 25600000 # ckanext.gpkg_view.cache_duration = 21600 # ckanext.gpkg_view.cache_enabled = true # ckanext.gpkg_view.simplify_tolerance = 0
DB migration to be executed
(not set)
<< back to Extensions