Note
Click here to download the full example code
Add a Natural Earth background¶
An alternative to Google Static Maps
Out:
/home/docs/checkouts/readthedocs.org/user_builds/salem/conda/v0.3.6/lib/python3.8/site-packages/descartes/patch.py:62: ShapelyDeprecationWarning: The array interface is deprecated and will no longer work in Shapely 2.0. Convert the '.coords' to a numpy array instead.
vertices = concatenate([
/home/docs/checkouts/readthedocs.org/user_builds/salem/conda/v0.3.6/lib/python3.8/site-packages/descartes/patch.py:64: ShapelyDeprecationWarning: The array interface is deprecated and will no longer work in Shapely 2.0. Convert the '.coords' to a numpy array instead.
[asarray(r)[:, :2] for r in t.interiors])
import salem
import matplotlib.pyplot as plt
# get the map from a predefined grid
grid = salem.mercator_grid(transverse=False, center_ll=(16., 0.),
extent=(8e6, 9e6))
smap = salem.Map(grid)
# Add the background (other resolutions include: 'mr', 'hr')
smap.set_rgb(natural_earth='lr')
# done!
smap.visualize()
plt.show()
Total running time of the script: ( 0 minutes 2.743 seconds)