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-7/

Styled Vector Map Builder

Compose an interactive map that combines polygon and point vectors with attribute-driven styling and a shareable HTML export.

Capabilities

Load multiple vector sources

  • Reads polygon data from a provided Shapefile path and point features from a GeoJSON path; raises a clear error when either file is missing or empty. @test

Attribute-driven styling

  • Colors polygons by a categorical field using a supplied style map, applies a fallback color when a category is unknown, and outlines polygons with a consistent stroke. @test

Layer composition and export

  • Adds both styled polygon and point layers to an interactive map with descriptive layer names, attaches a legend keyed to the style map, and saves the map to the specified HTML path while returning the map object. @test

Implementation

@generates

API

from pathlib import Path
from typing import Dict, Union

Color = Union[str, tuple]

def build_vector_map(
    polygons_path: Union[str, Path],
    points_path: Union[str, Path],
    category_field: str,
    style_map: Dict[str, Color],
    output_html: Union[str, Path],
):
    """Returns an interactive map displaying styled polygon and point data and writes it to an HTML file."""

Dependencies { .dependencies }

leafmap { .dependency }

Provides vector ingestion, styling, and interactive map export.

tessl i tessl/pypi-leafmap@0.52.0

tile.json