diff --git a/src/postprocessing/map.py b/src/postprocessing/map.py index 7651c65..a11ad81 100644 --- a/src/postprocessing/map.py +++ b/src/postprocessing/map.py @@ -900,15 +900,17 @@ class ContentMapper: print(f" ⚠ 未识别到标准坐标列名,按位置回退: " f"X={lon_col}, Y={lat_col}") - # 含量列:跳过坐标列后的第一列 - coord_cols = {lon_col, lat_col} + # 动态识别含量列(跳过已知的坐标列和特殊列) + _exclude_cols = {'proj_x', 'proj_y', 'longitude', 'latitude', + 'x', 'y', 'lon', 'lat', 'geometry', 'uncertainty', + 'x_coord', 'y_coord', 'pixel_x', 'pixel_y'} content_col = None - for c in df.columns: - if c not in coord_cols and not c.startswith('pixel_'): - content_col = c + for col in df.columns: + if col.lower() not in _exclude_cols and not col.startswith('pixel_'): + content_col = col break if content_col is None: - content_col = df.columns[2] + content_col = df.columns[-1] print(f"检测到列名:X({lon_col}),Y({lat_col}),含量({content_col})")