Documentation Index
Fetch the complete documentation index at: https://mintlify.com/originalankur/maptoposter/llms.txt
Use this file to discover all available pages before exploring further.
create_poster()
Generate a complete map poster with roads, water, parks, and typography.City name for display on poster
Country name for display on poster
(latitude, longitude) tuple for map center
Map radius in meters (e.g., 4000-6000m for small cities, 15000-20000m for large metros)
Path where poster will be saved
File format: ‘png’, ‘svg’, or ‘pdf’
Poster width in inches (maximum: 20)
Poster height in inches (maximum: 20)
Optional override for country text displayed on poster
Optional override for city name (reserved for future use)
Custom display name for city (supports internationalization)
Custom display name for country (supports internationalization)
Custom font dictionary with ‘bold’, ‘regular’, ‘light’ keys mapping to font file paths. If None, uses default FONTS.
If street network data cannot be retrieved from OpenStreetMap
Display Name Priority
The function uses the following priority for display names:display_city/display_country(highest priority)name_label/country_labelcity/country(fallback)
Text Formatting
The function automatically handles different scripts:- Latin scripts: Applies uppercase and letter spacing (e.g., “P A R I S”)
- Non-Latin scripts (CJK, Arabic, Thai, etc.): Preserves case structure without spacing
get_coordinates()
Fetch coordinates for a given city and country using geopy geocoding service.City name to geocode
Country name to geocode
(latitude, longitude) tuple of floats
If coordinates cannot be found or geocoding fails
Caching Behavior
Coordinates are automatically cached using the key format:coords_{city.lower()}_{country.lower()}
If cached coordinates exist, they are returned immediately without making a network request.
load_theme()
Load a theme configuration from JSON file in the themes directory.Name of the theme file (without .json extension)
Theme dictionary containing all color configuration fields. See Theme Schema for complete field documentation.
Fallback Behavior
If the specified theme file is not found, the function:- Prints a warning message
- Returns the embedded terracotta theme as fallback
Theme Directory
Theme files must be located in:themes/{theme_name}.json
get_available_themes()
Scan the themes directory and return a list of available theme names.List of theme names (without .json extension), sorted alphabetically
Behavior
- Creates the themes directory if it doesn’t exist
- Returns empty list if no themes are found
- Only includes files with
.jsonextension
fetch_graph()
Fetch street network graph from OpenStreetMap using OSMnx.(latitude, longitude) tuple for center point
Distance in meters from center point
NetworkX MultiDiGraph of street network, or None if fetch fails
Caching
Graphs are cached using the key format:graph_{lat}_{lon}_{dist}
Rate Limiting
Includes automatic 0.5 second delay between requests to respect OpenStreetMap usage policies.fetch_features()
Fetch geographic features (water, parks, etc.) from OpenStreetMap.(latitude, longitude) tuple for center point
Distance in meters from center point
Dictionary of OSM tags to filter features (e.g.,
{"natural": ["water", "bay"], "waterway": "riverbank"})Name for this feature type (used for caching and logging)
GeoPandas GeoDataFrame of features, or None if fetch fails
Example Tags
Rate Limiting
Includes automatic 0.3 second delay between requests.Cache Functions
cache_get()
Retrieve a cached object by key.Cache key identifier
Cached object if found, None otherwise
If cache read operation fails
cache_set()
Store an object in the cache.Cache key identifier
Object to cache (must be picklable)
If cache write operation fails
Cache Directory
Cache files are stored in the directory specified by theCACHE_DIR environment variable, defaulting to ./cache/
Utility Functions
generate_output_filename()
Generate unique output filename with city, theme, and datetime.City name
Theme name
File extension (png, svg, pdf)
Full path to output file:
posters/{city_slug}_{theme_name}_{timestamp}.{ext}is_latin_script()
Check if text is primarily Latin script.Text to analyze
True if text is primarily Latin script (>80% of alphabetic characters), False otherwise
Latin Unicode Ranges
- Basic Latin: U+0000 to U+007F
- Latin-1 Supplement: U+0080 to U+00FF
- Latin Extended-A: U+0100 to U+017F
- Latin Extended-B: U+0180 to U+024F