6

I am looking to assign depth values to each fishnet grid cell that I have by taking the area-weighted average of values from a contour/isopach map.

The map was interpolating using the depths of individual wells using the Geostatistical Analysis tool Inverse Distance Weighting.

Attached see a picture of my example along with the attribute table.

Example

At first I thought that Zonal Statistics as Table tool would be perfect but it would require me to convert to raster first (or even change the output of the IDW tool) but I have read that the conversion to raster is a poor choice (Does IDW interpolation in ArcGIS Geostatistical analyst work as exact interpolation method?). Is there a better method?

8
  • So your contour/isopach map are polygons and your fishnet is also polygons? How many fishnet polygons do you have? Commented Jun 21, 2017 at 18:34
  • Hi Matthew, yes the fishnet are polygons not polylines - and I have 2428 fishnet polygons.
    – Red
    Commented Jun 21, 2017 at 18:41
  • If there is any more information that could be helpful I am more than happy to provide
    – Red
    Commented Jun 22, 2017 at 3:41
  • 1
    Are the dots in your picture the used point data for your interpolation? Afaik IDW is generally used on more regular distributed point data. Especially groundwater tables should be interpolated with TIN for hydrological triangles or with Spline for a smooth surface.
    – Nightwatch
    Commented Jun 23, 2017 at 5:58
  • 1
    @Red desktop.arcgis.com/en/arcmap/10.3/analyze/commonly-used-tools/… = comparison of interpolation methods and examples; de.wikipedia.org/wiki/Hydrologisches_Dreieck = german wiki entry for hydrological triangles, sry but there seems to be no entries in other languages to this topic. The picture should still be understandable.
    – Nightwatch
    Commented Jun 24, 2017 at 13:11

3 Answers 3

6
+50

Unless i missunderstand you this should work:

  1. Intersect Fishnet and contours
  2. Calculate a column of area-weighted values (value*shapearea)
  3. Dissolve by fishnet ID and sum the area-weighted values
  4. 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)

Inputs: enter image description here Output: enter image description here

4
  • +1, this is the approach I would take, be sure to use an equal area projection to do the analysis!
    – bebego
    Commented Jun 26, 2017 at 16:59
  • Thank you for this simple approach. I'm a python novice so I went with model builder and it worked perfectly.
    – Red
    Commented Jun 27, 2017 at 19:18
  • @BenGosack if the region is around 300 miles does the projection still matter? I was using Transverse_Mercator but am out of my element when it comes to projections. For example, my grid shape area varies by .000011...
    – Red
    Commented Jun 27, 2017 at 19:20
  • @Red Short answer is, yes it does matter. If your fishnet was created in the Mercator projection the areas will be the same (or nearly the same). Try projecting the fishnet to an appropriate equal area projection and look at the variation. This will give you an idea of how much distortion you can expect in your analysis.
    – bebego
    Commented Jun 27, 2017 at 20:00
2

The tool you need is Tabulate Intersection. You'll need to use a pivot table to transform the outputs to have one record per cell, and then join these results back to your fishnet feature class. The process is documented on the link above.

This can use a lot of memory, so make sure your files are local. A simple way to make it easier on your machine would be to split up the fishnet, and run it as a batch process. For more discussion and alternative python/R scripts see here

2
  • This is very helpful. I am only having trouble with the inputs for the Pivot Table but I will let you know I this option works for me.
    – Red
    Commented Jun 25, 2017 at 1:29
  • @Red Say if you need a hand with that. It can be a little confusing at first.
    – RoperMaps
    Commented Jun 25, 2017 at 18:57
2

If I understand well, you should use the raster output of your spatial interpolation and zonal statistics if you want the most precise output. Don't be afraid with the discussion about exactness in Does IDW interpolation in ArcGIS Geostatistical analyst work as exact interpolation method? .

Statistically speaking, an exact interpolator is an interpolator where the interpolated value at the location of an input point is exactly the same as the value of this point. The answer then says that you are rarely exactly at the same location when you have pixels, therefore you will not have exactly the same value for a pixel and the "known" point that is inside this pixel (except in the center).

However, the continuous surface that is interpolated is always measured at the center of each pixel, which are then "exact" with respect to the interpolator. Pixels are therefore a good way to discretize an interpolated surface, and far more precise than polygons in your particular case (the hexagon is probably a circle that is simplified with 6 segments).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.