[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-73976":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":16,"starSnapshotCount":16,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},73976,"maptoposter","originalankur\u002Fmaptoposter","originalankur","Transform your favorite cities into beautiful, minimalist designs. MapToPoster lets you create and export visually striking map posters with code.","",null,"Python",13472,1213,45,24,0,23,47,339,69,44.25,"MIT License",false,"main",true,[27,28,29,30,31,32,33,34],"design","maps","matplotlib-pyplot","openstreetmap","osmnx","poster","python","visualdesign","2026-06-12 02:03:20","# City Map Poster Generator\n\nGenerate beautiful, minimalist map posters for any city in the world.\n\n\u003Cimg src=\"posters\u002Fsingapore_neon_cyberpunk_20260118_153328.png\" width=\"250\">\n\u003Cimg src=\"posters\u002Fdubai_midnight_blue_20260118_140807.png\" width=\"250\">\n\n## Examples\n\n| Country      | City           | Theme           | Poster |\n|:------------:|:--------------:|:---------------:|:------:|\n| USA          | San Francisco  | sunset          | \u003Cimg src=\"posters\u002Fsan_francisco_sunset_20260118_144726.png\" width=\"250\"> |\n| Spain        | Barcelona      | warm_beige      | \u003Cimg src=\"posters\u002Fbarcelona_warm_beige_20260118_140048.png\" width=\"250\"> |\n| Italy        | Venice         | blueprint       | \u003Cimg src=\"posters\u002Fvenice_blueprint_20260118_140505.png\" width=\"250\"> |\n| Japan        | Tokyo          | japanese_ink    | \u003Cimg src=\"posters\u002Ftokyo_japanese_ink_20260118_142446.png\" width=\"250\"> |\n| India        | Mumbai         | contrast_zones  | \u003Cimg src=\"posters\u002Fmumbai_contrast_zones_20260118_145843.png\" width=\"250\"> |\n| Morocco      | Marrakech      | terracotta      | \u003Cimg src=\"posters\u002Fmarrakech_terracotta_20260118_143253.png\" width=\"250\"> |\n| Singapore    | Singapore      | neon_cyberpunk  | \u003Cimg src=\"posters\u002Fsingapore_neon_cyberpunk_20260118_153328.png\" width=\"250\"> |\n| Australia    | Melbourne      | forest          | \u003Cimg src=\"posters\u002Fmelbourne_forest_20260118_153446.png\" width=\"250\"> |\n| UAE          | Dubai          | midnight_blue   | \u003Cimg src=\"posters\u002Fdubai_midnight_blue_20260118_140807.png\" width=\"250\"> |\n| USA          | Seattle        | emerald         | \u003Cimg src=\"posters\u002Fseattle_emerald_20260124_162244.png\" width=\"250\"> |\n\n## Installation\n\n### With uv (Recommended)\n\nMake sure [uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F) is installed. Running the script by prepending `uv run` automatically creates and manages a virtual environment.\n\n```bash\n# First run will automatically install dependencies\nuv run .\u002Fcreate_map_poster.py --city \"Paris\" --country \"France\"\n\n# Or sync dependencies explicitly first (using locked versions)\nuv sync --locked\nuv run .\u002Fcreate_map_poster.py --city \"Paris\" --country \"France\"\n```\n\n### With pip + venv\n\n```bash\npython -m venv .venv\nsource .venv\u002Fbin\u002Factivate  # On Windows: .venv\\Scripts\\activate\npip install -r requirements.txt\n```\n\n## Usage\n\n### Generate Poster\n\nIf you're using `uv`:\n\n```bash\nuv run .\u002Fcreate_map_poster.py --city \u003Ccity> --country \u003Ccountry> [options]\n```\n\nOtherwise (pip + venv):\n\n```bash\npython create_map_poster.py --city \u003Ccity> --country \u003Ccountry> [options]\n```\n\n### Required Options\n\n| Option | Short | Description |\n|--------|-------|-------------|\n| `--city` | `-c` | City name (used for geocoding) |\n| `--country` | `-C` | Country name (used for geocoding) |\n\n### Optional Flags\n\n| Option | Short | Description | Default |\n|--------|-------|-------------|---------|\n| **OPTIONAL:** `--latitude` | `-lat` | Override latitude center point (use with --longitude) | |\n| **OPTIONAL:** `--longitude` | `-long` | Override longitude center point (use with --latitude) | |\n| **OPTIONAL:** `--country-label` | | Override country text displayed on poster | |\n| **OPTIONAL:** `--theme` | `-t` | Theme name | terracotta |\n| **OPTIONAL:** `--distance` | `-d` | Map radius in meters | 18000 |\n| **OPTIONAL:** `--list-themes` | | List all available themes | |\n| **OPTIONAL:** `--all-themes` | | Generate posters for all available themes | |\n| **OPTIONAL:** `--width` | `-W` | Image width in inches | 12 (max: 20) |\n| **OPTIONAL:** `--height` | `-H` | Image height in inches | 16 (max: 20) |\n\n### Multilingual Support - i18n\n\nDisplay city and country names in your language with custom fonts from google fonts:\n\n| Option | Short | Description |\n|--------|-------|-------------|\n| `--display-city` | `-dc` | Custom display name for city (e.g., \"東京\") |\n| `--display-country` | `-dC` | Custom display name for country (e.g., \"日本\") |\n| `--font-family` | | Google Fonts family name (e.g., \"Noto Sans JP\") |\n\n**Examples:**\n\n```bash\n# Japanese\npython create_map_poster.py -c \"Tokyo\" -C \"Japan\" -dc \"東京\" -dC \"日本\" --font-family \"Noto Sans JP\"\n\n# Korean\npython create_map_poster.py -c \"Seoul\" -C \"South Korea\" -dc \"서울\" -dC \"대한민국\" --font-family \"Noto Sans KR\"\n\n# Arabic\npython create_map_poster.py -c \"Dubai\" -C \"UAE\" -dc \"دبي\" -dC \"الإمارات\" --font-family \"Cairo\"\n```\n\n**Note**: Fonts are automatically downloaded from Google Fonts and cached locally in `fonts\u002Fcache\u002F`.\n\n### Resolution Guide (300 DPI)\n\nUse these values for `-W` and `-H` to target specific resolutions:\n\n| Target | Resolution (px) | Inches (-W \u002F -H) |\n|--------|-----------------|------------------|\n| **Instagram Post** | 1080 x 1080 | 3.6 x 3.6 |\n| **Mobile Wallpaper** | 1080 x 1920 | 3.6 x 6.4 |\n| **HD Wallpaper** | 1920 x 1080 | 6.4 x 3.6 |\n| **4K Wallpaper** | 3840 x 2160 | 12.8 x 7.2 |\n| **A4 Print** | 2480 x 3508 | 8.3 x 11.7 |\n\n### Usage Examples\n\n#### Basic Examples\n\n```bash\n# Simple usage with default theme\npython create_map_poster.py -c \"Paris\" -C \"France\"\n\n# With custom theme and distance\npython create_map_poster.py -c \"New York\" -C \"USA\" -t noir -d 12000\n```\n\n#### Multilingual Examples (Non-Latin Scripts)\n\nDisplay city names in their native scripts:\n\n```bash\n# Japanese\npython create_map_poster.py -c \"Tokyo\" -C \"Japan\" -dc \"東京\" -dC \"日本\" --font-family \"Noto Sans JP\" -t japanese_ink\n\n# Korean\npython create_map_poster.py -c \"Seoul\" -C \"South Korea\" -dc \"서울\" -dC \"대한민국\" --font-family \"Noto Sans KR\" -t midnight_blue\n\n# Thai\npython create_map_poster.py -c \"Bangkok\" -C \"Thailand\" -dc \"กรุงเทพมหานคร\" -dC \"ประเทศไทย\" --font-family \"Noto Sans Thai\" -t sunset\n\n# Arabic\npython create_map_poster.py -c \"Dubai\" -C \"UAE\" -dc \"دبي\" -dC \"الإمارات\" --font-family \"Cairo\" -t terracotta\n\n# Chinese (Simplified)\npython create_map_poster.py -c \"Beijing\" -C \"China\" -dc \"北京\" -dC \"中国\" --font-family \"Noto Sans SC\"\n\n# Khmer\npython create_map_poster.py -c \"Phnom Penh\" -C \"Cambodia\" -dc \"ភ្នំពេញ\" -dC \"កម្ពុជា\" --font-family \"Noto Sans Khmer\"\n```\n\n#### Advanced Examples\n\n```bash\n# Iconic grid patterns\npython create_map_poster.py -c \"New York\" -C \"USA\" -t noir -d 12000           # Manhattan grid\npython create_map_poster.py -c \"Barcelona\" -C \"Spain\" -t warm_beige -d 8000   # Eixample district\n\n# Waterfront & canals\npython create_map_poster.py -c \"Venice\" -C \"Italy\" -t blueprint -d 4000       # Canal network\npython create_map_poster.py -c \"Amsterdam\" -C \"Netherlands\" -t ocean -d 6000  # Concentric canals\npython create_map_poster.py -c \"Dubai\" -C \"UAE\" -t midnight_blue -d 15000     # Palm & coastline\n\n# Radial patterns\npython create_map_poster.py -c \"Paris\" -C \"France\" -t pastel_dream -d 10000   # Haussmann boulevards\npython create_map_poster.py -c \"Moscow\" -C \"Russia\" -t noir -d 12000          # Ring roads\n\n# Organic old cities\npython create_map_poster.py -c \"Tokyo\" -C \"Japan\" -t japanese_ink -d 15000    # Dense organic streets\npython create_map_poster.py -c \"Marrakech\" -C \"Morocco\" -t terracotta -d 5000 # Medina maze\npython create_map_poster.py -c \"Rome\" -C \"Italy\" -t warm_beige -d 8000        # Ancient layout\n\n# Coastal cities\npython create_map_poster.py -c \"San Francisco\" -C \"USA\" -t sunset -d 10000    # Peninsula grid\npython create_map_poster.py -c \"Sydney\" -C \"Australia\" -t ocean -d 12000      # Harbor city\npython create_map_poster.py -c \"Mumbai\" -C \"India\" -t contrast_zones -d 18000 # Coastal peninsula\n\n# River cities\npython create_map_poster.py -c \"London\" -C \"UK\" -t noir -d 15000              # Thames curves\npython create_map_poster.py -c \"Budapest\" -C \"Hungary\" -t copper_patina -d 8000  # Danube split\n\n# Override center coordinates\npython create_map_poster.py --city \"New York\" --country \"USA\" -lat 40.776676 -long -73.971321 -t noir\n\n# List available themes\npython create_map_poster.py --list-themes\n\n# Generate posters for every theme\npython create_map_poster.py -c \"Tokyo\" -C \"Japan\" --all-themes\n```\n\n### Distance Guide\n\n| Distance | Best for |\n|----------|----------|\n| 4000-6000m | Small\u002Fdense cities (Venice, Amsterdam center) |\n| 8000-12000m | Medium cities, focused downtown (Paris, Barcelona) |\n| 15000-20000m | Large metros, full city view (Tokyo, Mumbai) |\n\n## Themes\n\n17 themes available in `themes\u002F` directory:\n\n| Theme | Style |\n|-------|-------|\n| `gradient_roads` | Smooth gradient shading |\n| `contrast_zones` | High contrast urban density |\n| `noir` | Pure black background, white roads |\n| `midnight_blue` | Navy background with gold roads |\n| `blueprint` | Architectural blueprint aesthetic |\n| `neon_cyberpunk` | Dark with electric pink\u002Fcyan |\n| `warm_beige` | Vintage sepia tones |\n| `pastel_dream` | Soft muted pastels |\n| `japanese_ink` | Minimalist ink wash style |\n| `emerald`      | Lush dark green aesthetic |\n| `forest` | Deep greens and sage |\n| `ocean` | Blues and teals for coastal cities |\n| `terracotta` | Mediterranean warmth |\n| `sunset` | Warm oranges and pinks |\n| `autumn` | Seasonal burnt oranges and reds |\n| `copper_patina` | Oxidized copper aesthetic |\n| `monochrome_blue` | Single blue color family |\n\n## Output\n\nPosters are saved to `posters\u002F` directory with format:\n\n```text\n{city}_{theme}_{YYYYMMDD_HHMMSS}.png\n```\n\n## Adding Custom Themes\n\nCreate a JSON file in `themes\u002F` directory:\n\n```json\n{\n  \"name\": \"My Theme\",\n  \"description\": \"Description of the theme\",\n  \"bg\": \"#FFFFFF\",\n  \"text\": \"#000000\",\n  \"gradient_color\": \"#FFFFFF\",\n  \"water\": \"#C0C0C0\",\n  \"parks\": \"#F0F0F0\",\n  \"road_motorway\": \"#0A0A0A\",\n  \"road_primary\": \"#1A1A1A\",\n  \"road_secondary\": \"#2A2A2A\",\n  \"road_tertiary\": \"#3A3A3A\",\n  \"road_residential\": \"#4A4A4A\",\n  \"road_default\": \"#3A3A3A\"\n}\n```\n\n## Project Structure\n\n```text\nmap_poster\u002F\n├── create_map_poster.py    # Main script\n├── font_management.py      # Font loading and Google Fonts integration\n├── themes\u002F                 # Theme JSON files\n├── fonts\u002F                  # Font files\n│   ├── Roboto-*.ttf        # Default Roboto fonts\n│   └── cache\u002F              # Downloaded Google Fonts (auto-generated)\n├── posters\u002F                # Generated posters\n└── README.md\n```\n\n\n## Hacker's Guide\n\nQuick reference for contributors who want to extend or modify the script.\n\n### Contributors Guide\n\n- Bug fixes are welcomed\n- Don't submit user interface (web\u002Fdesktop)\n- Don't Dockerize for now\n- If you vibe code any fix please test it and see before and after version of poster\n- Before embarking on a big feature please ask in Discussions\u002FIssue if it will be merged\n\n### Architecture Overview\n\n```text\n┌─────────────────┐     ┌──────────────┐     ┌─────────────────┐\n│   CLI Parser    │────▶│  Geocoding   │────▶│  Data Fetching  │\n│   (argparse)    │     │  (Nominatim) │     │    (OSMnx)      │\n└─────────────────┘     └──────────────┘     └─────────────────┘\n                                                     │\n                        ┌──────────────┐             ▼\n                        │    Output    │◀────┌─────────────────┐\n                        │  (matplotlib)│     │   Rendering     │\n                        └──────────────┘     │  (matplotlib)   │\n                                             └─────────────────┘\n```\n\n### Key Functions\n\n| Function | Purpose | Modify when... |\n|----------|---------|----------------|\n| `get_coordinates()` | City → lat\u002Flon via Nominatim | Switching geocoding provider |\n| `create_poster()` | Main rendering pipeline | Adding new map layers |\n| `get_edge_colors_by_type()` | Road color by OSM highway tag | Changing road styling |\n| `get_edge_widths_by_type()` | Road width by importance | Adjusting line weights |\n| `create_gradient_fade()` | Top\u002Fbottom fade effect | Modifying gradient overlay |\n| `load_theme()` | JSON theme → dict | Adding new theme properties |\n| `is_latin_script()` | Detects script for typography | Supporting new scripts |\n| `load_fonts()` | Load custom\u002Fdefault fonts | Changing font loading logic |\n\n### Rendering Layers (z-order)\n\n```text\nz=11  Text labels (city, country, coords)\nz=10  Gradient fades (top & bottom)\nz=3   Roads (via ox.plot_graph)\nz=2   Parks (green polygons)\nz=1   Water (blue polygons)\nz=0   Background color\n```\n\n### OSM Highway Types → Road Hierarchy\n\n```python\n# In get_edge_colors_by_type() and get_edge_widths_by_type()\nmotorway, motorway_link     → Thickest (1.2), darkest\ntrunk, primary              → Thick (1.0)\nsecondary                   → Medium (0.8)\ntertiary                    → Thin (0.6)\nresidential, living_street  → Thinnest (0.4), lightest\n```\n\n### Typography & Script Detection\n\nThe script automatically detects text scripts to apply appropriate typography:\n\n- **Latin scripts** (English, French, Spanish, etc.): Letter spacing applied for elegant \"P  A  R  I  S\" effect\n- **Non-Latin scripts** (Japanese, Arabic, Thai, Korean, etc.): Natural spacing for \"東京\" (no gaps between characters)\n\nScript detection uses Unicode ranges (U+0000-U+024F for Latin). If >80% of alphabetic characters are Latin, spacing is applied.\n\n### Adding New Features\n\n**New map layer (e.g., railways):**\n\n```python\n# In create_poster(), after parks fetch:\ntry:\n    railways = ox.features_from_point(point, tags={'railway': 'rail'}, dist=dist)\nexcept:\n    railways = None\n\n# Then plot before roads:\nif railways is not None and not railways.empty:\n    railways = railways.to_crs(g_proj.graph[\"crs\"])\n    railways.plot(ax=ax, color=THEME['railway'], linewidth=0.5, zorder=2.5)\n```\n\n**New theme property:**\n\n1. Add to theme JSON: `\"railway\": \"#FF0000\"`\n2. Use in code: `THEME['railway']`\n3. Add fallback in `load_theme()` default dict\n\n### Typography Positioning\n\nAll text uses `transform=ax.transAxes` (0-1 normalized coordinates):\n\n```text\ny=0.14  City name (spaced letters for Latin scripts)\ny=0.125 Decorative line\ny=0.10  Country name\ny=0.07  Coordinates\ny=0.02  Attribution (bottom-right)\n```\n\n### Useful OSMnx Patterns\n\n```python\n# Get all buildings\nbuildings = ox.features_from_point(point, tags={'building': True}, dist=dist)\n\n# Get specific amenities\ncafes = ox.features_from_point(point, tags={'amenity': 'cafe'}, dist=dist)\n\n# Different network types\nG = ox.graph_from_point(point, dist=dist, network_type='drive')  # roads only\nG = ox.graph_from_point(point, dist=dist, network_type='bike')   # bike paths\nG = ox.graph_from_point(point, dist=dist, network_type='walk')   # pedestrian\n```\n\n### Performance Tips\n\n- Large `dist` values (>20km) = slow downloads + memory heavy\n- Cache coordinates locally to avoid Nominatim rate limits\n- Use `network_type='drive'` instead of `'all'` for faster renders\n- Reduce `dpi` from 300 to 150 for quick previews\n","MapToPoster 是一个可以将你喜爱的城市转化为美丽极简风格设计图的工具。该项目利用 Python 语言，结合 OpenStreetMap 和 OSMnx 等开源库，支持用户自定义地图样式和主题，生成具有视觉冲击力的地图海报，并且提供了多种预设主题如日落、赛博朋克等。适用于需要个性化城市地图装饰品的设计爱好者或专业设计师，也适合于教育场景中教授地理知识时使用，帮助学生以更直观的方式了解不同城市的布局特色。",2,"2026-06-11 03:48:12","high_star"]