现有一个建成区的shp使用python和geopandas包提取其shp的轮廓
使用Python和geopandas包提取shp文件的轮廓可以按照以下步骤进行:
- 导入所需的库:
import geopandas as gpd
- 读取shp文件:
data = gpd.read_file('path_to_shp_file.shp')
- 提取轮廓:
contour = data.geometry
完整的示例代码如下:
import geopandas as gpd
# 读取shp文件
data = gpd.read_file('path_to_shp_file.shp')
# 提取轮廓
contour = data.geometry
请确保替换path_to_shp_file.shp为实际的shp文件路径。
原文地址: https://www.cveoy.top/t/topic/iU2e 著作权归作者所有。请勿转载和采集!