2
0
Fork
You've already forked congen
0
Creating conservation planning datasets intuitively by playing with parameters and getting instant visualized feedback
  • TeX 51.9%
  • Python 47.6%
  • Shell 0.4%
  • Batchfile 0.1%
2026年03月05日 09:50:40 +01:00
.idea README: Add images for report and presentation 2025年03月20日 11:32:52 +01:00
assets Apptainer: Add empty assets/gurobi_user.lic.template 2022年10月28日 00:04:40 +02:00
data Rename src directory to application name 2023年03月31日 18:50:45 +02:00
doc report: point layer explaination 2024年11月25日 12:15:58 +01:00
hand-ins README: Add images for report and presentation 2025年03月20日 11:32:52 +01:00
material/papers Move LandCover QGIS file to results 2025年02月28日 10:03:23 +01:00
projects update submodules 2026年03月05日 09:50:40 +01:00
results @5bcb3a9905 README: Update Apptainer file name 2025年03月20日 12:21:07 +01:00
src Add apptainer container 2025年03月14日 14:14:42 +01:00
.gitignore .gitignore 2025年02月28日 10:02:11 +01:00
.gitlab-ci.yml GitLab CI: Do not delete other files in destination 2022年10月31日 09:48:20 +00:00
.gitmodules Revert "results: use absolute submodule url to codeberg instead of relative one to make it work for HHU cs repo" 2023年11月21日 16:54:10 +01:00
cocoplan.apptainer.def renamed apptainer.def to cocoplan.apptainer.def 2025年03月13日 15:10:13 +01:00
congen.apptainer.def Add apptainer container 2025年03月14日 14:14:42 +01:00
gb_output.py restructure analysis code 2022年10月28日 00:07:05 +02:00
LICENSE Add LICENSE 2023年03月31日 17:15:07 +00:00
Notes.md Notes.md 2025年02月28日 10:00:05 +01:00
OldApproach.md Update README.md with TODOs and moving old stuff to OldApproach.md 2023年03月31日 14:59:37 +02:00
parse_output.py Snakemake: Fixing bugs with proioritzr output parsing 2022年10月28日 22:16:14 +02:00
PKGBUILD Documentation on installation and usage 2023年04月07日 22:31:27 +02:00
pyproject.toml Add apptainer container 2025年03月14日 14:14:42 +01:00
pyvenv.cfg Add PyCharm files 2024年10月24日 11:39:18 +02:00
README.md README: Update Apptainer file name 2025年03月20日 12:21:07 +01:00
setup.py Working on build environment 2023年03月31日 20:55:28 +02:00
Snakefile Revert "Snakemake: Revert Marxan output paths to input folder" 2022年11月01日 02:09:48 +01:00
snakemake_cluster.sh Snakemake: Add cluster execution arguments 2022年11月01日 02:37:56 +01:00
solution.json refactoring for readibility 2022年10月28日 00:07:10 +02:00

ConGen: A graphical application for synthetic conservation planning data design

Overview of the main application window showing a smooth gradient raster layer

Full information

For full information, see the ConGen report or the ConGen presentation.

Cover of the ConGen report Title slide of the ConGen final presentation

Requirements

For python library requirements, see pyproject.toml. Additionally, the following system libraries and development headers are required:

  • basic build tools (gcc, make etc.)
  • gdal for building the Python gdal module
  • gtk3 graphic libraries for the wxPython user interface

Usage

Locally installed (see below)

After installation, type

python -m congen

or (outdated)

congen-gui

to start the graphical interface. If installed system-wide or user-wide, this can be done from any terminal session. Otherwise, make sure to cd to the project folder and source bin/activate to activate the virtual environment first.

For additional usage instructions, see Getting Started.

Apptainer container

Using Apptainer, ConGen can be executed without installation. There is an Apptainer container definition available at congen.apptainer.def. A readily built container should be available at results/congen.apptainer. Just use

apptainer run <image name> <ConGen args>

to execute ConGen with the supplied arguments. Both the graphical interface and the command line versions are accessible using this way. Execute apptainer run <image name> -h to see the command line options for ConGen. Execute apptainer run <image name> without additional options to just use the ConGen UI.

Command-Line usage

Syntax:

--layer <Layer-Type> <Layer-Name> --parameter <Layer-Name>.<Parameter-Name> <Value>

Installation

Via pip for development

To install a local copy for development, first git clone this repository to your machine and cd into it. Then execute

python -m venv venv
source venv/bin/activate
pip install -e .

This will create a virtualenv in the repository folder and install the packages and all dependencies locally, without any changes to the system-wide python libraries. Furthermore, this will only install a reference to the files under src/ instead of copying them, so all changes made during development are immediately visible.

Via official pip package (outdated)

This project is available as an official pip package, and can be installed using

pip install congen

on any machine with access to a pip mirror, meeting the requirements above. It is recommended to not install packages to your machine's root, but rather to a user-local directory using

pip install --user congen

Using a virtualenv

Even better, use a virtualenv for this project:

mkdir congen-venv
python -m venv congen-venv
cd congen-venv
source bin/activate
pip install congen

Now the package and all dependencies will be installed inside the congen-venv-directory, and only be available in terminal sessions where source bin/activate has been typed from within the congen-venv directory (cd to it first). This way, no changes to your system python packages are required, and uninstallation is as easy as deleting the congen-venv directory.

Using your systems package manager (system-wide, outdated)

There is an arch linux package available for this project to install it system-wide. For this, download the PKGBUILD file or git clone the entire repository, cd to it, and then execute

makepkg -sri

This will install this project and all dependencies system-wide.

Known issues

Due to strange bugs in the deserialization of objects in the jsonpickle module, saving/loading project files does not work at the moment. Technical detail: Objects referencing other objects cause issues, instead of the reference to the correct object being restored, a completely different object is referenced, e.g. a parameter instead of a layer.

TODOs

  • Fix WardClusteredPointLayer
  • Command line interface
    • Might replace project saving / restoring by using command line strings instead
  • Parallelisation / Multi-Threading for large datasets on slow CPUs
    • Dataset export
    • Random Walk generation (per starting point)
  • Implement connectivity graphs
  • Additional random models
  • Additional import / export formats
    • Import and visualize csv data
      • Useful for checking datasets after export
  • Benchmark different conservation planning software
  • Improve UI / UX
    • Onboarding / Instructions
      • (?)-Button for most parameters / layers etc.
    • Project creation wizard with predefined templates?
    • Project template files
    • Tooltips for parameters
    • Multi-select layers, batch-adjust parameters
  • Documentation, Manual
  • Use logging framework
  • Fix project loading/saving
    • Might be replaced by loading / saving command line strings?
  • Automatically make currently selected layer the depending layer upon adding new layers
  • Improve performance
    • Reduce CPU and memory footprint of graphs (own implementation, since we don't use much of iGraph anyway?)
      • Partially fixed by allowing to disable graph rendering, as the calculation itself is efficient enough
    • Option to pause rendering for instant adjustments
  • Write tests
    • Check exported datasets
      • PU IDs match across graph, feature and quality data
      • PU coordinates match across data and PU IDs (i.e. no accidental transposing of the data etc.)
  • Better separation of UI and logic
  • Introduce different views, e.g. for features, quality data, intermediate layers etc., as it does not make sense to sum values of species occurrence data and quality data

Ideas

  • Make layer_usage classes instead of a parameter, and dynamically generate layer classes that inherit the layer_usages
    • Add different menus to add feature or quality layers
    • Benefit: Less clicks for users, we don't need to add / remove parameters if layer usage changes
    • Con: More UI elements, more (dynamic) classes
  • clustering of nodes in graph as probability.csv gets very big quickly
  • use / compare to real geographical data (OpenStreetMap)
  • Benchmark different conservation planning software
  • Layer masks for Perlin Noise layers to create sparsity
  • More sophisticated random walks:
    • Multiple random walks starting in same location to simulate multiple individuals
    • Negative random walk values: Individuals are repelled by that area, move away
  • Focus on UI/UX improvement / best practices, testing
  • Metrics to evaluate quality of generated data / similarity to real data
  • Higher edge weights when crossing areas with lower feature values
  • Animals should leave the city again upon entering: Transform city areas into gradients, values get more negative with increaisng distance from the city borders
  • Limit starting points to habitats, e.g. fish in water
  • Filter landscape types with connected area below threshold

Ideas after final presentation

  • Split real data into parts for AI training
  • Multiple terrain layers or one terrain layer with different components?
    • Have random walk probabilities depend on multiple filter layers with different proportion
    • Landscape borders? (e.g. ducks at the border of lake and grassland)
  • Random Walk improvements
    • Random Walks as probability filter for random walks
    • Elevation data as probability filter for random walks
    • Have random walks stop at highways?
    • Stay on the same place for multiple iterations if probability is good?
    • Weather data as probability filter?
  • Can we even compare conservation planning algorithms without knowing our data is good?
    • Isn't our data good enough already, given the low complexity of the conservation planning algorithms?

Master's thesis

Features

  • Graph analyses
  • Comparison of Conservation Planning Software
  • Comparison of synthetic to real data (Metrics?)
    • AI?
  • Obstacles (Highways) -> (Per-species) restriction layers?
  • More / Better random models

Archievements

  • Object-oriented design
    • All layer types are implemented as classes that inherit from common layer types, overriding common methods if needed
  • wxPython GUI with Model-View-Controller Design
    • LayerListCtrl controller class manages both a wxPython list control and the underlying data structure
    • List view and underlying data structure are always in sync
    • On parameter change: Corresponding value in underlying data structure gets automatically updated, list view and rendering are automatically refreshed
  • Custom implementation for parameters
    • Wrapping a single value (e.g. int, bool, string) with metadata (default, min, max values, parameter name and description, etc.)
    • Stored in a list for each layer type to distinguish parameters from other layer instance variables
    • Each layer type requires different parameters, extends the parameter list from inherited classes
    • Automatically render appropriate parameter controls for each layer type based on parameter list
    • Automatically render columns in layer list based on parameter list
    • Caching: Specify which parameters invalidate the calculated cache, only re-calculate layer data if relevant parameters change, don't recalculate for parameters that can be applied to existing data -> minifies computational overhead, especially for applications with many layers
    • Python magic so parameters of each layer can still be accessed via layer.parameterName despite being a) stored in a list variable instead of being class instance members themselves b) classes that wrap the actual value with additional metadata

Material

Ecology

Procedural map generation

Perlin Noise

Python Libraries

Not exhaustive