ランキングに戻る

chrieke/prettymapp

Python

🖼️ Create beautiful maps from OpenStreetMap data in a streamlit webapp

osmmapgeographycartographyartappstreamlitprettymaps
スター成長
スター
2.8k
フォーク
457
週間成長
Issue
3
1k2k
2022年4月2023年9月2025年2月2026年7月
成果物PyPIpip install prettymapp
README

prettymapp 🖼️

Prettymapp is a webapp and Python package to create beautiful maps from OpenStreetMap data


🎈 Try it out here: prettymapp on streamlit 🎈



Based on the prettymaps project

Prettymapp is based on a rewrite of the fantastic prettymaps project by @marceloprates. All credit for the original idea, designs and implementation go to him. The prettymapp rewrite focuses on speed and adapted configuration to interface with the webapp. It drops more complex configuration options in favour of improved speed, reduced code complexity and simplified configuration interfaces. It is partially tested and adds a streamlit webapp component.

Running the app locally

You can use the webapp directly under prettymapp.streamlit.app or run it locally via:

git clone https://github.com/chrieke/prettymapp.git
cd prettymapp
uv sync --extra streamlit
uv run streamlit run streamlit-prettymapp/app.py

Python package

You can also use prettymapp without the webapp, directly in Python. This lets you customize the functionality or build your own application.

Installation:

pip install prettymapp

Define the area, download and plot the OSM data:

You can select from 4 predefined styles: Peach, Auburn, Citrus and Flannel.

from prettymapp.geo import get_aoi
from prettymapp.osm import get_osm_geometries
from prettymapp.plotting import Plot
from prettymapp.settings import STYLES

aoi = get_aoi(address="Praça Ferreira do Amaral, Macau", radius=1100, rectangular=False)
df = get_osm_geometries(aoi=aoi)

fig = Plot(
    df=df,
    aoi_bounds=aoi.bounds,
    draw_settings=STYLES["Peach"],
).plot_all()

fig.savefig("map.jpg")

You can also plot exported OSM XML files e.g. from openstreetmap.org:

from prettymapp.osm import get_osm_geometries_from_xml

df = get_osm_geometries_from_xml(filepath="Berlin.osm")
aoi_bounds = df.total_bounds
...

Customize styles & layers

Edit the draw_settings input to create your own custom styles! The map layout can be further customized with the additional arguments of the Plot class (e.g. shape, contour_width etc.). Check the webapp examples for inspiration.

from prettymapp.settings import STYLES

custom_style = STYLES["Peach"].copy()
custom_style["urban"] = {
    "cmap": ["#3452eb"],
    "ec": "#E9724C",
    "lw": 0.2,
    "zorder": 4,
}

fig = Plot(
    df=df,
    aoi_bounds=aoi.bounds,
    draw_settings=custom_style,
    shape="circle",
    contour_width=0,
).plot_all()

You can also customize the selection of OSM landcover classes that should be displayed! Customize the default settings or create your own dictionary! See settings.py for the defaults.

from prettymapp.settings import LANDCOVER_CLASSES

custom_lc_classes = LANDCOVER_CLASSES.copy()
custom_lc_classes["urban"] = {"building": False} # drops all building subclasses
custom_lc_classes["grassland"] = {
    "leisure": True,  # Include all leisure subclasses
    "natural": ["island"],  # Selects only specific natural subclasses
}

df = get_osm_geometries(aoi=aoi, landcover_classes=custom_lc_classes)
関連リポジトリ
louis-e/arnis

Generate any location from the real world in Minecraft with a high level of detail.

Rustcrates.ioApache License 2.0minecraftopenstreetmap
arnismc.com
17.1k1.4k
Project-OSRM/osrm-backend

Open Source Routing Machine - C++ backend

C++BSD 2-Clause "Simplified" Licenseosrmcpp
discord.gg/CpWzBC9G7Z
7.9k4k
gboeing/osmnx

Download, model, analyze, and visualize street networks and other geospatial features from OpenStreetMap.

PythonPyPIMIT Licenseopenstreetmapgis
osmnx.readthedocs.io
5.8k881
hyperknot/openfreemap

Free and open-source map hosting solution with custom styles for websites and apps, using OpenStreetMap data

PythonPyPIOthermaplibremaplibre-gl-js
openfreemap.org
5.7k175
streetcomplete/StreetComplete

Easy to use OpenStreetMap editor for Android

KotlinGNU General Public License v3.0openstreetmapandroid
streetcomplete.app
4.7k434
osm-search/Nominatim

Open Source search based on OpenStreetMap data

PythonPyPIGNU General Public License v3.0openstreetmapgeocoding
nominatim.org
4.4k845
tilemill-project/tilemill

TileMill is a modern map design studio

JavaScriptnpmBSD 3-Clause "New" or "Revised" Licensetilemillmapbox
tilemill-project.github.io/tilemill/
3.2k520
geoman-io/leaflet-geoman

🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers

JavaScriptnpmMIT Licenseleaflet-pluginleaflet
geoman.io
2.4k443
onthegomap/planetiler

Flexible tool to build planet-scale vector tilesets from OpenStreetMap data fast

JavaMavenApache License 2.0vector-tilesopenstreetmap
2.1k187
vvoovv/blosm

Blosm addon for Blender. A few clicks import of Google 3D cities, OpenStreetMap, terrain. Global coverage. Source code is in the branch 'release'.

blenderosm
2.1k217
GIScience/openrouteservice

🌍 The open source route planner api with plenty of features.

JavaMavenGNU General Public License v3.0directions-apirouting-engine
openrouteservice.org
1.9k477
Mapsui/Mapsui

Mapsui is a .NET Map component for: MAUI, Avalonia, Uno Platform, Blazor, WPF, WinUI, Windows Forms, Eto Forms, .NET for Android and .NET for iOS

C#MIT Licensemapgis
mapsui.com
1.6k356