
CartoGo:
Artistic City Mapping
A high-performance Go implementation of the City Map Poster Generator. Generate beautiful, minimalist map posters for any city in the world with 1-to-1 aesthetic parity.

System Overview
CartoGo Overview
CartoGo is a high-performance Go implementation of the original City Map Poster Generator. It is designed for speed, reliability, and 1-to-1 aesthetic parity with the original Python project.
Project Vision
To generate beautiful, minimalist map posters for any city in the world, leveraging the concurrency and safety of the Go programming language.
Architecture
- Language: Go 1.25+
- Graphics:
gglibrary - Data: OpenStreetMap (Overpass API)
- Geocoding: Nominatim

Rendering Engine
High-Performance Rendering
At the heart of CartoGo lies a custom rendering engine built on top of the gg library. Optimized for 2D vector-like graphics operations in Go.
Key Features
- Z-Order Management: Layering ensures water bodies, parks, and roads render correctly.
- Alpha Blending: Custom
NRGBAgradient fades for the signature "fading edge" look. - Projection: Precision conversion from Lat/Lon to local meter-based coordinate systems.

High-Fidelity Type
Professional Typography
Typography is critical for the aesthetic. CartoGo includes an advanced text layout engine that handles city names and coordinates with professional elegance.
Features
- Dynamic Font Scaling: Automatically fits long city names to canvas width.
- Tracking: Applies elegant letter spacing to Latin scripts.
- DPI Scaling: Ensures point sizes match physical inches at 300 DPI.

OSM Data Pipeline
OpenStreetMap Data Pipeline
Fetching map data is handled by a specialized Overpass QL query engine.
Pipeline Steps
- Query Building: Dynamic BBox queries for roads, water, and greenery.
- Fetch & Retry: Robust handling of API timeouts and server load.
- Relation Processing: Complex multipolygon reconstruction for parks and lakes.

Binary Caching
High-Speed Binary Caching
Sub-second re-renders are achieved through a binary caching system using Go's gob format.
Optimization
- Binary Serialization: Near-instant disk I/O compared to JSON or XML.
- Nominatim Cache: Stores geocoding results locally to respect rate limits.
- Data Persistence: Map data remains cached for future artistic iterations.

Dynamic Scaling
Intelligent Radius Scaling
Maps aren't just squares. CartoGo implements dynamic radius compensation to ensure perfect framing.
The Compensation Algorithm
Calculates an optimal bounding box based on the physical aspect ratio (Width/Height) to ensure the city center peninsula or arterial roads aren't cropped awkwardly.

JSON Theme Engine
Modular JSON Themes
Separating data from design. CartoGo features a fully customizable JSON-based theme engine.
Theme Architecture
- JSON Definitions: Backgrounds, road weights, and hex colors.
- Built-in Styles: 17 curated themes (Noir, Terracotta, Cyberpunk, etc.).
- Extensibility: Add new artistic styles without modifying core rendering code.

Nominatim Integration
Geocoding Integration
Precise location targeting via the Nominatim API.
Features
- Structured Search: Targets specific cities and countries.
- Centroid Calculation: Uses geocoded coordinates as the map center.
- Radius Tuning: Allows users to zoom in or out from the geocoded point.

300 DPI Export
High-Resolution Print Export
Engineered for the physical world. Export high-fidelity posters ready for professional printing.
Print Specifications
- 300 DPI: Standard professional print resolution.
- Custom Dimensions: Support for any size (A4, A3, 18x24, etc.).
- Vector Parity: Ensures sharp lines and smooth gradients on large scales.

Go Concurrency
Concurrent Performance
Leveraging Go's Goroutines to accelerate the rendering pipeline.
Go vs Python
- Speed: Significant performance uplift over Matplotlib rendering.
- Type Safety: Reduces bugs in coordinate transformation.
- Distribution: Compiles to a single static binary for easy use.

Automation & CLI
Powerful CLI Automation
A tool for designers and developers alike. Fully automatable via command line.
Basic Usage
./CartoGo.exe -city "Sydney" -country "Australia"
Batch Processing
Easily scriptable to generate a collection of posters for entire countries or regions using simple shell loops.