用 PyCharm 代码:按权属性质从地类图斑与栅格影像中精准提取影像
```python import rasterio import geopandas as gpd # 读取地类图斑图层 dltb = gpd.read_file('data3/dltb.shp') # 读取栅格影像图层 image = rasterio.open('data3/image.tif') # 根据权属性质字段的不同,分别提取31(组集体)、32(村集体)、33(镇集体)的影像 group_image = image.read(1)[dltb[dltb['qsdw'] == '31'].geometry.values] village_image = image.read(1)[dltb[dltb['qsdw'] == '32'].geometry.values] town_image = image.read(1)[dltb[dltb['qsdw'] == '33'].geometry.values] # 保存提取出的影像 with rasterio.open('data3/group_image.tif', 'w', image.profile) as dst: dst.write(group_image, 1) with rasterio.open('data3/village_image.tif', 'w', image.profile) as dst: dst.write(village_image, 1) with rasterio.open('data3/town_image.tif', 'w', image.profile) as dst: dst.write(town_image, 1) ``` ######[AI写代码神器 | 545点数解答 | 2024-06-30 05:32:46]
- Python使用pulp库遇TypeError错误,解决方案及示例代码全解析(字节豆包 | 597点数解答 | 2025-08-08 09:33:27)165
- 医院系统:信息添加、查询与修改操作全流程展示( | 31点数解答 | 2024-05-22 11:20:34)505
- Python代码:根据整数性质判断小A、小B、小C、小D的喜好(字节豆包 | 602点数解答 | 2026-02-01 11:37:40)19
- Python 代码:根据整数性质判断小 A、小 B、小 C、小 D 的喜好!(字节豆包 | 553点数解答 | 2026-02-01 11:44:40)20
- C++程序:判断小A、小B、小C、小D对给定整数的喜好(字节豆包 | 691点数解答 | 2026-02-01 11:45:26)17
- C++ 代码:判断小 A、小 B、小 C 和小 D 对整数的喜好(字节豆包 | 708点数解答 | 2026-02-01 11:46:18)25
- 整数性质判断:小A、小B、小C、小D谁会喜欢这个数?(字节豆包 | 259点数解答 | 2026-02-01 11:47:07)15
- 整数喜好大揭秘:输入数字,速判四人喜好!(字节豆包 | 848点数解答 | 2026-02-01 12:21:40)15
- 整数喜好判断:小A、小B、小C、小D谁会爱上它?(字节豆包 | 786点数解答 | 2026-02-01 12:22:10)14
- C++ 解题:根据整数性质判断小 A、小 B、小 C、小 D 的喜好(字节豆包 | 900点数解答 | 2026-02-01 12:22:54)26
- 整数性质判断:小A、小B、小C、小D谁会喜欢这个数?(字节豆包 | 929点数解答 | 2026-02-01 12:23:45)20
- 数字化制图综合平台:助力企业转型,推动烟草物流图纸智能化设计 (字节豆包 | 490点数解答 | 2024-10-30 20:30:29)146