CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-fiona

Fiona reads and writes spatial data files

88

1.10x
Overview
Eval results
Files

task.mdevals/scenario-2/

GIS Feature Counter

Build a tool that counts features and calculates property statistics from GIS vector data files using memory-efficient iteration.

Capabilities

Count features efficiently

  • Given a shapefile with 100 point features, the counter returns the correct total count of 100 @test
  • Given an empty GIS file, the counter returns a count of 0 @test

Calculate property statistics

  • Given a GIS file where features have a numeric "population" property, the counter calculates the sum of all population values @test
  • Given a GIS file with features containing a "temperature" property, the counter finds the maximum temperature value @test

Implementation

@generates

API

def count_features(filepath: str) -> int:
    """
    Count the total number of features in a GIS file.

    Args:
        filepath: Path to the GIS vector data file

    Returns:
        Total number of features
    """
    pass

def calculate_property_sum(filepath: str, property_name: str) -> float:
    """
    Calculate the sum of a numeric property across all features.

    Args:
        filepath: Path to the GIS vector data file
        property_name: Name of the numeric property to sum

    Returns:
        Sum of the property values
    """
    pass

def find_property_max(filepath: str, property_name: str) -> float:
    """
    Find the maximum value of a numeric property across all features.

    Args:
        filepath: Path to the GIS vector data file
        property_name: Name of the numeric property

    Returns:
        Maximum value of the property
    """
    pass

Dependencies { .dependencies }

fiona { .dependency }

Provides GIS vector data reading capabilities with efficient iteration support.

Install with Tessl CLI

npx tessl i tessl/pypi-fiona

tile.json