加载要裁剪的底图shp ,之后创建一个矩形框shp ,可以用python geopandas
import os
import geopandas as gpd
from shapely import geometry
def clipSHP(minx,miny,maxx,maxy):
clip = gpd.GeoSeries([geometry.Polygon([(minx, miny), (minx, maxy), (maxx, maxy), (maxx, miny)])],
index=['clip'], # 构建一个索引字段
crs='EPSG:4326', # 坐标系是:WGS 1984
)
clip.to_file('D:/research/co_network/version2/data/wuhanMap/clip.shp',
driver='ESRI Shapefile',
encoding='utf-8')
clipSHP(min_lon,min_lat,max_lon,max_lat)
之后就能用 ARCgis 的 Analysis Tools --- Extract ---- clip 工具进行裁剪了,输出shp