The Problem

Generating a stylized map poster normally means GIS tooling, a design editor, or a paid API. This repo collapses that into one CLI command: give it a city, a country, and a theme, and it renders a minimalist PNG poster locally.

What This Does

The entire program is a single script, create_map_poster.py, containing 11 functions. It resolves a city's coordinates, loads a visual theme from themes/*.json (17 themes), and renders a poster to posters/ with a timestamped filename. Three Roboto font files in fonts/ handle typography.

Themes are pure JSON data — color palettes, edge styling, and per-feature rules — so adding a theme requires no code changes. The README documents 20+ example invocations across cities and themes.

How It Is Wired

Execution starts at the CLI in create_map_poster.py. create_poster is the hub: it calls create_gradient_fade (twice), get_edge_colors_by_type, and get_edge_widths_by_type, and the pipeline resolves coordinates through get_coordinates. load_theme reads the JSON theme, load_fonts loads the font faces, and generate_output_filename names the output PNG. Two functions touch the filesystem.

get_available_themes is the most reused helper, called from 2 places including list_themes. The module graph is a single node with zero import edges and no cycles, so the blast radius is contained: change create_poster and you affect the whole render path; everything else is leaf code. A theme lookup or font change touches nothing downstream.

How To Use It

pip install -r requirements.txt
python create_map_poster.py -c "New York" -C "USA" -t noir -d 12000
python create_map_poster.py --list-themes

Configuration is theme JSON only — no environment variables or API keys are required. The -d flag sets radius in meters (4000–6000 for dense centers, 15000–20000 for full metros). Output lands in posters/ as a dated PNG.

Real-World Use

A print shop or design studio can script poster generation for client cities: loop over a city list, pick a theme per city, and batch-render. The --list-themes flag plus the JSON theme files make it easy to preview and extend the palette without touching the render code.

Code Health & Issues

Static analysis found 1 finding (0 high, 1 medium):

  • Medium/Resilience — Broad exception handling in create_map_poster.py: bare except swallows errors indiscriminately. Fix: catch specific exceptions; re-raise or log the rest.
  • Medium/Supply chain — No Dependabot or Renovate configured for requirements.txt; advisories go unpatched until a manual audit.
  • Medium/Repo hygiene — Large binaries committed: posters/tokyo_japanese_ink_20260108_165830.png is 15.9MB, with 12 blobs over 5MB total. Move to Git LFS or object storage to avoid paying for them on every clone and CI checkout.

SDLC gaps: no test files, no CI pipeline, and requirements.txt has no lockfile, so builds are not reproducible.

The Bottom Line

A clean, single-purpose tool with a well-separated theme system — adding a theme is trivial and the CLI is well documented. The gaps are operational: no tests, no CI, no dependency pinning, and multi-megabyte PNGs bloating the repo. Fine for generating posters; not something to build infrastructure on without hardening first.