Search tldr

City Map Poster Generator

MapToPoster is a Python CLI that turns OpenStreetMap data into high-resolution, minimalist city-map posters. It combines geocoding, OSMnx data retrieval, configurable visual themes, and multilingual typography for printable or digital exports.

Share

City Map Poster Generator

Author: originalankur | Published: Unknown | Generated: 2026-01-17 | Domain: github.com
Tags: ‘#python’ ‘#openstreetmap’ ‘#osmnx’ ‘#map-design’ ‘#matplotlib’ ‘#generative-design’


TLDR

MapToPoster generates stylized city posters from OpenStreetMap data through a Python command-line interface. It geocodes a city with Nominatim, downloads road and geographic features using OSMnx, then renders layered maps in matplotlib with 17 built-in themes, configurable dimensions, map radius, typography, and display labels. The project supports non-Latin city names via downloadable Google Fonts and exports 300-DPI PNG posters suitable for print, wallpapers, and social media.

Key Takeaways

  • End-to-end map rendering pipeline: The CLI uses argparse for input, Nominatim for city-to-coordinate geocoding, OSMnx for map data, and matplotlib for final rendering and PNG output.
  • Customizable outputs: Required --city and --country inputs can be supplemented with center-coordinate overrides, a theme, map radius, country-label override, and image dimensions up to 20 × 20 inches.
  • 17 visual themes: Built-in styles include noir, blueprint, neon_cyberpunk, japanese_ink, terracotta, ocean, sunset, emerald, and more; users can add JSON theme files with colors for backgrounds, labels, water, parks, and road classes.
  • Multilingual typography: Users can provide native-script city/country labels and a Google Font family. The tool detects predominantly Latin text using Unicode ranges and applies letter spacing only when more than 80% of alphabetic characters are Latin.
  • Rendering hierarchy and performance: Text renders at z=11, gradients at z=10, roads at z=3, parks at z=2, water at z=1, and background at z=0. Distances above 20 km can cause slow, memory-heavy downloads; using network_type='drive' and lower DPI improves preview speed.

Images & Media

  • MapToPoster repository — Source code, themes, generated poster examples, and contributor guidance.
  • uv — Recommended Python environment and dependency manager; uv run automatically manages the virtual environment.
  • OpenStreetMap — Underlying geographic data source used to generate posters.
  • OSMnx — Python library used to retrieve street networks and geographic features from OpenStreetMap.
  • Google Fonts — Font source for multilingual labels; downloaded fonts are cached locally in fonts/cache/.

Keep reading