CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-leafmap

A Python package for geospatial analysis and interactive mapping in a Jupyter environment.

54%

Overall

Evaluation54%

0.81x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-4/

Rainfall Thematic Map

Create an interactive choropleth map that visualizes precipitation intensity with both a numeric colorbar and a categorical legend for overlays.

Capabilities

Numeric gradient with colorbar

  • When provided polygon features containing a precip_mm numeric property and a value range, render a gradient fill across the polygons that interpolates across the provided palette, and display a continuous colorbar with min/max labels tied to the same range. @test

Categorical overlay legend

  • When given optional overlay features grouped by category labels with predefined colors, render them atop the choropleth and show a legend that lists each category with its assigned color swatch and visibility toggle. @test

Exported map view

  • Produce an interactive map centered on the supplied features, with the colorbar and legend visible, and export it to the requested HTML file path. @test

Implementation

@generates

API

from typing import List, Dict, Any, Tuple, Optional

def create_precipitation_map(
    features: List[Dict[str, Any]],
    palette: List[str],
    value_range: Tuple[float, float],
    output_html: str,
) -> "Map":
    """Render a choropleth over the given polygon features using the palette and value range, include a matching continuous colorbar, and return the map object after exporting it to the output_html path."""

def add_categorical_overlay(
    map_obj: "Map",
    overlays: Optional[Dict[str, List[Dict[str, Any]]]],
    colors: Optional[Dict[str, str]],
) -> "Map":
    """Render optional overlay features grouped by category, apply the provided colors, attach a legend that mirrors those categories, and return the updated map."""

Dependencies { .dependencies }

leafmap { .dependency }

Provides interactive map rendering, choropleth styling, colorbars, and legend widgets.

@satisfied-by

tessl i tessl/pypi-leafmap@0.52.0

tile.json