import arcpy
from arcpy import env
from arcpy.sa import *
import os
import os.path
import sys,string
#arcpy.env.workspace = “D:\\TIF\\IMERGD\\Y”
dir = “D:\\TIF\\IMERGD\\Y”
filenames = os.listdir(dir)
for filename in filenames:
if os.path.splitext(filename)[1] == ‘.tif’:
inRaster = dir + os.sep + filename
Output_Workspace = “D:\\test”
basename = os.path.splitext(filename)[0] + ‘_bdmm’;
outPoint = Output_Workspace + os.sep + basename + ‘.shp’;
field = “VALUE”
arcpy.RasterToPoint_conversion(inRaster,outPoint,field)
print “ok”
转载自:https://blog.csdn.net/liudan19940618/article/details/82781716