# encoding: utf-8
import os
import arcpy
from arcpy import env
path=r"D:\data\polygon"
dl=r"D:\data"
for fc in os.listdir(path):
if(fc.endswith(".shp")):
fcname=fc.decode('GBK').encode('utf-8')
polygonpath=path+"\\"+fcname
print polygonpath
dlpath=dl+"\\"+fcname[0:len(fcname)-4]
print dlpath
env.workspace=dlpath
features=arcpy.ListFeatureClasses()
for fea in features:
if(fea!="边界.shp"):
arcpy.Near_analysis(polygonpath, fea)
print fea
目录结构

相关文章:
-
2022-12-23
-
2021-11-21
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2021-09-15
-
2021-10-15
-
2022-12-23