Update README, notebook, and images from CI

This commit is contained in:
github-actions[bot]
2025-08-31 15:07:32 +00:00
parent 74ebf5fa8d
commit ba59f1f291
12 changed files with 261 additions and 299 deletions

254
README.md
View File

@@ -4,7 +4,7 @@ A minimal Python library to draw customized maps from [OpenStreetMap](https://ww
![](https://github.com/marceloprates/prettymaps/raw/main/pictures/heerhugowaard.png)
# [![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue?logo=github)](https://marceloprates.github.io/prettymaps/) [![PyPI](https://img.shields.io/pypi/v/prettymaps)](https://pypi.org/project/prettymaps/) [![Python](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org/) [![License](https://img.shields.io/badge/license-AGPL%20v3.0-green)](LICENSE)
# [![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue?logo=github)](https://marceloprates.github.io/prettymaps/) [![PyPI](https://img.shields.io/pypi/v/prettymaps)](https://pypi.org/project/prettymaps/) [![Python](https://img.shields.io/badge/python-3.12%2B-blue)](https://www.python.org/) [![License](https://img.shields.io/badge/license-AGPL%20v3.0-green)](LICENSE)
This work is [licensed](LICENSE) under a GNU Affero General Public License v3.0 (you can make commercial use, distribute and modify this project, but must **disclose** the source code with the license and copyright notice)
@@ -71,7 +71,7 @@ import prettymaps
plot = prettymaps.plot('Stad van de Zon, Heerhugowaard, Netherlands')
```
Fetching geodataframes took 13.14 seconds
Fetching geodataframes took 14.43 seconds
@@ -94,7 +94,7 @@ plot = prettymaps.plot(
)
```
Fetching geodataframes took 4.78 seconds
Fetching geodataframes took 5.48 seconds
@@ -212,7 +212,7 @@ prettymaps.preset('default')
Preset(params={'layers': {'perimeter': {}, 'streets': {'width': {'motorway': 5, 'trunk': 5, 'primary': 4.5, 'secondary': 4, 'tertiary': 3.5, 'cycleway': 3.5, 'residential': 3, 'service': 2, 'unclassified': 2, 'pedestrian': 2, 'footway': 1}}, 'waterway': {'tags': {'waterway': ['river', 'stream']}, 'width': {'river': 20, 'stream': 10}}, 'building': {'tags': {'building': True, 'landuse': 'construction'}}, 'water': {'tags': {'natural': ['water', 'bay']}}, 'sea': {}, 'forest': {'tags': {'landuse': 'forest'}}, 'green': {'tags': {'landuse': ['grass', 'orchard'], 'natural': ['island', 'wood', 'wetland'], 'leisure': 'park'}}, 'rock': {'tags': {'natural': 'bare_rock'}}, 'beach': {'tags': {'natural': 'beach'}}, 'parking': {'tags': {'amenity': 'parking', 'highway': 'pedestrian', 'man_made': 'pier'}}}, 'style': {'perimeter': {'fill': False, 'lw': 0, 'zorder': 0}, 'background': {'fc': '#F2F4CB', 'zorder': -1}, 'green': {'fc': '#8BB174', 'ec': '#2F3737', 'hatch_c': '#A7C497', 'hatch': 'ooo...', 'lw': 1, 'zorder': 1}, 'forest': {'fc': '#64B96A', 'ec': '#2F3737', 'lw': 1, 'zorder': 2}, 'water': {'fc': '#a8e1e6', 'ec': '#2F3737', 'hatch_c': '#9bc3d4', 'hatch': 'ooo...', 'lw': 1, 'zorder': 99}, 'sea': {'fc': '#a8e1e6', 'ec': '#2F3737', 'hatch_c': '#9bc3d4', 'hatch': 'ooo...', 'lw': 1, 'zorder': 99}, 'waterway': {'fc': '#a8e1e6', 'ec': '#2F3737', 'hatch_c': '#9bc3d4', 'hatch': 'ooo...', 'lw': 1, 'zorder': 200}, 'beach': {'fc': '#FCE19C', 'ec': '#2F3737', 'hatch_c': '#d4d196', 'hatch': 'ooo...', 'lw': 1, 'zorder': 3}, 'parking': {'fc': '#F2F4CB', 'ec': '#2F3737', 'lw': 1, 'zorder': 3}, 'streets': {'fc': '#2F3737', 'ec': '#475657', 'alpha': 1, 'lw': 0, 'zorder': 4}, 'building': {'palette': ['#433633', '#FF5E5B'], 'ec': '#2F3737', 'lw': 0.5, 'zorder': 5}, 'rock': {'fc': '#BDC0BA', 'ec': '#2F3737', 'lw': 1, 'zorder': 6}}, 'circle': None, 'radius': 500})
Preset(params={'layers': {'perimeter': {}, 'streets': {'width': {'motorway': 5, 'trunk': 5, 'primary': 4.5, 'secondary': 4, 'tertiary': 3.5, 'cycleway': 3.5, 'residential': 3, 'service': 2, 'unclassified': 2, 'pedestrian': 2, 'footway': 1}}, 'waterway': {'tags': {'waterway': ['river', 'stream']}, 'width': {'river': 20, 'stream': 10}}, 'building': {'tags': {'building': True, 'landuse': 'construction'}}, 'water': {'tags': {'natural': ['water', 'bay']}}, 'sea': {}, 'forest': {'tags': {'landuse': 'forest'}}, 'green': {'tags': {'landuse': ['grass', 'orchard'], 'natural': ['island', 'wood', 'wetland'], 'leisure': ['dog_park', 'disc_golf_course', 'garden', 'golf_course', 'park', 'pitch', 'sports_centre', 'track']}}, 'rock': {'tags': {'natural': 'bare_rock'}}, 'beach': {'tags': {'natural': 'beach'}}, 'parking': {'tags': {'amenity': 'parking', 'highway': 'pedestrian', 'man_made': 'pier'}}}, 'style': {'perimeter': {'fill': False, 'lw': 0, 'zorder': 0}, 'background': {'fc': '#F2F4CB', 'zorder': -1}, 'green': {'fc': '#8BB174', 'ec': '#2F3737', 'hatch_c': '#A7C497', 'hatch': 'ooo...', 'lw': 1, 'zorder': 1}, 'forest': {'fc': '#64B96A', 'ec': '#2F3737', 'lw': 1, 'zorder': 2}, 'water': {'fc': '#a8e1e6', 'ec': '#2F3737', 'hatch_c': '#9bc3d4', 'hatch': 'ooo...', 'lw': 1, 'zorder': 99}, 'sea': {'fc': '#a8e1e6', 'ec': '#2F3737', 'hatch_c': '#9bc3d4', 'hatch': 'ooo...', 'lw': 1, 'zorder': 99}, 'waterway': {'fc': '#a8e1e6', 'ec': '#2F3737', 'hatch_c': '#9bc3d4', 'hatch': 'ooo...', 'lw': 1, 'zorder': 200}, 'beach': {'fc': '#FCE19C', 'ec': '#2F3737', 'hatch_c': '#d4d196', 'hatch': 'ooo...', 'lw': 1, 'zorder': 3}, 'parking': {'fc': '#F2F4CB', 'ec': '#2F3737', 'lw': 1, 'zorder': 3}, 'streets': {'fc': '#2F3737', 'ec': '#475657', 'alpha': 1, 'lw': 0, 'zorder': 4}, 'building': {'palette': ['#433633', '#FF5E5B'], 'ec': '#2F3737', 'lw': 0.5, 'zorder': 5}, 'rock': {'fc': '#BDC0BA', 'ec': '#2F3737', 'lw': 1, 'zorder': 6}}, 'circle': None, 'radius': 500})
@@ -369,7 +369,7 @@ plot = prettymaps.plot(
)
```
Fetching geodataframes took 27.07 seconds
Fetching geodataframes took 20.74 seconds
@@ -393,7 +393,7 @@ plot = prettymaps.plot(
)
```
Fetching geodataframes took 11.25 seconds
Fetching geodataframes took 14.80 seconds
@@ -413,7 +413,7 @@ plot = prettymaps.plot('Centro Histórico, Porto Alegre', show = False)
plot.geodataframes['building']
```
Fetching geodataframes took 12.99 seconds
Fetching geodataframes took 14.56 seconds
@@ -446,16 +446,16 @@ plot.geodataframes['building']
<th>amenity</th>
<th>operator</th>
<th>website</th>
<th>historic</th>
<th>check_date</th>
<th>...</th>
<th>contact:website</th>
<th>payment:lightning_contactless</th>
<th>payment:onchain</th>
<th>bus</th>
<th>smoothness</th>
<th>inscription</th>
<th>ways</th>
<th>type</th>
<th>boat</th>
<th>name:fr</th>
<th>type</th>
<th>building:part</th>
<th>architect</th>
</tr>
@@ -463,7 +463,7 @@ plot.geodataframes['building']
<tbody>
<tr>
<th>(node, 2407915698)</th>
<td>POINT (-51.23212 -30.03670)</td>
<td>POINT (-51.23212 -30.0367)</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
@@ -486,14 +486,62 @@ plot.geodataframes['building']
<td>NaN</td>
</tr>
<tr>
<th>(way, 126665330)</th>
<td>POLYGON ((-51.23518 -30.03275, -51.23512 -30.0...</td>
<th>(relation, 2798271)</th>
<td>POLYGON ((-51.23097 -30.03377, -51.2309 -30.03...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>387</td>
<td>NaN</td>
<td>Praça Marechal Deodoro</td>
<td>NaN</td>
<td>NaN</td>
<td>https://www.estado.rs.gov.br/</td>
<td>NaN</td>
<td>...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>multipolygon</td>
<td>NaN</td>
<td>Palais Piratini</td>
<td>NaN</td>
<td>NaN</td>
</tr>
<tr>
<th>(relation, 2895718)</th>
<td>POLYGON ((-51.23445 -30.03076, -51.23441 -30.0...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>736</td>
<td>Rua dos Andradas</td>
<td>place_of_worship</td>
<td>arts_centre</td>
<td>NaN</td>
<td>https://www.ccmq.com.br/</td>
<td>NaN</td>
<td>...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>multipolygon</td>
<td>NaN</td>
<td>NaN</td>
<td>no</td>
<td>NaN</td>
</tr>
<tr>
<th>(relation, 3532262)</th>
<td>POLYGON ((-51.22935 -30.03693, -51.22923 -30.0...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
@@ -503,23 +551,23 @@ plot.geodataframes['building']
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>multipolygon</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
</tr>
<tr>
<th>(way, 126665331)</th>
<td>POLYGON ((-51.23167 -30.03066, -51.23160 -30.0...</td>
<th>(relation, 3532263)</th>
<td>POLYGON ((-51.22916 -30.037, -51.22903 -30.036...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>1001</td>
<td>Rua dos Andradas</td>
<td>NaN</td>
<td>NaN</td>
<td>https://www.ruadapraiashopping.com.br/</td>
<td>parking</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>...</td>
<td>NaN</td>
@@ -527,55 +575,7 @@ plot.geodataframes['building']
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
</tr>
<tr>
<th>(way, 129176990)</th>
<td>POLYGON ((-51.23117 -30.02891, -51.23120 -30.0...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>1020</td>
<td>Rua 7 de Setembro</td>
<td>NaN</td>
<td>NaN</td>
<td>http://www.memorial.rs.gov.br</td>
<td>NaN</td>
<td>...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
</tr>
<tr>
<th>(way, 129176991)</th>
<td>POLYGON ((-51.23153 -30.02914, -51.23156 -30.0...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>Praça da Alfândega</td>
<td>NaN</td>
<td>NaN</td>
<td>https://www.margs.rs.gov.br/</td>
<td>NaN</td>
<td>...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>multipolygon</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
@@ -606,8 +606,8 @@ plot.geodataframes['building']
<td>...</td>
</tr>
<tr>
<th>(relation, 6760281)</th>
<td>POLYGON ((-51.23238 -30.03337, -51.23223 -30.0...</td>
<th>(way, 1082776706)</th>
<td>POLYGON ((-51.22975 -30.02912, -51.22974 -30.0...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
@@ -622,16 +622,16 @@ plot.geodataframes['building']
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>[457506887, 457506886]</td>
<td>NaN</td>
<td>NaN</td>
<td>multipolygon</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
</tr>
<tr>
<th>(relation, 6760282)</th>
<td>POLYGON ((-51.23203 -30.03340, -51.23203 -30.0...</td>
<th>(way, 1082776707)</th>
<td>POLYGON ((-51.22992 -30.02954, -51.22987 -30.0...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
@@ -646,16 +646,16 @@ plot.geodataframes['building']
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>[457506875, 457506889, 457506888]</td>
<td>NaN</td>
<td>NaN</td>
<td>multipolygon</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
</tr>
<tr>
<th>(relation, 6760283)</th>
<td>POLYGON ((-51.23284 -30.03367, -51.23288 -30.0...</td>
<th>(way, 1082787655)</th>
<td>POLYGON ((-51.22601 -30.03038, -51.22602 -30.0...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
@@ -670,64 +670,64 @@ plot.geodataframes['building']
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>[457506897, 457506896]</td>
<td>NaN</td>
<td>NaN</td>
<td>multipolygon</td>
<td>NaN</td>
<td>Theodor Wiederspahn</td>
</tr>
<tr>
<th>(relation, 6760284)</th>
<td>POLYGON ((-51.23499 -30.03412, -51.23498 -30.0...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>[457506910, 457506913]</td>
<td>NaN</td>
<td>NaN</td>
<td>multipolygon</td>
<td>NaN</td>
<td>NaN</td>
</tr>
<tr>
<th>(relation, 14393526)</th>
<td>POLYGON ((-51.23125 -30.02813, -51.23128 -30.0...</td>
<th>(way, 1354523569)</th>
<td>POLYGON ((-51.23248 -30.03341, -51.23244 -30.0...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>1044</td>
<td>Rua Siqueira Campos</td>
<td>NaN</td>
<td>NaN</td>
<td>https://www.sefaz.rs.gov.br</td>
<td>pharmacy</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>[236213286, 1081974882]</td>
<td>NaN</td>
<td>NaN</td>
<td>multipolygon</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
</tr>
<tr>
<th>(way, 1423336172)</th>
<td>POLYGON ((-51.23399 -30.03092, -51.23389 -30.0...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>788</td>
<td>Rua dos Andradas</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>...</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
<td>NaN</td>
</tr>
</tbody>
</table>
<p>2420 rows × 167 columns</p>
<p>2415 rows × 137 columns</p>
</div>
@@ -741,7 +741,7 @@ plot.geodataframes['building'][
].geometry[0]
```
/opt/hostedtoolcache/Python/3.11.13/x64/lib/python3.11/site-packages/geopandas/geoseries.py:648: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
/opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/geopandas/geoseries.py:772: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
val = getattr(super(), mtd)(*args, **kwargs)
@@ -768,7 +768,7 @@ plot = prettymaps.plot('Porto Alegre', show = False)
# Get list of buildings from plot's geodataframes dict
buildings = plot.geodataframes['building']
# Project from lat / long
buildings = ox.project_gdf(buildings)
buildings = ox.projection.project_gdf(buildings)
buildings = [b for b in buildings.geometry if b.area > 0]
# Draw Matplotlib mosaic of n x n building footprints
@@ -788,7 +788,7 @@ for ax,building in zip(np.concatenate(axes),buildings):
ax.autoscale(); ax.axis('off'); ax.axis('equal')
```
Fetching geodataframes took 12.91 seconds
Fetching geodataframes took 16.54 seconds
@@ -819,7 +819,7 @@ _ = plot.ax.set_title(
)
```
Fetching geodataframes took 12.92 seconds
Fetching geodataframes took 12.52 seconds
Use **plotter** mode to export a pen plotter-compatible SVG (thanks to abey79's amazing [vsketch](https://github.com/abey79/vsketch) library)
@@ -838,7 +838,7 @@ plot = prettymaps.plot(
)
```
Fetching geodataframes took 3.91 seconds
Fetching geodataframes took 4.82 seconds
@@ -862,7 +862,7 @@ plot = prettymaps.plot(
)
```
Fetching geodataframes took 27.11 seconds
Fetching geodataframes took 23.53 seconds
@@ -963,13 +963,13 @@ plot = prettymaps.multiplot(
)
```
Fetching geodataframes took 8.20 seconds
Fetching geodataframes took 8.95 seconds
Fetching geodataframes took 6.59 seconds
Fetching geodataframes took 7.03 seconds
Fetching geodataframes took 8.09 seconds
Fetching geodataframes took 8.45 seconds
@@ -997,7 +997,7 @@ plot = prettymaps.plot(
)
```
Fetching geodataframes took 47.61 seconds
Fetching geodataframes took 37.53 seconds
make: Entering directory '/home/runner/work/prettymaps/prettymaps/notebooks/SRTM1'
@@ -1014,11 +1014,11 @@ plot = prettymaps.plot(
gdalbuildvrt -q -overwrite SRTM1.vrt cache/N21/N21W158.tif
make: Leaving directory '/home/runner/work/prettymaps/prettymaps/notebooks/SRTM1'
make: Entering directory '/home/runner/work/prettymaps/prettymaps/notebooks/SRTM1'
cp SRTM1.vrt SRTM1.65e8f0bb4b43451a865dc35dca4158a5.vrt
cp SRTM1.vrt SRTM1.3faa36cc8cab4dfda9edabe3b5a4ddc1.vrt
make: Leaving directory '/home/runner/work/prettymaps/prettymaps/notebooks/SRTM1'
make: Entering directory '/home/runner/work/prettymaps/prettymaps/notebooks/SRTM1'
gdal_translate -q -co TILED=YES -co COMPRESS=DEFLATE -co ZLEVEL=9 -co PREDICTOR=2 -projwin -157.90125854957773 21.364471426268267 -157.81006761682832 21.244615177105388 SRTM1.65e8f0bb4b43451a865dc35dca4158a5.vrt /home/runner/work/prettymaps/prettymaps/notebooks/elevation.tif
rm -f SRTM1.65e8f0bb4b43451a865dc35dca4158a5.vrt
gdal_translate -q -co TILED=YES -co COMPRESS=DEFLATE -co ZLEVEL=9 -co PREDICTOR=2 -projwin -157.90125854957773 21.364471426268267 -157.81006761682832 21.244615177105388 SRTM1.3faa36cc8cab4dfda9edabe3b5a4ddc1.vrt /home/runner/work/prettymaps/prettymaps/notebooks/elevation.tif
rm -f SRTM1.3faa36cc8cab4dfda9edabe3b5a4ddc1.vrt
make: Leaving directory '/home/runner/work/prettymaps/prettymaps/notebooks/SRTM1'
@@ -1052,7 +1052,7 @@ plot = prettymaps.plot(
)
```
Fetching geodataframes took 17.57 seconds
Fetching geodataframes took 17.09 seconds

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 779 KiB

After

Width:  |  Height:  |  Size: 782 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 MiB

After

Width:  |  Height:  |  Size: 6.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB