Select to view content in your preferred language

Euclidean distance tool error

1241
2
Jump to solution
05-15-2020 11:15 AM
RicardoHuerta
New Contributor

I'm pretty new to using arcpy for spatial analysis. I'm trying to run the Euclidean distance analysis and keep getting the following error: ERROR 000622: Failed to execute (Euclidean Distance). Parameters are not valid.
ERROR 000628: Cannot set input into parameter cell_size. I'm entering an integer value for this parameter so I am confused why I keep getting this error. Here is my code:

#Import system modules
import arcpy, os
from arcpy import env
from arcpy.sa import *

#Set environment settings
ws = os.getcwd()
arcpy.env.workspace = ws

#Set local variables
in_source_data = "lrt_stop"
cell_size = 100
distance_method = "PLANAR"

#Execute EucDistance
outEucDist = EucDistance(in_source_data, cell_size, distance_method)

#Save output
outEucDist.save("Ltr_Dist")

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor
EucDistance(in_source_data, {maximum_distance}, {cell_size}, {out_direction_raster},
           {distance_method}, {in_barrier_data}, {out_back_direction_raster})

Since cell_size is the 3rd parameter, you should use named parameters rather than relying on position.

outEucDist = EucDistance(in_source_data, cell_size=cell_size, distance_method=distance_method)

or better

utEucDist = EucDistance(in_source_data, cell_size=100, distance_method="PLANAR")

Just because you have your variables named the same, doesn't translate to the positional requirement for maximum_distance not being specified.

 


... sort of retired...

View solution in original post

2 Replies
DanPatterson
MVP Esteemed Contributor
EucDistance(in_source_data, {maximum_distance}, {cell_size}, {out_direction_raster},
           {distance_method}, {in_barrier_data}, {out_back_direction_raster})

Since cell_size is the 3rd parameter, you should use named parameters rather than relying on position.

outEucDist = EucDistance(in_source_data, cell_size=cell_size, distance_method=distance_method)

or better

utEucDist = EucDistance(in_source_data, cell_size=100, distance_method="PLANAR")

Just because you have your variables named the same, doesn't translate to the positional requirement for maximum_distance not being specified.

 


... sort of retired...
RicardoHuerta
New Contributor

That makes sense, thank you!

0 Kudos