Background Maps with Contextily

Discover what can be done Contextily in this lesson.

Introduction

Context in maps is fundamental to conveying spatial information effectively. In vector-based maps, this is particularly crucial. Vector maps, while offering precise geometric representations and attributes of geographic features, may sometimes seem abstract and difficult to interpret without a clear reference or background. This is where basemaps come in, serving as a visual aid to help users understand the geographical context in which these features exist. They provide familiar landmarks and elements, such as roads, water bodies, and administrative boundaries, that make the map more recognizable and easier to understand.

To fulfill this necessity, Contextily is a Python package that was specifically designed to add geographic context (i.e., basemaps) to static maps created with common Python geospatial libraries, such as GeoPandas and Matplotlib. It can be installed with pip through the following command:

Get hands-on with 1200+ tech skills courses.