Skip to content

rasterize: no tests for all_touched with line input or the non-iterable input error path #3105

@brendancol

Description

@brendancol

Test-coverage sweep pass 5 over xrspatial/rasterize.py (2026-06-09). Two parameter-coverage gaps, both MEDIUM.

  1. all_touched=True is tested only with polygon input (rasterio parity in test_rasterize_all_touched_supercover_2169.py, monotonicity and thin-polygon cases in test_rasterize_accuracy.py, GPU race tests in test_rasterize_gpu_race_2167.py). No test on any backend passes a LineString with all_touched=True. The flag is currently a no-op for lines, which diverges from the rasterio behavior the docstring promises; that is filed separately as rasterize(all_touched=True) has no effect on LineString geometries #3102. Whichever way rasterize(all_touched=True) has no effect on LineString geometries #3102 is resolved, the interaction needs pinning so a behavior change is visible in CI.

  2. _parse_input raises TypeError("geometries must be a GeoDataFrame or iterable of (geometry, value) pairs") for non-iterable input (rasterize.py:2834-2837). Nothing exercises it. The other validation guards in rasterize() were pinned in passes 1 through 4; this one was missed.

Plan: test-only PR. Pin lines + all_touched to the current contract (output equals all_touched=False and equals rasterio's default mode) across numpy / cupy / dask+numpy / dask+cupy, add a strict xfail for rasterio all_touched parity linked to #3102, and pin the TypeError path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions