【基础功能】ArcPy批量栅格转矢量

批量处理100个栅格转矢量,用ACRGIS得弄到手残,所以~不如跳舞~~~哈哈~~~当让是不如码代码

这是用python语言,Arcpy的强大助力批量让100个名称带有数字,从3-300,间隔为3的tif转为shp矢量文件

import arcpy
from arcpy import env

env.workspace = "E:/data/temp/data"
field = "VALUE"
inRaster = "single_"
outPolygons = "E:/data/temp/data/shpsingle_"
num = 3
while(num <= 300):
    inRaster += str(num)
    inRaster += ".tif"
    outPolygons += str(num)
    outPolygons += ".shp"
    arcpy.RasterToPolygon_conversion(inRaster, outPolygons, "NO_SIMPLIFY", field)
    inRaster = "single_"
    outPolygons = "E:/data/temp/data/shpsingle_"
    num += 3
print "finish"

转载自:https://blog.csdn.net/u014248147/article/details/77374966

You may also like...