# 设置driver driver = ogr.GetDriverByName('ESRI Shapefile') # 打开输入的矢量 inDs = driver.Open(r'E:/wang2/python/polygon_jingweidu.shp', 0) if inDs is None: print("Could not open", 'sites.shp') sys.exit(1) # 打开输入矢量的图册 inLayer = inDs.GetLayer() srs = inLayer.GetSpatialRef() outshp = r'E:/wang2/python