Advertisement

基于OSGEO对单个矢量文件中的多个图斑逐一导出(无需使用arcpy)

阅读量:
复制代码
 def dispatchShapefileSplit(dispatchShapefile):

    
     """
    
     把一个扰动图斑矢量文件包含多个图斑的进行拆分
    
     比如原图斑名字为name,包括3个图斑
    
     拆分后的文件名字分别为name_1, name_2, name_3
    
     """
    
     outputPath = os.path.dirname(dispatchShapefile)
    
     name = os.path.basename(dispatchShapefile).split('.')[0]
    
  
    
     driver = ogr.GetDriverByName('ESRI Shapefile')
    
  
    
     inds = ogr.Open(dispatchShapefile, 0)
    
     if inds is None:
    
     print('Could not open this shpfile, named as ', os.path.basename(dispatchShapefile), '.')
    
     return
    
  
    
     inla

全部评论 (0)

还没有任何评论哟~