I failed to calculate the Euclidean distance with the EucDistance function in the PyCharm. The codes are as follows.
import arcpy
from arcpy import env
from arcpy.sa import *
arcpy.env.overwriteOutput = True
env.workspace = "D:/Study/Reference/ecological integrity/regions"
outEucDistance = EucDistance("Highways1.tif", "", 30, "")
outEucDistance.save("D:/Study/Reference/ecological integrity/ED.tif")
Now, I received the following warning message
Traceback (most recent call last): File "D:/Software/11.py", line 9, in outEucDistance = EucDistance("Highways1.tif", "", 30,"") File "d:\Program Files\ArcGIS 10.4\Desktop10.4\arcpy\arcpy\sa\Functions.py", line 968, in EucDistance out_direction_raster) File "d:\Program Files\ArcGIS 10.4\Desktop10.4\arcpy\arcpy\sa\Utils.py", line 53, in swapper result = wrapper(*args, **kwargs) File "d:\Program Files\ArcGIS 10.4\Desktop10.4\arcpy\arcpy\sa\Functions.py", line 962, in Wrapper out_direction_raster) File "d:\Program Files\ArcGIS 10.4\Desktop10.4\arcpy\arcpy\geoprocessing_base.py", line 506, in return lambda *args: val(*gp_fixargs(args, True)) arcgisscripting.ExecuteError: ERROR 010429: GRID IO 中存在错误: GetOpenTileChannel: Could not create tile. name: d:\study\reference\ecological integrity\regions\xx0025560000, adepth: 32, type: 1, iomode: 1, version: 3, compression: 0, eval case: 1 。 ERROR 010296: 写入栅格 d:\study\reference\ecological integrity\regions\xx0025560000 时出错。 Distance mapping is failed ERROR 010067: 执行格网表达式时出错。 执行(EucDistance)失败。
The data is here.
How can I fix this?
env.workspace = "D:/study/reference/ecological integrity/regions"
...? A search of the error reveals the answer