Skip to content

Welcome to qgis-map

image image

A Python library that provides a high-level, leafmap-like API for working with PyQGIS

Overview

qgis-map is designed to make working with QGIS in Python easier and more intuitive. Inspired by the popular leafmap library, it provides a simple, high-level API for common GIS operations within QGIS.

Key Features

  • High-level API: Simple, intuitive methods for common operations
  • Basemap support: Easy access to OpenStreetMap, Esri, Google, CartoDB, and more
  • Vector layers: Add shapefiles, GeoJSON, GeoPackage, and other formats
  • Raster layers: Add GeoTIFFs, COGs, and apply color ramps
  • Time slider: Create interactive time-based visualizations
  • Dockable panels: Create custom interactive panels in QGIS
  • Map export: Export maps to images

Quick Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
from qgis_map import Map

# Create a map with OpenStreetMap basemap
m = Map(basemap="OpenStreetMap")

# Add vector data
m.add_vector("cities.geojson", layer_name="Cities", zoom_to_layer=True)

# Add raster with color ramp
m.add_raster("elevation.tif", colormap="terrain", layer_name="DEM")

# Create a time slider for temporal data
m.add_time_slider(layers={
    "2020": "data_2020.tif",
    "2021": "data_2021.tif",
    "2022": "data_2022.tif"
})

Credits

This package was inspired by leafmap and is built on PyQGIS.