我在 python 中撰寫了一個代碼來處理一些 .tif 檔案并將它們放入 WGS 1984 Coordinate System。問題是,當我運行代碼時,它給了我錯誤并停止執行。我嘗試對近 100 個 .tif 檔案使用 arcpy.ProjectRaster_management 執行此操作。你能幫我讓這個腳本運行嗎?貝婁是我寫的腳本:
import arcpy
import os
import sys
import getpass
username = getpass.getuser()
empty_folder = os.path.expanduser("~") r"\Desktop\wgs " str(username)
path1 = empty_folder
if not os.path.exists(path1):
os.makedirs(path1)
path2 = r"f:\proiecte\F5\Robert Nicolescu\ARCGIS\georeferentiere\TEST_georeferentiere\FINALE\50GHA\global_mapper_export"
tif_files = []
for x in os.listdir(path2):
if x.endswith(".tif"):
tif_files.append(x)
input_coordinate_system = "WGS_1984_UTM_zone_29N"
output_coordinate_system = "GCS_WGS_1984"
resampling_technique = "NEAREST"
def projectRaster(input, output):
arcpy.ProjectRaster_management(input,output,output_coordinate_system,resampling_technique, "","", "", input_coordinate_system)
print "Script done!"
projectRaster(input=tif_files, output=path1)
uj5u.com熱心網友回復:
使用 ArcGIS Desktop 中的模型構建器,一旦您的模型完成,然后匯出 Python 代碼。您嘗試執行的操作可以使用模型生成器工具完成。除非您想要一些額外的普通功能,否則您將使用修改后的代碼。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/428052.html
標籤:Python python-2.7 弧形GIS 弧度 弧形图
