Screengrid layer

The screengrid layer displays observations distribution as a colored grid with fixed-size cells.

Note

This visualization is highly sensitive to the current zoom level and extent. Small modifications of the view can lead to very different visual representations.

import polars as pl
from pylifemap import Lifemap

# Load iucn dataset
iucn = pl.read_csv(
    "https://raw.githubusercontent.com/Lifemap-ToL/pylifemap/main/data/iucn.csv"
)

(
    Lifemap(iucn)
    .layer_screengrid(opacity=0.5)
    .show()
)
/home/runner/work/pylifemap/pylifemap/src/pylifemap/data.py:98: UserWarning: 3 taxids have not been found in Lifemap database: [1221133, 210648, 303018]
  warnings.warn(msg, stacklevel=0)
/home/runner/work/pylifemap/pylifemap/src/pylifemap/data.py:110: UserWarning: 152 duplicated taxids have been found in the data
  warnings.warn(msg, stacklevel=0)

For a detailed list of layer_screengrid arguments you can take a look at its documentation.