Landsat WRS介绍 及 Polygon定位WRS算法
Landsat WRS
- Landsat WRS 介绍
- WRS KMZ 数据下载
- polygon 定位 WRS
- main_process
- function
Landsat WRS 介绍
🌍 WRS-2 系统概述
WRS-2 是第二代WRS(Worldwide Reference System),自Landsat 4卫星以来被广泛使用。它通过将地球表面分割为固定大小的网格单元(即路径和行)来定位卫星影像。这些网格单元覆盖全球,允许每个Landsat影像根据路径和行来定位,确保了空间覆盖的一致性。
📐 WRS-2 网格结构
Path (路径): 在WRS-2中,路径是指卫星轨道的轨迹。路径是一个编号的横向网格,每个路径都表示卫星沿轨道飞行时的一个特定轨道位置。共有233条路径,编号从1到233。
Row (行): 行表示卫星通过的纬度条带,也就是从北到南的纵向网格。共有248条行,编号从1到248。
因此,每个Landsat影像都通过其所属的路径编号(Path)和行编号(Row)唯一标识。组合路径和行编号可以唯一地标识Landsat影像的空间位置。
WRS KMZ 数据下载
https://d9-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/s3fs-public/atoms/files/WRS2_descending_0.zip
polygon 定位 WRS
main_process
fclose all
clear all
clc% Shapefile 路径(假设已下载并解压)
wrs_path = 'WRS2_descending_0\WRS2_descending.shp';% 读取 WRS-2 边界
lat_poly = [25.1, 25.1, 24.9, 24.9, 25.1];
lon_poly = [96.3, 96.5, 96.5, 96.3, 96.3];% 调用函数
overlaps = get_Landsat_WRS_Path_Row(lat_poly, lon_poly, wrs_path);% 显示结果
% disp(array2table(overlaps, 'VariableNames', {'Path','Row'}));
function
function overlap_paths = get_Landsat_WRS_Path_Row(lat_poly, lon_poly, wrs_shapefile)
% getLandsatOverlapPathRow 找出与给定多边形区域重叠的 Landsat path/row
% 输入:
% lat_poly, lon_poly - 多边形顶点的纬度和经度向量(需闭合或自动闭合)
% wrs_shapefile - WRS-2 shapefile 文件路径
% 输出:
% overlap_paths - N×2 矩阵,每行是 [path, row]% 保证多边形闭合if lat_poly(1) ~= lat_poly(end) || lon_poly(1) ~= lon_poly(end)lat_poly(end+1) = lat_poly(1);lon_poly(end+1) = lon_poly(1);end% 创建用户多边形user_poly = polyshape(lon_poly, lat_poly);% 读取 WRS shapefilewrs = shaperead(wrs_shapefile);% 用户区域边界框minLat = min(lat_poly);maxLat = max(lat_poly);minLon = min(lon_poly);maxLon = max(lon_poly);% 用 bounding box 预筛选bbox_filter = arrayfun(@(s) ...max(s.BoundingBox(:,1)) >= minLon && ...min(s.BoundingBox(:,1)) <= maxLon && ...max(s.BoundingBox(:,2)) >= minLat && ...min(s.BoundingBox(:,2)) <= maxLat, ...wrs);filtered_wrs = wrs(bbox_filter);% 精筛选overlap_paths = [];for i = 1:length(filtered_wrs)x = filtered_wrs(i).X;y = filtered_wrs(i).Y;valid = ~isnan(x) & ~isnan(y);wrs_shape = polyshape(x(valid), y(valid));if overlaps(user_poly, wrs_shape)overlap_paths = [overlap_paths; filtered_wrs(i).PATH, filtered_wrs(i).ROW];endendoverlap_paths = unique(overlap_paths, 'rows');
end