rslearn.data_sources.wrs2¶
wrs2 ¶
Utilities for working with Landsat WRS-2 path/row polygons.
get_wrs2_polygons ¶
Get polygons for each (path, row) in the WRS2 grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cache_dir
|
UPath
|
local directory to cache downloaded shapefile artifacts. |
required |
buffer_degrees
|
float
|
amount to buffer each WRS polygon. Landsat scenes often extend slightly beyond nominal WRS polygons. |
0.2
|
Returns:
| Type | Description |
|---|---|
list[tuple[Geometry, str, str]]
|
List of (polygon, zero-padded path, zero-padded row). |
Source code in rslearn/data_sources/wrs2.py
build_wrs2_grid_index ¶
build_wrs2_grid_index(cache_dir: UPath) -> GridIndex
Build a GridIndex over buffered WRS2 polygons.
Source code in rslearn/data_sources/wrs2.py
get_pathrows_for_geometry ¶
get_pathrows_for_geometry(wrs2_index: GridIndex, wgs84_geometry: STGeometry) -> set[tuple[str, str]]
Get WRS2 path/row pairs intersecting a geometry in WGS84.