Hi Steve,
I am trying to automate the cokriging process to test the different kriging parameters. I have created a geostatistical layer with the wizard and now I am trying to change the parameters with the Set Model Parameters Tool, however I am having trouble with the Xpath for some of the parameters.
Here is my code for setting the parameters:
params = "/model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'Anisotropy'];\
/model[@name = 'Kriging']/model[@name = 'Variogram']/model[@name = 'VariogramModel']/value[@name = 'ModelType'];\
/model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'LagSize'];\
/model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'NumberOfLags']"
The Xpath for the last two (LagSize and NumberOfLags) work fine, however the first two (Anisotropy and ModelType) does'nt work.
Can you show me where I went wrong?
Additionally, I am trying to print the RMSE results of the cross validation tool with some python script I found on the ESRI resource center, but it doesn't work:
results = arcpy.CrossValidation_ga(GACreateGeostatisticalLayer2)
print "RMSE: " + str(results.rootMeanSquare)
Any ideas?
Best regards,
Gerrit
(Stellenbosch)
Gerrit
Please email me the XML file, I.e after you hit Finish in the Wizard then on the MethodReport dialog choose Save and send me (slynch@esri.com) this XML file.
For your second question,
GACreateGeostatisticalLayer2 is the name of the Geostatistical layer and not a variable I guess and therefore it should be in quotes, viz.
results = arcpy.CrossValidation_ga("GACreateGeostatisticalLayer2")
-Steve
Hi Steve,
I've send you the XML.
With regard to my second question, I now get this error:
AttributeError: ResultObject: Get attribute rootMeanSquare not found
However, if I use the option to write the results out to the point file it does work.
Best regards,
Gerrit
Thanks for the help!
Here is the final XML...
params = "/model/model[@name='Variogram']/model[@name='VariogramModel']/bool[@name='Anisotropy'];\
/model/model[@name='Variogram']/model[@name='VariogramModel']/enum[@name='ModelType'];\
/model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'LagSize'];\
/model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'NumberOfLags']"
And the assigned values could be 'true;Stable;355.1;10'
I could'nt get the cross validation tool to work, it kept saying that it can't find the attribute rootMeanSquare, but I worked around it by calculating the RMSE from the point output.
Best regards,
Gerrit
Create a cokriging Geostatistical layer, then use this in the Create Geostatistical Layer GP tool and you'll notice from the results posted to results dialog that you are missing a semicolon between the 2 input datasets.
Viz.,
GACreateGeostatisticalLayer "Ordinary Cokriging" "C:\\Data\ca_ozone_pts.shp f1;C:\Data\ca_ozone_pts.shp f2" GAL1
Steve