Skip to content

Local ๐Ÿ’ป

Development on the Host (Local Machine)

Info

Local development requires Python 3.10 or higher due to package compatibility.

๐Ÿ“ฆ Dependencies

Make sure these are available on your system:

  • GDAL (incl headers have to be available)
  • make
  • general pip and virtualenv has to be available

โœ… Install on Ubuntu:

sudo apt-get update && sudo apt-get install gdal make

โœ… Install on Arch:

sudo pacman -Syy && sudo pacman -S gdal make

๐Ÿงช Set Up Virtual Environment

To prepare a local virtual environment (in the folder .venv) run the following command:

make install-dev

In case you are using an IDE you can point it to that venv to have code completion and code inspection.


๐ŸŒ Running the server

Georama needs a postgres database to store its stuff in. Unless you have a running database already somewhere you can easily start one via docker.

Spin up a database (for georama admin configuration)

docker run --rm -d --name georama-db -e POSTGRES_PASSWORD=test -p 54321:5432 postgis/postgis:latest

The maps (qgis-server-light) part of georama needs a redis instance to put jobs in.

Start a redis instance

For integration with QGIS-Server-Light we need to have a redis instance available:

docker run --rm -d -p 1234:6379 --name qsl-redis redis

Start QGIS-Server-Light worker

The QGIS-Server-Light worker can be started with:

docker run -d --rm --net host --name qsl -v $(pwd)/tests/resources/projects:/io/data opengisch/qgis-server-light:latest

Launch the Auto-Reloading Dev Server

You can spin up a self reloading DEV server which detects code changes automatically with:

make serve-dev
  1. Initialize the Database: Once the server is running, open another terminal to create the database structure for Georama.
make migrate
  1. Create a Superuser: Create a superuser which can be used to log into Georama:
make create-superuser
  1. Create example content (like demo users):
make create-example-content

You may now navigate to http://localhost:4242/admin/ with your favorite browser.

Info

To force reinstall GitHub dependency qgis_server_light interface without rebuilding everything:

.venv/bin/pip install --force-reinstall --no-deps "git+ssh://git@github.com/opengisch/qgis-server-light.git@master#qgis_server_light"


โœ… Running the tests

To run the tests locally execute the following command:

make tests