About this project

MapToPoster is a command-line tool that generates minimalist, poster-style maps of cities worldwide. Given a city and country name, it geocodes the location, downloads OpenStreetMap data, and renders a high-resolution PNG suitable for printing or wallpapers. How it works: the script resolves coordinates via Nominatim, fetches street networks and features through OSMnx, then draws layered output with matplotlib — background, water, parks, roads colored and weighted by OSM highway type, gradient fades, and text labels. Output files are saved to a posters/ directory named by city, theme and timestamp. Key options include --city and --country (required), plus --theme, --distance (map radius in meters, default 18000), --width/--height in inches (default 12x16, max 20), --latitude/--longitude to override the center, --country-label, --list-themes, and --all-themes to render every theme at once. A resolution guide maps common targets (Instagram post, mobile/HD/4K wallpaper, A4 print) to inch values at 300 DPI. Multilingual support lets users display city and country names in native scripts via --display-city, --display-country and --font-family; fonts are downloaded from Google Fonts and cached locally. The renderer detects Latin versus non-Latin scripts and adjusts letter spacing accordingly (spaced Latin letters, natural spacing for Japanese, Arabic, Korean, Thai and others). Seventeen themes ship in the themes/ directory, including noir, midnight_blue, blueprint, neon_cyberpunk, warm_beige, pastel_dream, japanese_ink, emerald, forest, ocean, terracotta, sunset, autumn, copper_patina, monochrome_blue, gradient_roads and contrast_zones. Custom themes are added as JSON files defining background, text, water, parks and per-road-class colors. Installation supports uv (recommended, with locked dependencies) or pip plus a virtual environment. The README also documents the internal architecture, key functions, rendering z-order, OSM highway-to-road-hierarchy mapping, typography positioning, extension patterns for new map layers or theme properties, and performance tips such as caching coordinates and using drive-only networks for faster renders.