I did an interpolation of soil pH using 232 data points in geostatistical analyst with IDW, RBF and ordinary kriging. For all 3 methods, the range of pH values change (become smaller) after I export the geostatistical layers to raster. I understand that has something to do with the way values are calculated per cell in raster, but is there a way I could keep the pH range in the output raster?
[GIS] Why do the range of values change when I export geostatistical layer to raster
arcgis-desktopgeostatistical-analystinterpolation
Related Solutions
Make sure that you have the Geostatistical Analyst extension turned on, as well as the toolbar. If the Geostatistical Analyst toolbar is turned on but the extension is turned off, then all of the options will be greyed out. Customize->Toolbars->Geostatistical Analyst and Customize->Extensions->Geostatistical Analyst. This tool needs to be activated in both locations to operate properly.
Unless i missunderstand you this should work:
- Intersect Fishnet and contours
- Calculate a column of area-weighted values (value*shapearea)
- Dissolve by fishnet ID and sum the area-weighted values
- Calculate total averages by Dividing with shape areas
You can do this manually, with ModelBuilder or using the Python window and code below (change the four lines as indicated):
import arcpy
arcpy.env.overwriteOutput=1
fishnet = r'C:\Default.gdb\fishnet_4km' #Change to match your data
contours = r'C:\Default.gdb\contour' #Change to match your data
valuecolumn = 'AvgValue' #Change to match your data
outfc = r'C:\Default.gdb\fishnet_with_averages' #Change to match your data
#Intersect fishnet and contours
tempfc=r'in_memory\intersect'
arcpy.Intersect_analysis(in_features=[fishnet,contours], out_feature_class=tempfc)
#Calculate areaweighted values per intersection
arcpy.AddField_management(in_table=tempfc, field_name='AvgArea', field_type='DOUBLE')
with arcpy.da.UpdateCursor(tempfc,['AvgArea',valuecolumn,'SHAPE@AREA']) as cursor:
for row in cursor:
row[0]=row[1]*row[2]
cursor.updateRow(row)
#Dissolve by fishnet ID and calculate sum of areasums
fishnetID = '{0}{1}'.format('FID_',arcpy.Describe(fishnet).name)
arcpy.Dissolve_management(in_features=tempfc, out_feature_class=outfc,
dissolve_field=fishnetID,
statistics_fields=[['AvgArea','SUM']])
arcpy.AddField_management(in_table=outfc, field_name='Areaweighted_average', field_type='DOUBLE')
#Calculate areaweighted average
with arcpy.da.UpdateCursor(outfc,['Areaweighted_average','SUM_AvgArea','SHAPE@AREA']) as cursor:
for row in cursor:
row[0]=row[1]/row[2]
cursor.updateRow(row)
Best Answer
The conversion of a geostatistical model to a raster will discretize the support (creating pixels). The value of the pixels will be defined at their center, so if the maximum/minimum is not at the center of a pixel, it will not be stored in the raster. If you want to be closer to the values, you will need to take a smaller pixel size.