Working with shapefiles¶
This example demonstrates how to plot a shapefile directly from a file onto a map.
[1]:
!wget https://gisco-services.ec.europa.eu/distribution/v2/nuts/shp/NUTS_RG_20M_2021_4326_LEVL_0.shp.zip
[2]:
import earthkit.plots
chart = earthkit.plots.Map(domain="Europe")
chart.coastlines()
chart.shapes(
"NUTS_RG_20M_2021_4326_LEVL_0.shp.zip",
labels="NUTS_ID", # Label taken directly from shapefile metadata
adjust_labels=True,
)
chart.gridlines(draw_labels=False)
chart.title("Nomenclature of Territorial Units for Statistics (NUTS) Level 0")
chart.show()