Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ python create_map_poster.py --city <city> --country <country> [options]
| **OPTIONAL:** `--all-themes` | | Generate posters for all available themes | |
| **OPTIONAL:** `--width` | `-W` | Image width in inches | 12 (max: 20) |
| **OPTIONAL:** `--height` | `-H` | Image height in inches | 16 (max: 20) |
| **OPTIONAL:** `--no-text` | | Omit all text on poster | false |

### Multilingual Support - i18n

Expand Down
105 changes: 57 additions & 48 deletions create_map_poster.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ def create_poster(
display_city=None,
display_country=None,
fonts=None,
no_text=False,
):
"""
Generate a complete map poster with roads, water, parks, and typography.
Expand Down Expand Up @@ -681,57 +682,58 @@ def create_poster(
)

# --- BOTTOM TEXT ---
ax.text(
0.5,
0.14,
spaced_city,
transform=ax.transAxes,
color=THEME["text"],
ha="center",
fontproperties=font_main_adjusted,
zorder=11,
)

ax.text(
0.5,
0.10,
display_country.upper(),
transform=ax.transAxes,
color=THEME["text"],
ha="center",
fontproperties=font_sub,
zorder=11,
)
if not no_text:
ax.text(
0.5,
0.14,
spaced_city,
transform=ax.transAxes,
color=THEME["text"],
ha="center",
fontproperties=font_main_adjusted,
zorder=11,
)

lat, lon = point
coords = (
f"{lat:.4f}° N / {lon:.4f}° E"
if lat >= 0
else f"{abs(lat):.4f}° S / {lon:.4f}° E"
)
if lon < 0:
coords = coords.replace("E", "W")
ax.text(
0.5,
0.10,
display_country.upper(),
transform=ax.transAxes,
color=THEME["text"],
ha="center",
fontproperties=font_sub,
zorder=11,
)

ax.text(
0.5,
0.07,
coords,
transform=ax.transAxes,
color=THEME["text"],
alpha=0.7,
ha="center",
fontproperties=font_coords,
zorder=11,
)
lat, lon = point
coords = (
f"{lat:.4f}° N / {lon:.4f}° E"
if lat >= 0
else f"{abs(lat):.4f}° S / {lon:.4f}° E"
)
if lon < 0:
coords = coords.replace("E", "W")

ax.text(
0.5,
0.07,
coords,
transform=ax.transAxes,
color=THEME["text"],
alpha=0.7,
ha="center",
fontproperties=font_coords,
zorder=11,
)

ax.plot(
[0.4, 0.6],
[0.125, 0.125],
transform=ax.transAxes,
color=THEME["text"],
linewidth=1 * scale_factor,
zorder=11,
)
ax.plot(
[0.4, 0.6],
[0.125, 0.125],
transform=ax.transAxes,
color=THEME["text"],
linewidth=1 * scale_factor,
zorder=11,
)

# --- ATTRIBUTION (bottom right) ---
if FONTS:
Expand Down Expand Up @@ -955,6 +957,12 @@ def list_themes():
choices=["png", "svg", "pdf"],
help="Output format for the poster (default: png)",
)
parser.add_argument(
"--no-text",
action="store_true",
default=False,
help="Omit city name, country, and coordinates text from the poster",
)

args = parser.parse_args()

Expand Down Expand Up @@ -1037,6 +1045,7 @@ def list_themes():
display_city=args.display_city,
display_country=args.display_country,
fonts=custom_fonts,
no_text=args.no_text,
)

print("\n" + "=" * 50)
Expand Down