Generate a map for https://www.ccc.de/regional from Wikidata and the doku.ccc.de Semantic MediaWiki data.
Find a file
s3lph aa842979e9
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Catch the edge case where a space is returned both as an Erfa and a Chaostreff by SMW
2022-10-09 23:01:04 +02:00
cache.example Solve the Luxembourg Problem 2022-10-09 01:15:36 +02:00
style Improve text layouting (closes #1) 2022-10-09 22:40:01 +02:00
.gitignore Solve the Luxembourg Problem 2022-10-09 01:15:36 +02:00
.woodpecker.yml Simplify and improve text layouting. Still not optimal, but MUCH better. Also add a CLI flag for renaming cities 2022-10-09 07:12:43 +02:00
generate_map.py Catch the edge case where a space is returned both as an Erfa and a Chaostreff by SMW 2022-10-09 23:01:04 +02:00
LICENSE License 2022-10-09 02:26:47 +02:00
map.readme.png Improve text layouting (closes #1) 2022-10-09 22:40:01 +02:00
README.md Add authentication to TLDR 2022-10-09 22:55:49 +02:00
requirements.txt Cleanup 2022-10-08 21:17:31 +02:00

erfamap

Generate a map similar to https://www.ccc.de/regional from Wikidata and the doku.ccc.de Semantic MediaWiki data.

TL;DR

pip3 install -r requirements.txt
export DOKU_CCC_DE_BASICAUTH=username:password
./generate_map.py --update-erfalist

Map as generated by this tool

Installation

  1. Create a Python virtualenv: python3 -m virtualenv venv
  2. Enable the virtualenv: . venv/bin/activate
  3. Install the dependencies: pip install -r requirements.txt

Instead of following these steps, you could also install the dependencies from your OS' package manager.

Usage

For a quick test run, point the script at the cache.example directory:

./generate_map.py --cache-directory cache.example

Find the result in the files map.svg and map.png.

If the wrong font is used in the PNG, make sure the chosen font is installed on your system. (CairoSVG does not support the use of @font-face in style sheets.)

Usually you'll want to keep the border cache, but renew the Erfa & Chaostreff list from time to time:

./generate_map.py --update-erfalist

For this, you need to provide the HTTP Basic Auth credentials to doku.ccc.de via an environment variable:

export DOKU_CCC_DE_BASICAUTH=username:password

A run without cache takes some time as it fetches all data from their sources:

  1. Get a list of countries in Europe and federal states in Germany from Wikidata.
  2. Download all these countries' and states' border shapes from Wikimedia Commons.
  3. Get a list of Erfas & Chaostreffs from the doku.ccc.de Semantic Mediawiki API.
  4. Resolve all POIs' (Erfas & Chaostreffs) street addresses' to geocoordinates using Nominatim.

Use the cache at least for the country and state borders. Otherwise, Wikidata will start rate limiting pretty quickly.

License

Unless otherwise noted, the contents of this repository are licensed under the MIT License (See LICENSE).

Fonts

The font contained in style/concertone-regular.ttf was created by Johan Kallas (johankallas@gmail.com) and is licensed unter the terms of the SIL Open Font License v1.10.

Geoshape Data

The geoshape data contained in cache.example is in the public domain.