Create custom-styled maps from OpenStreetMap data
You can adjust map colors and lines to create visually striking maps. This small Python library fetches real geographic data from OpenStreetMap and lets you style it as you wish. Without handling complex map engines, you can generate images that capture the unique atmosphere of a specific area with just a few lines of code.
Adjusting map layers and styles directly
This tool draws maps by dividing them into multiple layers. It loads each element from OpenStreetMap, such as water, buildings, and roads, separately, allowing you to specify colors and line thicknesses. For example, you can fill water with light blue and paint buildings with a warm color palette. It also supports loading default settings, cropping regions with circular boundaries, and expressing terrain shading. This process completes maps that emphasize visual beauty beyond simple location display.
Getting started and learning resources
Install it in your Python environment using the pip install prettymaps command. After installation, passing a region name to the prettymaps.plot function draws a default map. For deeper exploration, tutorials are available to run on Marmoset Notebook or Google Colab. These tutorials explain, with images, how to configure each map element, how to use predefined style presets, and how to arrange multiple maps on a single screen. A Streamlit-based frontend app is also provided, allowing you to experiment directly in the browser.
Attribution and prohibition of NFT use
Because this project uses OpenStreetMap data, generated map images must retain attribution to the repository and OpenStreetMap. This is a requirement of the OpenStreetMap license. Additionally, the author explicitly opposes use for NFT sales, citing environmental impact and the incentive structure for theft within the community. In the past, some projects used this tool to sell NFTs without providing attribution, which the author publicly criticized. Therefore, except for cases where you intend to use this tool in commercial NFT projects, commercial use, modification, and distribution are permitted as long as you comply with the attribution obligation.
License and pre-use checks
This repository follows the GNU Affero General Public License v3.0. This license permits commercial use and modification under the condition of source code disclosure. When generating maps, you must comply with OpenStreetMap data usage regulations, particularly ensuring that attribution within images is not omitted. Also, in line with the author's intent, use for the purpose of selling NFTs may be ethically problematic, so caution is required if you plan to use it for that purpose. You must have a Python environment and a network environment with access to OpenStreetMap data ready.