https://github.com/marceloprates/prettymaps Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} marceloprates / prettymaps * Notifications * Star 3.5k * Fork 101 A small set of Python functions to draw pretty maps from OpenStreetMap data. Based on osmnx, matplotlib and shapely libraries. MIT License 3.5k stars 101 forks Star Notifications * Code * Issues 8 * Pull requests 3 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 0 tags Code * Clone HTTPS GitHub CLI [https://github.com/m] Use Git or checkout with SVN using the web URL. [gh repo clone marcel] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @marceloprates marceloprates Added HN print to README ... b778dc9 Aug 26, 2021 Added HN print to README b778dc9 Git stats * 35 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time assets/Permanent_Marker Updated 'setup cell' to avoid errors with missing .ttf and /prints fo... Aug 26, 2021 notebooks Fixed yet another typo in examples.ipynb... Aug 26, 2021 prettymaps Added support for waterways and fetching by OSM Id Aug 25, 2021 prints Added HN print to README Aug 26, 2021 LICENSE Initial commit Mar 5, 2021 README.md Added HN print to README Aug 26, 2021 setup.py Updated setup.py Aug 24, 2021 View code [ ] prettymaps As seen on Hacker News: Google Colaboratory Demo Installation Usage example (For more examples, see this Jupyter Notebook): Gallery: Barcelona: Heerhugowaard: Barra da Tijuca: Porto Alegre: README.md prettymaps A minimal Python library to draw customized maps from OpenStreetMap data. Based on osmnx, matplotlib, shapely and vsketch libraries. As seen on Hacker News: [hackernews] Google Colaboratory Demo Open In Colab Installation Install with $ pip install git+https://github.com/abey79/vsketch#egg=vsketch $ pip install git+https://github.com/marceloprates/prettymaps.git Usage example (For more examples, see this Jupyter Notebook): # Init matplotlib figure fig, ax = plt.subplots(figsize = (12, 12), constrained_layout = True) backup = plot( # Address: 'Praca Ferreira do Amaral, Macau', # Plot geometries in a circle of radius: radius = 1100, # Matplotlib axis ax = ax, # Which OpenStreetMap layers to plot and their parameters: layers = { # Perimeter (in this case, a circle) 'perimeter': {}, # Streets and their widths 'streets': { 'width': { 'motorway': 5, 'trunk': 5, 'primary': 4.5, 'secondary': 4, 'tertiary': 3.5, 'residential': 3, 'service': 2, 'unclassified': 2, 'pedestrian': 2, 'footway': 1, } }, # Other layers: # Specify a name (for example, 'building') and which OpenStreetMap tags to fetch 'building': {'tags': {'building': True, 'landuse': 'construction'}, 'union': False}, 'water': {'tags': {'natural': ['water', 'bay']}}, 'green': {'tags': {'landuse': 'grass', 'natural': ['island', 'wood'], 'leisure': 'park'}}, 'forest': {'tags': {'landuse': 'forest'}}, 'parking': {'tags': {'amenity': 'parking', 'highway': 'pedestrian', 'man_made': 'pier'}} }, # drawing_kwargs: # Reference a name previously defined in the 'layers' argument and specify matplotlib parameters to draw it drawing_kwargs = { 'background': {'fc': '#F2F4CB', 'ec': '#dadbc1', 'hatch': 'ooo...', 'zorder': -1}, 'perimeter': {'fc': '#F2F4CB', 'ec': '#dadbc1', 'lw': 0, 'hatch': 'ooo...', 'zorder': 0}, 'green': {'fc': '#D0F1BF', 'ec': '#2F3737', 'lw': 1, 'zorder': 1}, 'forest': {'fc': '#64B96A', 'ec': '#2F3737', 'lw': 1, 'zorder': 1}, 'water': {'fc': '#a1e3ff', 'ec': '#2F3737', 'hatch': 'ooo...', 'hatch_c': '#85c9e6', 'lw': 1, 'zorder': 2}, 'parking': {'fc': '#F2F4CB', 'ec': '#2F3737', 'lw': 1, 'zorder': 3}, 'streets': {'fc': '#2F3737', 'ec': '#475657', 'alpha': 1, 'lw': 0, 'zorder': 3}, 'building': {'palette': ['#FFC857', '#E9724C', '#C5283D'], 'ec': '#2F3737', 'lw': .5, 'zorder': 4}, } ) [macao] Gallery: Barcelona: [barcelona] Heerhugowaard: [heerhugowa] Barra da Tijuca: [tijuca] Porto Alegre: [bomfim-far] About A small set of Python functions to draw pretty maps from OpenStreetMap data. Based on osmnx, matplotlib and shapely libraries. Topics python maps cartography openstreetmap jupyter-notebook generative-art matplotlib Resources Readme License MIT License Releases No releases published Packages 0 No packages published Contributors 2 * @marceloprates marceloprates Marcelo de Oliveira Rosa Prates * @mfbehrens99 mfbehrens99 Michael Behrens Languages * Jupyter Notebook 99.9% * Python 0.1% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.