Wagtail based Geospatial Data Manager and backend CMS for geomapviewer
Most national/regional institutions working in weather/climate/DRM sectors regularly produce and disseminate data and information that is Geo-referenced. This can range from forecast model outputs, earth observation data, stations observation, periodic bulletins and advisories and so on. Usually these are shared on their websites and social media pages in static formats, mostly as PNGs or PDFS.
This is an effort to develop an interactive system for managing and publishing Geo-referenced (GIS) datasets. As the institutions produce and share their products in static formats, they can also use packages like this, to make their data interactive.
The package is developed primarily for use by NMHSs at national levels, but can be adapted in other institutions or places that need to visualize their geospatial data.
All the raster and vector datasets uploaded must have time associated with each file.
For netCDF files with time dimension, time is automatically extracted from the file. For Geotiff, each uploaded file must be manually assigned time.
Data management and visualization
- Uploading and visualization of gridded data
- netCDF
- Geotiff
- Uploading and visualization of vector data
- Shapefiles
- Geojson
- Raster Tile serving of raster data using django-large-image.
All
django-large-imagefeatures are available - Vector tile serving using PostGIS MVT Tiles
MapViewer Management
- Management of layers visualized on the geomapviewer
- Control on visibility (public or private) of layers on the MapViewer
Before installing this package, you should make sure you have GDAL installed in your system.
TIP: Installing GDAL can be notoriously difficult. You can use pre-built Python wheels with the GDAL binary bundled,
provided by KitWare, for easy installation in production linux environments.
To install GDAL using KitWare GDAL wheel, use:
pip install --find-links https://girder.github.io/large_image_wheels GDALOther required packages that you will need to install, if not installed already in your Wagtail Project
- psycopg2 - for postgres/postgis database connection
You can install the package using pip:
pip install geomanagerInstall this version of wagtail-admin-sortable from Github. This has some updates to the original packages.
pip install https://github.com/wmo-raf/wagtail-admin-sortable/archive/33bf22f290e7a4210b44667e9ff56e4b35ad309e.zipMake sure the following are all added to your INSTALLED_APPS in your Wagtail settings
INSTALLED_APPS = [
...
"geomanager",
"adminboundarymanager",
"django_large_image",
'django_json_widget',
'django_nextjs',
"django_filters",
"wagtail_color_panel",
"wagtail_adminsortable",
"wagtailhumanitarianicons",
"wagtailiconchooser",
"django_extensions",
"wagtailfontawesomesvg"
"allauth",
"allauth.account",
"wagtailcache",
"wagtail_modeladmin"
"wagtail.contrib.settings",
"rest_framework",
"django.contrib.gis",
...
]Run migrations
python manage.py migrate geomanagerAdd the following to your project's urls.py
urlpatterns = [
...
path("", include("geomanager.urls")),
...
]Geomanager depends on the wagtail-cache package for caching requests. Please have a look at the wagtail-cache documentation for setup instructions
This package is the backend component to the frontend geomapviewer.
If you are developing geomanager and want to test your changes inside a running ClimWeb instance, follow the steps below.
Both repos should be cloned side by side:
wmo/
climweb/
geomanager/
From the climweb directory, use the dev compose file (it already mounts ../geomanager into the containers):
In docker-compose.dev.yml
cimweb_dev:
volumes:
- ../geomanager:/geomanager
Then run ClimWeb as usual:
docker compose -f docker-compose.yml -f docker-compose.dev.yml build
docker compose -f docker-compose.yml -f docker-compose.dev.yml upInside the running ClimWeb container, replace the pinned geomanager with your local copy:
docker exec climweb_dev pip install -e /geomanagerThis must be re-run each time the container is recreated (e.g. after
docker compose build).
If your changes also affect Celery tasks, install it in the worker too:
docker exec climweb_celery_worker_dev pip install -e /geomanagerIf your geomanager changes include model modifications:
docker exec climweb_dev cd src/climweb && python manage.py makemigrations geomanager
docker exec climweb_dev cd src/climweb && python manage.py migrate- Edit code in the geomanager repo as normal.
- Python file changes are picked up automatically (Django dev server reloads).
- If you modify models, run
makemigrations+migrateagain. - When done, commit your migrations in the geomanager repo.
Rebuild the container to go back to the pinned version:
docker compose -f docker-compose.yml -f docker-compose.dev.yml buildOr reinstall the pinned version manually:
docker exec climweb_dev pip install geomanager==<version>TODO
