Hello,
I have created a model in ArcGIS pro and then I tried to convert it into a python script, but the code of Kriging function (even autogenerated) gives me this error:
Kriging() got an unexpected keyword argument 'semiVariogram_props'
The autogenerated code:
Kriging = Kriging_Extr2
Output_variance_of_prediction_raster = ""
with arcpy.EnvManager(extent=Rectangle):
Kriging_Extr2 = arcpy.sa.Kriging(in_point_features=point_values, z_field="RASTERVALU", semiVariogram_props="Spherical 7.200000 # # #", cell_size="0.25", search_radius="VARIABLE 12", out_variance_prediction_raster=Output_variance_of_prediction_raster)
Kriging_Extr2.save(Kriging)
I have looked into kriging python syntax online, but it also does not work. But maybe I am making some errors myself.
How could I solve this problem?
Solved! Go to Solution.
There appears to be a problem with the variable name semiVariogram_props.
Remove them, viz.,
Kriging_Extr2 = arcpy.sa.Kriging(point_values, "RASTERVALU", "Spherical 7.200000 # # #", "0.25", "VARIABLE 12", Output_variance_of_prediction_raster)
Are you using the spatial analyst kriging? because it is a parameter?
Kriging (Spatial Analyst)—ArcGIS Pro | Documentation
Yes I am. And when I run model in ArcGIS Pro everything works, it’s just that I am having problems with the python code.
There appears to be a problem with the variable name semiVariogram_props.
Remove them, viz.,
Kriging_Extr2 = arcpy.sa.Kriging(point_values, "RASTERVALU", "Spherical 7.200000 # # #", "0.25", "VARIABLE 12", Output_variance_of_prediction_raster)
It worked. Thank You very much!