I have DEM data that is in a GCS (NAD 1983 (CSRS)) with vertical units in meters. My understanding is that before doing any processing on a raster, the horizontal and vertical units should be made to match, so the DEM should be projected into a PCS with units in meters as well. However, based on my reading this applies mainly when you want derivatives of the elevation data (i.e. slope, aspect).

If I wanted to compute zonal statistics on a DEM, is it considered best practice to first project the data or to compute the zonal statistics directly on the raw data despite a mismatch in projections?

  • @user2856 thank you, that makes sense. So if I had a fishnet grid and wanted an average elevation in each 'cell', it would be best to do the calculation directly on the raw data so as not to introduce additional error by first reprojecting?
    – David
    Dec 17, 2021 at 18:08

2 Answers 2


You only need vertical & horizontal coordinates in the same units when the calculation actually requires that both are in the same units. For example, calculations of slope (rise/run or vertical/horizontal) or aspect which is derived from slope.

Other examples of when you might need to reproject are when you need projected (X, Y cartesian), not geographic (lon, lat degrees) horizontal units for the calculation, such as density (values per unit area) or cost/path/euclidean distance. Obviously here the raster values are not vertical or elevation values and so don't (and can't) be in in the same units

If you're just draping a polygon or raster region over raster values to get some summary stats, you don't need to reproject. Indeed by reprojecting, you are introducing an additional source of error.


Generally, this is not needed, and (as another answer specifies) may even introduce errors.

There are 2 major exceptions to this:

  1. (also as already stated) If your processing computes slopes or other unit ratios, it's important XY and Z both be in projected coordinates. So avoid EPSG:4326 (lat/long) and similar in particular. Also avoid EPSG:3857 at nonequatorial latitudes since the scale is deformed and so e.g. slopes will be incorrect.

  2. If your area of interest is large, and so projected map scale matters, averages and other frequency-related calculations can be biased, since you probably want them weighted by area. You should therefore make sure you're using an equal area projection. And in particular, EPSG:3857 (or other conformal projections) would be a bad choice, given the scale (and area) varies signficantly over different latitudes. Note if your area of interest is small, this is immaterial.

In both of the above instances, you should reproject. Finally, in line with the general "don't reproject" advice:

  1. Reprojection is a bad idea if your processing does any sort of local kernel processing (counting neighbours, etc.). This includes terrain roughness calculations. This is since reprojection will slighly deform the grid (via averaging or dropping some neighbour cells and duplicating others) which may selectively bias these calculations where resampling occurs in the neighbourhood of a given cell.
  • Good point with the larger area of interest
    – user2856
    Dec 22, 2021 at 5:14

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.