GEOG 487
Environmental Challenges in Spatial Data Science

Part II: Interpolate Point Data to a Continuous Raster

PrintPrint

Part II: Interpolate Point Data to a Continuous Raster

In Part II, we will use the Spatial Analyst extension tools to interpolate the carbon sequestration data we calculated for each plot to the entire forest. We will run the same interpolation tool several times to see how altering the extent, mask, and cell size settings affect the results. We will start by accepting all default settings. Then we will change the settings one at a time to see how each one affects the results.

  1. Look for Trends in the Data

    1. Remember from Lesson 3 that it is wise to be aware of trends and spatial patterns in your data before you start to modify it using automated tools.
    2. Open the "Plots_carbon" attribute table and explore the data. You may need to set the alias of the Cnt_PLOTID again.
      lightbulb

      Do some plots have more trees than others? Is there a lot of variation in the total amount of carbon or carbon per square meter value? If so, why do you think this may occur? Hint: Look at an aerial image basemap.

       

    3. Change the symbology to Proportional Symbols. Use the "c_lbsqm" as the Field value. Accept the remaining defaults.
      lightbulb

      Do you see any spatial patterns in the data? For example, do some areas of the forest have higher values than others? If so, why do you think this may occur?

       

  2. Explore Spatial Analyst Toolbox.

    1. Go to the Analysis tab, in the Geoprocessing group select Tools. screenshot of Tools icon
    2. In the open Geoprocessing pane, select Toolboxes screenshot of Toolboxes icon and scroll to the Spatial Analyst Tools, and browse through the available tools. We will be using these tools for the remainder of this course.
  3. Interpolate Data Using All Default Settings

    Remember from the Background Information section that the Spatial Analyst tools are governed by user-specified settings. Two of the most common errors when using Spatial Analyst tools are to either completely ignore these settings, or to set them improperly. Let’s try to interpolate our data using all of the defaults and see what our results look like.

    information icon

    Make sure you double-check ALL environment settings before running ANY tools in Spatial Analyst! The program often resets your cell size, extent, and mask to program or data layer defaults.
     

    1. Within the Analysis tab, go to Tools > Toolboxes > Spatial Analyst Tools > Interpolation > IDW. Use the settings below to interpolate the carbon per square meter values. Save the output raster in your L6Data folder and name it "default." Click Run.
       
      Settings. Input point features: Plots_carbon, Z value field: c_lbsqm, Output raster: default, cell size: 0.879999, search radius: variable
      information icon

      Click the Show Help >> button to help define particular input parameters.

      You can review the specific input and environment settings you used in the Analysis tab, Geoprocessing group > History. This can be helpful if you are not sure if you made a mistake somewhere along the way during a complex workflow.
       

      Screenshot IDW (Spatial Analyst Tools). Highlights environments tab and that default environment settings were used
    2. Change the symbology of the default raster as shown below (5 classes, colors light to dark red).
      Screenshot of symbology. Method: equal interval, Classes: 5, color scheme: gradient red
      stop icon

      Make sure you have the correct answer before moving on to the next step.

      If your map does not match the example below, go back and redo the previous step.
       

      Screenshot of example map. If you need help viewing this image to distinguish whether your project is correct please contact the instructor
    3. Compare the results with the "Plots_carbon" shapefile. Areas near plots with high carbon values should be darker than areas near plots with low carbon values. Confirming your output results assures you that you selected the correct input dataset and field to interpolate.
    4. Notice how the interpolated raster does not match the forest boundary, how the shape of the output grid is a perfect rectangle, how the extent of the raster matches that of the smallest rectangle that can contain all of the plot points, and that the cell size is 0.87999… meters.
    5. Why did this occur? Let’s take a look at some of the environment settings utilized by Spatial Analyst to find out. Go to Geoprocessing > Environments. As noted earlier in this course, environment settings are the system-wide default settings that are used by every tool. Spatial Analyst utilizes Workspace, Output Coordinates, Processing Extent, Raster Analysis, and Raster Storage settings.
    6. Read the embedded help articles for:
      1. Processing Extent > Extent
      2. Raster Analysis > Cell Size
      3. Raster Analysis > Mask
      4. Raster Storage > Pyramid (scroll down)
        Screenshot shows different sections as described above the image. Including processing extend and raster analysis
    7. Pyramids allow for the rapid display of large raster datasets at multiple scales. While this may prove useful for very large datasets, creating pyramids has two important drawbacks. First, because of its design, it will generalize data as the scale gets larger, which will reduce the visible accuracy of the displayed data. Second, because of this generalization, layouts created at large scales may not properly represent the actual data, and may appear coarser than it actually is.
    8. I recommend NOT creating pyramids unless working with a particular dataset significantly degrades the performance of ArcGIS. For this course, we will disable pyramid creation when we set the Spatial Analyst environment settings. To do this, go to Analysis tab, Geoprocessing group,  Environments > Raster Storage (scroll down), and uncheck Build. Click OK to save this setting.
      Screenshot Raster Storage clicking calculate and not build
      lightbulb icon

      What is the default setting for analysis extent?

      What is the cell size of the  "default" raster we created? Why? 

       

      information icon

      Raster Attribute Tables

      You may notice that the option to open the attribute table of the "default" raster is grayed out. ArcGIS Pro only builds raster attribute tables if certain conditions are met. One of the conditions is that the values in the raster have to be integers. Since the values in our raster have decimals, it is not possible to view the attribute table. 
       

  4. Interpolate Data – Set Extent

    Now that we’ve explored the default settings, let’s see what happens if we alter just the extent settings. Unlike vector files, rasters will always have the shape of a perfect rectangle. The size and location of the rectangle is defined by its extent.

    1. Within the Analysis tab, Geoprocessing group go to Tools > Toolboxes > Spatial Analyst Tools > Interpolation > IDW.
    2. Name the output raster C:\GEOG487\L6Data\forest_extent.
    3. Notice the default cell size is currently listed as 0.879999994163401.
    4. There is an oddity within ArcGIS where it does not apply all of the global environment settings from the Analysis tab,  Geoprocessing group > Environments to some tools within Geoprocessing Toolbox. We’ll need to set the extent settings using the Environments option within the IDW tool itself. Click on Environments > Processing Extent, choose "Same as Layer Forest_Boundary" as the extent.
      Screenshot Geoprocessing IDW parameters window
      Screenshot of Geoprocessing IDW Environments Output Coordinates window
    5. Notice how the output cell size changed to “1.17340837377682.” Make sure to review the embedded help topic to understand why this happened.
    6. To keep the output rasters consistent throughout the lesson, we need to manually override the cell size setting in Parameters. Copy and paste 0.879999994163401 into the cell size input and click Run.
      stop icon

      Make sure you have the correct answer before moving on to the next step.

      If your map does not match the example below, go back and redo the previous step.
       

      Screenshot Layer Properties showing cell size for X and Y are the same
      Screenshot Extent. Left and right are close to the same and top and bottom are close to the same
    7. Change the symbology of the forest_extent raster as we did in Step 3b, except use light to dark blue for the color ramp.
    8. Compare the "forest_extent" raster to the "default" raster. You may need to rearrange the files in the Contents pane. Notice how the extent of the "forest_extent" raster matches that of the smallest rectangle that can contain the forest boundary polygon.
    9. Repeat Step 4, except use the "Parcel_Boundary" file as the extent. Make sure you use the same cell size as the default and forest-extent rasters. Name the output raster "parcel_extent."
    10. Change the symbology just as we did previously, except use an orange color scale. Compare the output with the parcel boundary. Save your map.
      lightbulb

      How do the extents of the "parcel_extent," "forest_extent" and "default" rasters compare?


       

  5. Interpolate Data – Set Mask

    Now, let’s see what happens if we alter the mask and extent settings. Even though all rasters are defined as perfect rectangles, you can still represent your data as a sinuous shape. The computer creates this illusion by assigning cells outside the sinuous shape values of "NoData." There is not a direct equivalent to this concept in vector files.

    1. Within the Analysis tab, Geoprocessing group go to Tools > Toolboxes > Spatial Analyst Tools > Interpolation > IDW.
    2. Change the output name to “for_msk_ext.”
    3. Click on Environments > Processing Extent > choose "Same as layer Forest_Boundary" as the extent.
    4. Within Raster Analysis > select Forest_Boundary as the Mask. 
    5. Make sure the cell size is 0.879999994163401 under the Parameters. Click Run to run the tool.
    6. Change the symbology as before except use a purple color scale. Compare the output raster to the forest boundary. Your raster should now match the shape and size of the forest boundary polygon.
    7. What happened to the cells outside of the forest boundary? By default, ArcGIS displays raster values of NoData without a color. Change the color of NoData to black on the symbology tab and examine the results.
      Screenshot of Primary Symbology. Under mask tab, Nodata is black
    8. lightbulb

      What would the output raster look like in the following scenario?

      • Mask: forest boundary; Extent: parcel boundary
      • Mask: parcel boundary; Extent: forest boundary
      • Mask: "Plots_carbon" shapefile; Extent: forest boundary
  6. Interpolate Data – Set Cell Size

    In Step 3, we learned that the default cell size will depend on the input data. If you are using one or more rasters as inputs, the cell size will default to the coarsest raster resolution. If you are using a vector file, it will calculate the cell size based on the extent of the file to create 250 cells. The default for rasters seems appropriate since GIS best practices dictate that you should always go with the cell size of your coarsest input dataset. However, the default for vector files is quite arbitrary.

    How do we choose a more meaningful cell size for our analysis? One rule of thumb is that you don’t want to "create" higher resolution data than what exists in your measured values. We know that the tree data was collected by measuring trees that fell within 10 m diameter circular plots. A cell size of 1 cm would not be appropriate, because we do not know how the data varies at that scale. A cell size of 1,000 m would be too large, since it is larger than our study area. For this project, we will use a cell size of 1 m, since our carbon values are in pounds per square meter.

    1. Within the Analysis tab, Geoprocessing group go to Tools > Toolboxes > Spatial Analyst Tools > Interpolation > IDW.
    2. Change the output name to "carbon1m."
    3. Click on Environments to Set the "Forest Boundary" as the mask and extent.
    4. Change the output cell size to 1. Click Run.
    5. Change the symbology as before, except use a green color scale. Compare the output to the "for_msk_ext" raster. At first glance, the output raster may not look very much different than the "for_msk_ext" raster, since they have the same mask, extent, and very similar cell size settings.
    6. Right-click on the "carbon1m" raster in the Contents pane > Properties > Source. Browse through the available information. Notice the extent and cell size. Compare this information to the properties of the "for_msk_ext" raster as shown on the right.

      "carbon1m" properties
      Screenshot of Raster Information carbon1m properties. Column = 293, rows = 562, # of bands = 1, cell size x = 1. cell size y = 1
        "for_msk_ext" properties
      Screenshot of Raster Information for_msk_ext properties. Column =333, rows =638, # of bands = 1, cell size x =0.8799. cell size y =0.8799
  7. Interpret Results – Calculate Carbon for Entire Study Area

    Now that we have an understanding of how the spatial analyst environment settings function, we can return to our original question. We want to figure out how much carbon the study forest sequesters. To accomplish this, we will use the "Zonal Statistics" tool in Spatial Analyst. This tool allows us to calculate statistics of the cell values of one raster (e.g., carbon1m) within zones specified by another file (e.g., forest boundary). We will use it to sum the carbon values in each cell to create a total for the entire forest.

    1. Within the Analysis tab, Geoprocessing group go to Tools > Toolboxes > Spatial Analyst Tools > Zonal > Zonal Statistics as Table. Use the settings below to find the total carbon for the forest. Name the output table "carbon1m_sum" in your L6 folder.
      Input raster: Forest_Boundary, zone field: Name, Input value raster: carbon1m, output table: carbon1m_sum, ignore Nodata, statistic type sum
    2. After you click Run, the summary table will appear in the Contents pane. Right-click to Open the table. Notice the field "SUM." This value represents the total carbon in the forest. Close the table.
    3. Notice that this table can be joined to the "Forest_Boundary" layer since they share the field "Name". You may find it useful to join these tables together if you wish to visually map the zonal statistics.
      information icon

      ArcGIS may not show all the digits in a table by default. If your numbers do not match the numbers in the quiz, expand the columns in your table to display all the digits.

    4. One credit is earned for each metric ton (mT) of carbon sequestered. How many carbon credits does the study forest qualify for? Note that 1 metric ton = 2,204.6 lbs.
      information icon

      The monetary value of each carbon credit fluctuates based on the current market conditions. Check out the more information about the California’s cap and trade system at Center for Climate and Energy Solutions(C2ES).

      information icon

      One of the main take away points from this lesson is that Spatial Analyst is a modeling tool. Models don’t give exact final answers; rather they give you estimates of reasonable answers based on a set of assumptions.

      Environments settings allow you to easily alter the underlying assumptions of your model (cell size, mask, extent) and then quickly recalculate your results.

      Selecting environment settings in Spatial Analyst tools can be confusing and seem somewhat arbitrary. If you don’t know which Environments setting you should use for a particular scenario, you can try experimenting with a variety of options. This type of sensitivity analysis will help you understand how changing model assumptions affect your final results.

    That’s it for the required portion of the Lesson 6 Step-by-Step Activity. Please consult the Lesson Checklist for instructions on what to do next.

    Try This!

    Try one or more of the activities listed below:

    1. In Lesson 6, we used the defaults for many of the input parameters of the Interpolation Tool such as "z value field," "power," and "search radius type." Alter some of these parameters to see how they affect your results.
    2. There are several other interpolation methods to choose from in addition to Inverse Distance Weighted, such as "Spline" and "Kriging." Explore some of the other options to see how they affect your results.
    3. Export the study boundary to a KML file using Toolboxes > Conversion Tools > KML > KML to Layer. Open the KML file in Google Earth, zoom to the study boundary, and explore the historical imagery for the study site.

    Note: Try This! Activities are voluntary and are not graded, though I encourage you to complete the activity and share comments about your experience on the lesson discussion board.