A minimal Python library to draw customized maps from OpenStreetMap data

prettymaps

A minimal Python library to draw customized maps from OpenStreetMap data.

Based on osmnx, matplotlib, shapely and vsketch libraries.

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
# Init matplotlib figure
fig, ax = plt.subplots(figsize = (12, 12), constrained_layout = True)

backup = plot(
# Address:
'Praça 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,

 

 

 

To finish reading, please visit source site