Composites¶
Composite builders create the stage-A raster: Earth Engine composites, USGS NAIP Plus exports, local GeoTIFFs and embedding rasters. See Satellite sources.
composites ¶
Composite builders for satellite imagery acquisition.
Handles creating annual composites from various satellite sources via Google Earth Engine or loading local GeoTIFF files.
CompositeBuilder ¶
Bases: ABC
Abstract base class for satellite composite builders.
Subclasses must implement :meth:build and :meth:get_band_mapping.
Source code in agribound/composites/base.py
build
abstractmethod
¶
Build a composite (or fetch embeddings) and write it as a local GeoTIFF.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
AgriboundConfig
|
Pipeline configuration. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Path to the composite GeoTIFF. |
Source code in agribound/composites/base.py
get_band_mapping
abstractmethod
¶
Return the band name mapping for a satellite source.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
Satellite source name. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
Mapping of canonical names (R, G, B, NIR, ...) to source band names. |
Source code in agribound/composites/base.py
get_resolution ¶
Return the default export resolution in metres for a source.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
Satellite source name. |
required |
Returns:
| Type | Description |
|---|---|
float or None
|
Resolution in metres, or None when it depends on the input. |
Source code in agribound/composites/base.py
NoDataError ¶
Bases: ValueError
No input imagery or embeddings for this study area and year.
Raised by the composite builders when the source has no data for the
study area in the requested period: no image intersects the study-area
extent (the message lists the years that have images there), the
downloaded composite or embedding has no valid pixel inside the study
area, TESSERA or the Source Cooperative mirror returns no tile, USGS NAIP
Plus has no imagery there, or a local raster does not overlap the study
area. Invalid configurations and service errors raise other exceptions.
A subclass of :class:ValueError, so except ValueError handlers
keep catching it; :func:agribound.hpc.tiles.no_data_reason uses it to
record such tiles as "no-data" instead of failed.
Source code in agribound/composites/base.py
get_composite_builder ¶
Factory function to get the composite builder for a source.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
Satellite source name. |
required |
Returns:
| Type | Description |
|---|---|
CompositeBuilder
|
Builder instance for the given source. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the source is not recognised. |
Source code in agribound/composites/base.py
list_sources ¶
List all satellite sources and their metadata.
Returns:
| Type | Description |
|---|---|
dict[str, dict]
|
Deep copy of :data: |
Examples:
>>> from agribound import list_sources
>>> for name, info in list_sources().items():
... print(name, info["resolution_m"], info["value_scale"])
Source code in agribound/registry.py
Earth Engine¶
gee ¶
Google Earth Engine composite builder and Earth Engine download helpers.
:class:GEECompositeBuilder builds a composite for landsat,
landsat-pan, sentinel2, hls, naip, spot and spot-pan on Google Earth
Engine and downloads it as one local GeoTIFF with geedim 2 (the
ee.Image.gd accessor).
Radiometry of the written composites (value_scale in
:mod:agribound.registry):
- Sentinel-2 (
COPERNICUS/S2_SR_HARMONIZED): surface reflectance x 10000 as stored in the collection (12 bands B1-B12 without B10). - Landsat 5/7/8/9 Collection 2 Level-2: every image is converted to
surface reflectance (
DN * 2.75e-5 - 0.2), clipped at 0 and multiplied by 10000 before compositing. Landsat 5/7 bands are renamed to the Landsat 8/9 names (SR_B2...SR_B7= blue, green, red, NIR, SWIR1, SWIR2). - HLS v2.0: Earth Engine stores HLS as 0-1 reflectance; values are
multiplied by 10000. HLSS30 bands
B1, B2, B3, B4, B8A, B11, B12are renamed to the HLSL30 namesB1...B7(soB5is NIR narrow andB6/B7are SWIR1/SWIR2 for both sensors). - Landsat PAN: native 15 m B8 TOA reflectance from Landsat 7/8/9,
exported as float32 without scaling (
unit). The two PAN bandpasses (Landsat 7 0.52-0.90 um, Landsat 8/9 0.50-0.68 um) are not mixed unlesslandsat_pan_missionsnames both (see :func:landsat_pan_missions_for_window);AGRIBOUND_SENSORSandAGRIBOUND_SENSOR_IMAGESrecord the missions whose images were used. - NAIP (
USDA/NAIP/DOQQ): 8-bit digital numbers (R, G, B, N), mosaicked (not composited), exported as uint8 with nodata 0 atconfig.naip_resolution_m. Only 4-band images are used (some early years are RGB only). Withoutdate_range, images fromyear - 1toyear + 1are mosaicked with the exact-year images on top and the newest image on top within each group. - SPOT 6/7 (
AIRBUS/SPOT6_7, restricted): per-band medians (or greenest-pixel selections) of the scenes' raw integer digital numbers, exported as float32 (a median of an even number of scenes can be a half-integer). The radiometry of these DN has not been verified, so they are treated as uncalibrated (value scale"dn").
Float composites are written as float32 with NaN nodata. Masked pixels
(clouds, cloud shadows, no valid observation) are NaN. After download, the
share of valid pixels inside the study-area polygons is written to the
AGRIBOUND_VALID_FRACTION tag; the builder raises when it is 0 and logs a
WARNING when it is below :data:LOW_VALID_FRACTION.
Cloud masks: Landsat QA_PIXEL bits 0-4 (fill, dilated cloud, cirrus,
cloud, cloud shadow); HLS Fmask bits 1-3 (cloud, adjacent to
cloud/shadow, cloud shadow); Sentinel-2 either the scene classification
(SCL classes 3 cloud shadow, 8 cloud medium probability, 9 cloud high
probability, 10 thin cirrus) or Cloud Score+ (cs_cdf >=
config.cloud_score_threshold). Scenes are pre-filtered on their scene
cloud-cover property (<= config.cloud_cover_max).
Extent: the export pixel grid covers the bounding box of the study area in
config.export_crs ("utm" = WGS 84 / UTM zone of the study-area
centroid, used for the whole study area), with pixel edges on multiples of the
resolution, so composites of the same study area, CRS and resolution (e.g.
FTW's two date windows) share one grid. Images are selected with
filterBounds on the outline of that grid. Pixels are not masked to the
study-area polygons: when the study area is a set of field polygons (for
example the reference boundaries), masking would imprint their outlines on the
engine input.
Download: component images are resampled to the grid by Earth Engine (nearest
neighbour, the Earth Engine default). Grids larger than config.tile_size
pixels per side are split into aligned tiles that are downloaded one after
another (each tile by geedim with up to config.gee_max_requests concurrent
requests), cached, and assembled into one GeoTIFF.
GEECompositeBuilder ¶
Bases: CompositeBuilder
Composite builder for the Earth Engine imagery sources.
Handles landsat, landsat-pan, sentinel2, hls, naip,
spot and spot-pan (see the module docstring for masks, radiometry
and the export grid). The result is cached under
cache_path(config, f"{source}_composite", ".tif", ...), whose key
includes the study area, year, date range, compositing and export
settings, so different windows (e.g. FTW's two windows) get different
files.
Attributes:
| Name | Type | Description |
|---|---|---|
last_metadata |
dict
|
Facts about the most recent :meth: |
Source code in agribound/composites/gee.py
1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 | |
build ¶
Build and download the composite for config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
AgriboundConfig
|
Pipeline configuration. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Path to the composite GeoTIFF. |
Raises:
| Type | Description |
|---|---|
NoDataError
|
(A :class: |
ValueError
|
If the composite method does not apply to the source. |
ExportTaskStartedError
|
For |
Notes
After a local download, the share of pixels inside the study-area
polygons that are valid in every band is written to the
AGRIBOUND_VALID_FRACTION tag (:func:raster_valid_fraction); a
WARNING is logged when it is below :data:LOW_VALID_FRACTION.
Source code in agribound/composites/gee.py
1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 | |
get_band_mapping ¶
Return the canonical band mapping (canonical name -> band name) of a source.
ExportTaskStartedError ¶
Bases: RuntimeError
Raised when the composite is exported by an Earth Engine batch task (Drive/GCS).
Raised after a task was started, or when a task recorded by an earlier
run is still queued, running, or has completed (no second task is
started then). The composite is not available locally until the task
finishes, so the pipeline cannot continue. tasks lists {"id",
"description", "destination"} (plus "state" for a recorded task)
for each task.
Source code in agribound/composites/gee.py
apply_composite_method ¶
Reduce a prepared collection to one image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collection
|
ImageCollection
|
Masked, scaled images with the source's output bands. |
required |
method
|
str
|
|
required |
source
|
str
|
Source name (to look up the NIR/red bands). |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
For an unknown method, or |
Source code in agribound/composites/gee.py
date_window ¶
Return (start, end_exclusive) dates for ee.ImageCollection.filterDate.
config.date_range is inclusive of its end date (as in the rest of
Agribound), so one day is added to it. Without a date range the window is
the calendar year [year-01-01, (year+1)-01-01).
Source code in agribound/composites/gee.py
landsat_pan_missions_for_window ¶
landsat_pan_missions_for_window(setting: str | tuple[str, ...], window: tuple[str, str]) -> tuple[str, ...]
Return the missions a landsat-pan composite of window uses.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setting
|
str or tuple[str, ...]
|
|
required |
window
|
tuple[str, str]
|
|
required |
Returns:
| Type | Description |
|---|---|
tuple[str, ...]
|
With |
Source code in agribound/composites/gee.py
USGS NAIP Plus¶
usgs ¶
USGS NAIP Plus ImageServer composite builder.
The USGS NAIP Plus ImageServer serves only the latest NAIP/HRO vintage of
each state (years 2012-2023 as of 2026-09, most states 2019-2023), not the
historical NAIP archive, so most years are unavailable for a given state. Use
source="naip" (Earth Engine, 2002-2023) for other years. The service's
pixel size is 0.3 m; state vintages are 0.3-0.6 m.
The output covers the export grid: the bounding box of the study area in
config.export_crs ("utm": the UTM zone of the study-area centroid), as
for the other builders; pixels are not masked to the study-area polygons.
:class:USGSNAIPPlusCompositeBuilder:
- queries catalogue items (
Category = 1,Year = config.year, optionalState) intersecting the export-grid outline; when none match it raises :class:ValueErrorlisting the years the service has for the area; - selects footprints greedily (closest year, 4 bands, largest overlap,
finest resolution) until the grid outline is covered or the service's
maxMosaicImageCountis reached, and locks the mosaic to them (esriMosaicLockRaster); a WARNING is logged when the selected footprints cover less than 99 % of the grid outline; - exports tiles of at most
min(config.tile_size, maxImageWidth, maxImageHeight)pixels in EPSG:3857 at the finest ground resolution of the selected footprints (the service resamples with bilinear interpolation), with the Web Mercator pixel size scaled by1 / cos(latitude)of the study-area centroid so that the ground sampling matches; - merges the tiles and resamples them (bilinear) onto the export grid;
- writes a uint8 GeoTIFF (nodata 0; pixels no selected footprint covers are
0) with a JSON manifest of the query and selection, and records the share
of study-area pixels that have imagery (
AGRIBOUND_VALID_FRACTION; a WARNING is logged below 99 %, and :class:ValueErroris raised at 0).
The band order is assumed to be R, G, B, N (the service reports generic band
names Band_1-Band_4 and sensor type CNIR).
USGSNAIPPlusCompositeBuilder ¶
Bases: CompositeBuilder
Build a local uint8 raster for the study area from the USGS NAIP Plus ImageServer.
Attributes:
| Name | Type | Description |
|---|---|---|
SELECTION_VERSION |
int
|
Version of the selection/export recipe (part of the cache key). |
last_metadata |
dict
|
Facts about the most recent :meth: |
Source code in agribound/composites/usgs.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 | |
build ¶
Download and mosaic a USGS NAIP Plus raster covering the study-area extent.
Returns:
| Type | Description |
|---|---|
str
|
Path to the uint8 GeoTIFF (cached with
:func: |
Raises:
| Type | Description |
|---|---|
NoDataError
|
(A :class: |
ValueError
|
If no study area is set or the study area is empty. |
Source code in agribound/composites/usgs.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | |
get_band_mapping ¶
Return the canonical band mapping (R, G, B, NIR -> R, G, B, N).
Local GeoTIFFs and embeddings¶
local ¶
Local GeoTIFF and embedding builders.
- :class:
LocalCompositeBuilder(source="local"): validates a user GeoTIFF and, when a study area is configured, crops it to the study area's bounding box (pixel values unchanged). Its radiometry is unknown to Agribound (value scale"unknown"). -
:class:
EmbeddingCompositeBuilder: pre-computed embeddings. -
tessera-embedding: TESSERA embeddings streamed from the public Zarr stores with :class:geotessera.GeoTesseraZarr(geotessera >= 0.10), forconfig.tessera_version/config.tessera_variant. The study area is split by UTM zone, becauseGeoTesseraZarr.read_regiononly reads the zone that holds the centre of the requested box; each zone is read on its native 10 m grid and resampled (nearest neighbour) onto one grid inconfig.export_crs(for"utm", the zone of the study-area centroid, whose pixels are copied without resampling). google-embedding: Google Satellite Embedding V1 (AlphaEarth Foundations, 64 bandsA00-A63, 2017-2025) from Earth Engine (google_embedding_backend="gee", default) or from the Source Cooperative COG mirror (google_embedding_backend="source_coop", no Earth Engine compute), whose int8 tiles are read window by window with rasterio using the mirror's tile index and de-quantised as geoai-py does.
Embedding rasters are float32 with NaN nodata (NaN marks pixels without an
embedding: water, no data or missing coverage). As for the imagery builders,
they cover the bounding box of the study area in the export CRS and are not
masked to the study-area polygons. The TESSERA and Source Cooperative paths
hold the whole area in memory while it is assembled (512 bytes per pixel for
TESSERA, 256 for Google embeddings, about twice that at peak while the zone
reads and the output coexist), so split very large regions into tiles (see
agribound.hpc).
:func:tessera_coverage reports TESSERA tile coverage of a bounding box from
the dataset manifest without downloading embeddings.
LocalCompositeBuilder ¶
Bases: CompositeBuilder
Builder for user-provided GeoTIFFs (source="local").
Validates the file (:func:validate_local_raster). When a study area is
configured, the raster is cropped to the study area's bounding box
(:func:crop_to_extent; pixel values are not changed or masked) into the
cache (cache_path(config, "local_crop_<name>", ".tif", ...), keyed by
the study area and the file's path, size and modification time). Without
a study area, or when the bounding box contains the whole raster, the file
itself is returned.
Attributes:
| Name | Type | Description |
|---|---|---|
last_metadata |
dict
|
Facts about the most recent :meth: |
Source code in agribound/composites/local.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | |
build ¶
Validate the local GeoTIFF and crop it to the study-area extent.
Raises:
| Type | Description |
|---|---|
NoDataError
|
(A :class: |
ValueError
|
If |
FileNotFoundError
|
If |
Source code in agribound/composites/local.py
get_band_mapping ¶
Return the positional band mapping assumed for local files.
Engines read R, G, B (and NIR) from bands 1, 2, 3 (4)
unless AgriboundConfig.bands maps canonical names to other band
indices (see :func:agribound.engines.base.get_canonical_band_indices).
Source code in agribound/composites/local.py
EmbeddingCompositeBuilder ¶
Bases: CompositeBuilder
Builder for the pre-computed embedding sources.
tessera-embedding uses :func:build_tessera_embedding;
google-embedding uses :func:build_google_embedding_gee or, with
google_embedding_backend="source_coop",
:func:build_google_embedding_source_coop. Outputs are cached with
:func:agribound._cache.cache_path (keyed by study area, year, export
CRS, dataset version/variant and backend).
Attributes:
| Name | Type | Description |
|---|---|---|
last_metadata |
dict
|
Tags of the most recent output. |
Source code in agribound/composites/local.py
build ¶
Fetch the embeddings for the study area and return the GeoTIFF path.
Source code in agribound/composites/local.py
get_band_mapping ¶
Embedding sources have no canonical optical bands; returns an empty mapping.
validate_local_raster ¶
Check that a local GeoTIFF can be used as pipeline input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
Raster file. |
required |
bands
|
dict or None
|
|
None
|
Returns:
| Type | Description |
|---|---|
dict
|
|
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the file does not exist. |
ValueError
|
If the raster has no CRS, no bands, or bands holds an index outside
|
Notes
A raster without a nodata value is accepted with a WARNING (zeros are then treated as valid data by the engines); fewer than 3 bands without a bands mapping is accepted with a WARNING (RGB engines need 3 bands).
Source code in agribound/composites/local.py
tessera_coverage ¶
tessera_coverage(bbox: tuple[float, float, float, float], year: int, version: str = 'v1', variant: str | None = None, cache_dir: str | None = None) -> dict[str, Any]
Report TESSERA tile coverage of a bounding box from the dataset manifest.
Tiles are 0.1 x 0.1 degree cells. The manifest (GeoTessera(...)
.registry) is downloaded once into cache_dir (about 212 MB for v1,
59 MB for v1.1); no embeddings are downloaded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bbox
|
tuple
|
|
required |
year
|
int
|
Year to check. |
required |
version
|
str
|
|
'v1'
|
variant
|
str or None
|
Dataset variant (None = geotessera default for the version). |
None
|
cache_dir
|
str or None
|
geotessera registry cache directory (e.g. shared HPC scratch). |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
|