Hello, I am reading these information, which are really useful for me. According to your discussion. I already can do the kriging using python for a given shpfile. I don't know how to do the loop. What you use for the loop. As here we can not use iterators from model bulider. Thanks a lot!!!!
Hi, I am reading these information, which is very useful for me. But I am using version 10. There is no arcpy.GeostatisticalDatasets in version 10, right? What I should do for these general workflow:
Thanks very much!!!!
Hi Steve:
I have not solved the problem that I reported earlier yet.
I confirm that there is problem with the python code. When I try to run kriging for certain datasets that already have kriged predictions generated, script is throwing me an error. The error is as follows:
Traceback (most recent call last):
File "C:\Users\aramakrishnan\Documents\ArcGIS\scratch\Ordinary Kriging_July2014.py", line 41, in <module>
arcpy.gp.ExtractValuesToPoints_sa(Harris_Lat_Long_csv_Events_lyr, Raster_Path + "OZ8_" + fieldname, Ext_Table_Path + "OZ8_" + fieldname, "INTERPOLATE", "VALUE_ONLY")
File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\geoprocessing\_base.py", line 498, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
ExecuteError: ERROR 999999: Error executing function.
Failed to execute (ExtractValuesToPoints).
Failed to execute (ScriptJul21).
Failed at Wed Aug 27 19:35:22 2014 (Elapsed Time: 1 minutes 55 seconds)
I tried to run ordinary kriging by manual methods by inputing the lag, sil and nugget values. However, I am not able to even generate the raster to feed it into the script. I attach my complete python code and xml file.
Will wait to hear from you
Thank you
Anushuya
What happens if you run the ExtractValuesToPoints geoprocessing tool from the toolbox and feed in your raster and point feature class? I.e. in your script you could print out the raster name and the name of the feature class.
Also, the GALayerToPoints tool exports a geostatistical layer to points. The tool can also be used to predict values at unmeasured locations or to validate predictions made at measured locations.
This route will save you creating a raster.
-Steve
Hi,
I need some help with the error I get while using spatial analyst tool in a python script (attached).
Due to hard disk space issues, I deleted most of the old data files in the default.gdb folder and tried to run the script, which was working fine before the data clean-up.
Below is the error message I get.
Please help me identify what is missing and how to fix the issue.
Thanks,
Executing: ScriptStart Time: Sun Aug 10 15:47:46 2014Running script Script...
Traceback (most recent call last): File "C:\Users\aramakrishnan\Documents\ArcGIS\scratch\Ordinary Kriging_July2014.py", line 41, in <module> arcpy.gp.ExtractValuesToPoints_sa(Harris_Lat_Long_csv_Events_lyr, Raster_Path + "OZ4" + fieldname, Ext_Table_Path + "OZ4" + fieldname, "INTERPOLATE", "VALUE_ONLY") File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\geoprocessing\_base.py", line 498, in <lambda> return lambda *args: val(*gp_fixargs(args, True))ExecuteError: ERROR 999999: Error executing function.Failed to execute (ExtractValuesToPoints).
Failed to execute (Script).Failed at Sun Aug 10 15:49:38 2014 (Elapsed Time: 1 minutes 51 seconds)
Dear all, I have a similar problem, I am trying to automatically process some shapefiles in order to use cokriging.This is the python code:# Import arcpy moduleimport arcpy# Check out any necessary licensesarcpy.CheckOutExtension("GeoStats")arcpy.env.overwriteOutput = True# Local variables:#CoKriging = "C:\\Users\\nkondapalli\\Desktop\NewFolder\\CoKriging.lyr"CoKriging = "C:\\Users\\nkondapalli\\Desktop\NewFolder\\Krigingmodel2_2.xml"TR1intermediate_point = "C:\\Users\\nkondapalli\\Desktop\NewFolder\\TR1intermediate_point.shp"GACreateGeostatisticalLayer1 = "C:\\Users\\nkondapalli\\Desktop\NewFolder\\GACreateGeostatisticalLayer5"#GALayerToPoints2 = "C:\\Users\\nkondapalli\\Documents\\ArcGIS\\Default.gdb\\GALayerToPoints5"GALayerToGri2 = "C:\\Users\\nkondapalli\\Desktop\NewFolder\\GALayerToGri2"GALayerToPoints2_PointToRast = "C:\\Users\\nkondapalli\\Documents\\ArcGIS\\Default.gdb\\GALayerToPoints5_PointToRast"test2ASCII_TXT = "C:\\Users\\nkondapalli\\Desktop\NewFolder\\"#test2ASCII.TXT"numFiles=5# Process: Create Geostatistical Layerfor i in range(2,3):#numFiles+1): print "C:\\Users\\nkondapalli\\Desktop\NewFolder\\RG1intermediate_point_%d.shp X=Shape Y=Shape F1=DATA;C:\\Users\\nkondapalli\\Desktop\NewFolder\\TR1intermediate_point_%d.shp X=Shape Y=Shape F1=DATA"%(i,i) arcpy.GACreateGeostatisticalLayer_ga(CoKriging, "C:\\Users\\nkondapalli\\Desktop\NewFolder\\RG1intermediate_point_%d.shp X=Shape Y=Shape F1=DATA;C:\\Users\\nkondapalli\\Desktop\NewFolder\\TR1intermediate_point_%d.shp X=Shape Y=Shape F1=DATA"%(i,i), GACreateGeostatisticalLayer1) # Process: GA Layer To Points #arcpy.GALayerToPoints_ga(GACreateGeostatisticalLayer1, TR1intermediate_point, "", GALayerToPoints2)# Process: GA Layer To Grid arcpy.GALayerToGrid_ga(CoKriging, GALayerToGri2, "0.063", "1", "1")# Process: Point to Raster #arcpy.PointToRaster_conversion(GALayerToPoints2, "OBJECTID", GALayerToPoints2_PointToRast, "MOST_FREQUENT", "NONE", "0.05")# Process: Raster to ASCII print 'print to file : '+'file%d.txt'%i arcpy.RasterToASCII_conversion(GALayerToGri2, test2ASCII_TXT+"file%d.txt"%i)and this is the error:C:\Users\nkondapalli\Desktop\NewFolder\RG1intermediate_point_2.shp X=Shape Y=Shape F1=DATA;C:\Users\nkondapalli\Desktop\NewFolder\TR1intermediate_point_2.shp X=Shape Y=Shape F1=DATATraceback (most recent call last): File "C:\Users\nkondapalli\Desktop\NewFolder\testErik3.py", line 36, in <module> arcpy.GALayerToGrid_ga(CoKriging, GALayerToGri2, "0.063", "1", "1") File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\ga.py", line 1341, in GALayerToGrid raise eExecuteError: Failed to execute. Parameters are not valid.ERROR 000732: Input geostatistical layer: Dataset C:\Users\nkondapalli\Desktop\NewFolder\Krigingmodel2_1.xml does not exist or is not supportedWARNING 000725: Output surface raster: Dataset C:\Users\nkondapalli\Desktop\NewFolder\GALayerToGri2 already exists.Failed to execute (GALayerToGrid).It looks like the error is in the xml file. We actually modified it, inserting optimize = "ByCrossvalidation" and changing the options auto to "true". Any clue?Thanks!Michele
newDataset = arcpy.GeostatisticalDatasets("C:\\temp\\myXML.xml") newDataset.dataset1 = "C:\\temp\\myFeatureClass1.shp" newDataset.dataset1Field = "myField1" arcpy.GACreateGeostatisticalLayer_ga("C:\\temp\\myXML.xml", newDataset, "outGALayer1")
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.