.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_04_situation.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_plot_04_situation.py: Situation map (qualitative symbols) =================================== Located qualitative points, differentiated by category, with a zoom window on the dense Paris region. Data: hospital helipads in mainland France, distinguished by night-flight capability (data.gouv.fr, CC-BY). Hover a marker to read its name. .. GENERATED FROM PYTHON SOURCE LINES 11-71 .. raw:: html Guadeloupe Martinique French Guiana Reunion Mayotte 100 km Source: data.gouv.fr (CC-BY) Hospital helipads Night flight Day only Hospital helipads Night-flight capability .. code-block:: Python from pathlib import Path import geopandas as gpd import pandas as pd import mappyng as mp from mappyng.data import load_france_departments, load_europe europe = load_europe().to_crs(2154) deps = load_france_departments().to_crs(2154) df = pd.read_csv(Path("data") / "helistations.csv") points = gpd.GeoDataFrame( df, geometry=gpd.points_from_xy(df["longitude"], df["latitude"]), crs="EPSG:4326", ).to_crs(2154) BBOX_METRO = [90000, 6040000, 1280000, 7150000] OVERSEAS = { "Guadeloupe": [-6890454, 1780151, -6799589, 1874186], "Martinique": [-6826862, 1609607, -6759494, 1685367], "French Guiana": [-6136680, 235261, -5707791, 671780], "Reunion": [6136383, -2448160, 6226316, -2366992], "Mayotte": [5006226, -1459183, 5050208, -1416184], } insets = mp.Insets( [mp.Inset(name, bbox=bbox, crs=3857) for name, bbox in OVERSEAS.items()], spacing=15, title_size=7, border_radius=6, box_shadow=True, ) # Zoom on the Paris region (Lambert-93), where helipads are dense. zoom = mp.Zoom([586377, 6780533, 739396, 6904563], border_radius=8, box_shadow={"dx": 2, "dy": 2, "blur": 4, "opacity": 0.3}) m = ( mp.Map(europe, bbox=BBOX_METRO, width=900, height=1000, padding=25, facecolor="#e8eef2", border_radius=10) + insets + zoom + mp.Basemap() + mp.Vector(deps, stroke="#9aa6b2", stroke_width=0.2) + mp.DropShadow(europe, query="code_pays_iso3 == 'FRA'") + mp.Situation( points, column="vol_nuit", symbol={ "Night flight": {"marker": "circle", "fill": "#1f78b4", "size": 6}, "Day only": {"marker": "triangle", "fill": "#e31a1c", "size": 9}, }, legend=mp.Legend("Hospital helipads"), ) + mp.Title("Hospital helipads", subtitle="Night-flight capability") # Scale bar over the sea, in the Gulf of Lion. + mp.ScaleBar(length=100000, label="100 km", position=(0.55, 0.855), opacity=0.8) + mp.Source("Source: data.gouv.fr (CC-BY)") + mp.Tooltip(["nom", "vol_nuit"], aliases={"nom": "Site", "vol_nuit": "Capability"}) ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.273 seconds) .. _sphx_glr_download_gallery_plot_04_situation.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_04_situation.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_04_situation.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_04_situation.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_