Many a times, in your analysis, you might need to extract values from rasters based on point locations. The Spatial Analyst extension offers several tools that can do this for you, those being Extract Values to Points, Extract Multi Values to Points and Sample. However, because there are some similarities between them, you may be confused about which one to use. Read on more to find out how to choose the right tool.
Before you start your analysis, let’s ask a few questions:
- Do you want to extract values from a single raster or multiple rasters?
- If the input is a multiband raster, do you want to extract values from the first band or all bands?
- Do you want to append raster values to the input feature class or create a new feature class with the raster values?
- Do you want to append all the input raster attributes to input feature class?
- Do you want to extract exact values or interpolated (resampled) values from input raster or rasters?
Answering such questions before hand will help you determine the best way to perform your analysis.
Which tool to choose for your analysis?
Let’s take these questions and have a look at how Extract Values to Points, Extract Multi Values to Points and Sample tools are different from each other.
Based on the information from this table you can decide which tool to use. Apart from that, a few other things to keep in mind are:
- Extract Values to Points only takes a single raster input. Even when you input a multiband raster, it will only process on the first band by default or the single band defined by you. The raster values are stored in a predefined field called “RASTERVALU”.
- Extract Multi Values to Points, modifies the input feature by appending the raster values to the attribute table of the input feature. The raster values are stored in the field with the same name as the input raster. However, you can specify the field name with this tool, if you wish.
- For Sample, the raster values are stored at the field with the same name as the input raster, but you cannot specify the field name. Currently, this is the only extraction tool that support multidimensional raster.
Let’s look at some use cases.
Use Case 1. Extract values from single raster at point locations
Say you have some meteorological observation sites, and you would like to know the elevation of these locations.
For this case, the input would be a single elevation raster. You could use any of these three tools, since they all support single raster. Which one to use depends on what kind of output you need. For example, if you need to attach the elevation values to the input feature class’s attribute table, just use Extract Multi Values to Points.
Use Case 2. Extract values from multiple rasters at point locations
Assume, you want to learn the impact of corn production factors using regression. You have sampling locations, and you would like to extract the values of several factors at those locations, such as, temperature, soil moisture, plant population and Nitrogen supply.
For this case, you would need to extract values from multiple rasters at point locations. Both Extract Multi Values to Points and Sample can do this for you, so use your preferred output format, feature or table, to pick the one to use.
In addition, you might consider the following for your analysis:
- If you need to specify a certain band, for all these tools, you could expand the multiband raster and select the specified band when you are defining the input raster.
- If any of the points fall in NoData cells, for all these three tools, the points will be assigned NoData.
- If any of the points are located outside of the raster extent, for all these three tools, the points receive NoData.
- If you need to process just a subset of points, you can make a feature selection, or set an environment extent or mask. If you make a selection, Extract Values to Points would create a new feature with only the selected points. Extract Multi Values to Points would update the input feature, and Sample would output a table, by assigning values to the selected points, while unselected points would receive NoData for both these tools. If you use an environment extent or mask, Extract Values to Points will only output the number of points that fall within the processing extent/mask, while Extract Multi Values to Points and Sample would assign NoData to the points that fall outside the processing extent/mask.
Now you know how to best choose the appropriate extraction tool for your analysis. Let us know what you think about it.