Skip to content

Make build_vrt private; route to_geotiff's VRT path through it #2974

@brendancol

Description

@brendancol

Summary

build_vrt is public right now: it's in __all__, it's documented, and it has a row in the README feature matrix. It takes a list of existing GeoTIFF files and writes a VRT mosaic index over them. I'd like to drop it from the public API and keep it as an internal helper that only runs when to_geotiff writes a .vrt path.

Motivation

The public GeoTIFF surface is open_geotiff / to_geotiff / build_vrt. The first two are read and write. build_vrt is the odd one out because it doesn't take a DataArray at all, it just indexes files already sitting on disk. Anyone who wants a VRT mosaic from xrspatial-written tiles already gets one by writing to a .vrt path with to_geotiff, so the second entry point adds contract surface without adding much most people need.

The giveaway: to_geotiff's .vrt branch (_write_vrt_tiled) doesn't even call build_vrt. It calls _vrt.write_vrt directly. So build_vrt is public API with no internal caller.

Proposed change

  • Rename the wrapper build_vrt to _build_vrt and drop it from __all__ and the package docstring.
  • Point to_geotiff's VRT write path (_write_vrt_tiled) at _build_vrt so there's a single internal entry point for emitting the VRT index.
  • Pull build_vrt out of the docs reference, the README feature matrix, and the release-gate contract table.
  • Update the tests that import the public name to use _build_vrt, and flip the API-surface assertion to expect just open_geotiff and to_geotiff.

Compatibility

build_vrt is advanced-tier, not stable, so it's allowed to change between releases. Anyone calling xrspatial.geotiff.build_vrt directly will need to either write to a .vrt path through to_geotiff or import _build_vrt.

Backend coverage

No behavior changes. VRT writing already runs on the eager and dask paths; this is an API-surface refactor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAPI design and consistencyenhancementNew feature or requestgeotiffGeoTIFF module

    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