Select to view content in your preferred language

Automating the Creating of Variograms

2647
7
Jump to solution
07-17-2013 12:38 PM
BruceFriesen
Emerging Contributor
Hi guys,

I have been using ArcGIS off an on for a while so I have some knowledge, but I have never had to script or automate anything. Now I am in a situation where I need to calculate moving window variograms for many feature classes. I am able to create the geostatistical models and layers to get the parameters I want for a single shapefile, but I cannot figure out how to automate this. Should I be using the Model Builder and how can I handle many input files and saving the variogram parameters?

Bruce
0 Kudos
1 Solution

Accepted Solutions
EricKrause
Esri Regular Contributor
This can be done in ModelBuilder or in Python.

You only need to make a single template with the Geostatistical Wizard.  This template will define the type of kriging (Simple, Ordinary, etc), the semivariogram model (Stable, Spherical, etc), and any advanced options such as transformations and anisotropy.  When you click Finish in the Wizard, choose to Save the xml model source in a convenient location.  This will be the model source that you will use for all your datasets.

Then you need to make a Python or ModelBuilder script that iterates through all your datasets in Moving Window Kriging while keeping the same xml model source.

If you need help with Python or ModelBuilder, you should contact Esri Support Services or ask on some forums about Python or MB.

View solution in original post

0 Kudos
7 Replies
SteveLynch
Esri Regular Contributor
0 Kudos
BruceFriesen
Emerging Contributor
I've got that bit under control. I'm having trouble figuring out how to use a template to process thousands of shapefiles.
0 Kudos
SteveLynch
Esri Regular Contributor
Bruce

What version (and Service Pack) of ArcGIS are you using?
What interpolation method are you using?
What values are you trying to interpolate?

Have you tried something like;
1) create a GA layer using the Wizard
2) use CreateGeostatisticalLayer tool (using layer created above and 1st of 1000's of shapefiles)
3) GALayerToGrid to create output raster using layer created in step 2
4) repeat steps 2-3

Steve
0 Kudos
BruceFriesen
Emerging Contributor
What version (and Service Pack) of ArcGIS are you using?
ArcGIS 10.1 without a service pack.
What interpolation method are you using?
Moving window kriging
What values are you trying to interpolate?
I am interpolating precipitation at a station where each day is another shapefile. The stations are points in the shapefile and the measured amount is in the attribute table. Because I am using moving window kriging I also have another shapefile of about 6 points where I want the variogram (or window) calculated.

All I want when everything is finished is the coefficients of the fitted variogram (range, sill, nugget, major axis etc) at each window for each day.

Thank you for your patience and help.
0 Kudos
SteveLynch
Esri Regular Contributor
Create a raster covering your area (use a cell size that will produce about 100 columns or rows), use CreateRandomRaster
then convert this raster to points (RasterToPoint). This will be you feature class where the predictions will be produced.
Use this as your Input Point Observation Locations file. The output feature class will have all the stats you require.
For more detail, use a finer cell size, when creating the Random raster.
0 Kudos
BruceFriesen
Emerging Contributor
Going back to my original question, I can produce the results I want by the methods you are describing for a single day (shapefile) as input. I do not know how to accomplish this in an iterative fashion for many different input shapefiles. The input I am referring to here is the data being interpolated, since the points where I want the predictions will remain constant through the iterative process. I have so many input files that creating a template and using it manually for each one is not feasible, which made me think I should be using the Model Builder or Python, but I cannot get that to work.
0 Kudos
EricKrause
Esri Regular Contributor
This can be done in ModelBuilder or in Python.

You only need to make a single template with the Geostatistical Wizard.  This template will define the type of kriging (Simple, Ordinary, etc), the semivariogram model (Stable, Spherical, etc), and any advanced options such as transformations and anisotropy.  When you click Finish in the Wizard, choose to Save the xml model source in a convenient location.  This will be the model source that you will use for all your datasets.

Then you need to make a Python or ModelBuilder script that iterates through all your datasets in Moving Window Kriging while keeping the same xml model source.

If you need help with Python or ModelBuilder, you should contact Esri Support Services or ask on some forums about Python or MB.
0 Kudos