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

Reprojection Analyzer

Build a small utility that reprojects GeoJSON features into a target coordinate reference system and reports meaningful spatial summaries.

Capabilities

Reproject GeoJSON features

  • Converts all feature coordinates from the provided source_crs (e.g., "EPSG:4326") into the target_epsg value and returns GeoJSON tagged with the target CRS string while preserving feature properties. @test
  • Rejects inputs lacking CRS strings or using unsupported target EPSG codes by raising a ValueError. @test

Annotate polygon areas

  • After reprojection, adds an area_km2 property to each Polygon and MultiPolygon feature representing planar area in square kilometers rounded to 3 decimals. @test

Summarize extents

  • Returns an overall bounding box [min_x, min_y, max_x, max_y] computed from reprojected coordinates plus a total polygon area sum in square kilometers, all packaged alongside the reprojected GeoJSON. @test

Implementation

@generates

API

from typing import Dict, Any

def reproject_features(geojson: Dict[str, Any], source_crs: str, target_epsg: str) -> Dict[str, Any]:
    """Reproject all feature coordinates to the target CRS, preserving properties and capturing CRS metadata."""

def summarize_features(geojson: Dict[str, Any], source_crs: str, target_epsg: str) -> Dict[str, Any]:
    """Return a dictionary with `features` (reprojected GeoJSON), `bbox` (overall extent), and `total_area_km2`."""

Dependencies { .dependencies }

leafmap { .dependency }

Geospatial analysis and reprojection toolkit.

tessl i tessl/pypi-leafmap@0.52.0

tile.json