Scripting IDW: optimize power parameter?

4323
6
Jump to solution
01-15-2013 09:20 AM
PhilMorefield
Occasional Contributor III
When performing IDW through the GA toolbar, you can simply click the "Optimize Power value" button. Any chance this is done for you when you leave this parameter blank in a script? If not, is there a way to get the optimized value?
0 Kudos
1 Solution

Accepted Solutions
SteveLynch
Esri Regular Contributor
Phil

1) run the IDW Geostat geoprocessing tool and specify an output geostatistical layer name (eg. galyr) and don't specify an output raster name
2) run the SetModelParameter geoprocessing tool with
- Input geostatistical model source = galyr (the ga layer you created above)
- Parameter XML Path = /model/value[@name='Power']/@auto
- Parameter value = true
- Output model = c:\temp\optimized.xml
3) run the Create Geostatistical Layer geoprocessing tool with
- Input geostatistical model source = c:\temp\optimized.xml
- Input dataset = the feature class and field you used in #1 above
- Output geostatistical layer = optimizedIDW

This new GA layer (optimizedIDW) with have an optimized power value for the dataset and field supplied in #3 and to convert it to raster use GALayerToGrid geoprocessing tool.

Regards
Steve

View solution in original post

0 Kudos
6 Replies
SteveLynch
Esri Regular Contributor
Phil

1) run the IDW Geostat geoprocessing tool and specify an output geostatistical layer name (eg. galyr) and don't specify an output raster name
2) run the SetModelParameter geoprocessing tool with
- Input geostatistical model source = galyr (the ga layer you created above)
- Parameter XML Path = /model/value[@name='Power']/@auto
- Parameter value = true
- Output model = c:\temp\optimized.xml
3) run the Create Geostatistical Layer geoprocessing tool with
- Input geostatistical model source = c:\temp\optimized.xml
- Input dataset = the feature class and field you used in #1 above
- Output geostatistical layer = optimizedIDW

This new GA layer (optimizedIDW) with have an optimized power value for the dataset and field supplied in #3 and to convert it to raster use GALayerToGrid geoprocessing tool.

Regards
Steve
0 Kudos
AndrewMartinez6
New Contributor

I know this is years later, but I recently tried to do this in model bulider, and am not able to use the dataset as you described in step 3. If I try to connect the feature class, it only allows me to use that as input for environment variables. Has something perhaps changed since you wrote this or is this just not possible in model builder?

0 Kudos
PhilMorefield
Occasional Contributor III
Perfect. Thanks Steve.
0 Kudos
SteveLynch
Esri Regular Contributor

Andrew

In Modelbuilder;

  • right click on the Create Geostatistical Layer tool
  • Choose Make Variable -> From Parameter
  • select Input Geostatistical model source (this is for c:\temp\optimized.xml)
  • Choose Make Variable -> From Parameter
  • select Input dataset(s)  (this is for the dataset and the field)
0 Kudos
AndrewMartinez6
New Contributor

Steve, thank you for responding, but my input data set would be an intermediate (and managed) feature class developed by earlier steps in the model process. So would you say my only option would then be to save that intermediate data set to a permanent file geodatabase just so it can be referenced by the Create Geostatistical Layer tool? 

0 Kudos
SteveLynch
Esri Regular Contributor

Andrew

Because of the dynamic nature of a geostatistical layer the input datasets control is made up of a dataset (or many in the case of cokriging for example) and a field(s). So, you could persist your features using CopyFeatures or you could look into creating a script tool (submodel) that uses the GeostatisticalDatasets class.

You could also not use Modelbuilder and create a Python script tool.

-Steve