Select to view content in your preferred language

Introducing the new resolution preserving cell size projection method

1646
5
05-06-2019 04:56 PM
SarmisthaChatterjee
Esri Contributor
3 5 1,646

ArcGIS Pro 2.3 and ArcMap 10.7 Spatial Analyst tools now support a new environment, the Cell Size Projection Method, to control the calculation of the output raster cell size when datasets are projected during tool execution. To learn more about projections, see Coordinate systems, projections, and transformations.

In previous software versions, the cell size was converted using a linear unit conversion when projecting from a Projected Coordinate System (PCS) to another PCS or an angular unit conversion when going from Geographic Coordinate System (GCS) to another GCS. So, projecting a 30 meter raster dataset from UTM zone 10N to WGS84 Web Mercator would continue to use 30 meter as the output cell size. When projecting from GCS to PCS or vice versa, previous versions took an average cell size based on the ratios of diagonal lengths in source and destination projections. Therefore, this method, currently exposed as the ‘convert units’ method simply copied the cell size from input to output, changing units if necessary.

This approach has some limitations:

  • It does not account for distortion when projecting from one PCS to another PCS (1 projected meter in, say, a UTM zone at a given location may not cover the same ground distance as 1 projected meter at the same location in an Albers projection).
  • When computing the ratios of diagonal lengths, the behavior of the projection at only the four corner points was used. This may have introduced excessive distortion, depending on the projection and the extent.

The two new methods: ‘preserve resolution’ and ‘center of extent’ both are intended to calculate a projected cell size that doesn’t change the ground distance of the cell, thus avoiding unnecessary resampling during an implicit projection operation happening as a Spatial Analyst tool or a feature to raster conversion tool executes. You should use the ‘center of extent’ method when you know the geographic location where your cell size is most accurate. If you use this method, you can use a raster with a small extent in that same area as the cell size source or create a temp raster ‘around’ that location and use that as the cell size source. If you are unsure, use the ‘preserve resolution’ method. To learn more about the three cell size projection methods see How the Cell Size Projection Method environment setting works.

If you do not know at which specific geographic location your cell size is best but want to improve on the ‘convert units’ method when a projection is involved while working with Spatial Analyst tools, you can use the ‘preserve resolution’ method.

Why use the resolution preserving cell size projection method?

In the ‘preserve resolution’ method the same number of square cells as are in the original extent are preserved in the projected extent. The output cell size is calculated based on the ratios of the areas of the projected extent to the original extent. This approach is based on how Esri software currently chooses a cell size when moving from a camera image coordinate system to a geodetic (GCS or PCS) system. This method calculates the average size of a square cell more accurately for all combinations of GCS and PCS than the default ‘convert units’ method.

If the areas of the original rectangular extent and (shape preserving) projected extent are A0and A1, then the areas of the square cells, respectively, are, ca0 = A0/n and ca1 = A1/n

Since the number of cells remains constant for both cases, the ratio of the area of extent to the area of the square cell are equal, A0/ca0 = A1/ca1

Figure 1: Cell size projection using the new ‘preserve resolution’ method

Figure 1: Cell size projection using the new ‘preserve resolution’ method

So, the output cell area is ca1 = (A1/A0) * ca0

and the output cell size is CellSize_projected = √((A1/A0) * ca0)

In this method, the cell size conversion factor is, √(A1/A0)

Let’s look at two examples to see how the ‘preserve resolution’ method picks a better output cell size than ‘convert units’.

Example 1:

Let’s take an elevation raster (R_input), located in Vermont (Figure 2), in a PCS (NAD_1983_StatePlane_Vermont_FIPS_4400) and project it to another PCS (WGS 1984 World Mercator) using the default cell size projection methods, ‘convert units’ (R_out_CU) and ‘preserve resolution’ (R_out_PR). Here both the spatial references are shape preserving, where the input spatial reference is suitable at a state level and the output spatial reference is suitable for the entire world. We will then compare the geodesic distance between the cell centers to determine which method preserves the geodesic distance more accurately.

Figure 2: Location of the input raster (R_Input), its cell boundaries and cell centers.

Figure 2: Location of the input raster (R_Input), its cell boundaries and cell centers.

Before we compare the geodesic distances between the two methods, lets understand what are the different ways a raster is projected in ArcGIS Pro. When you add a raster to the map in ArcGIS Pro, the spatial reference of the map becomes the same as the spatial reference of the raster. For example, if the first layer added has a NAD_1983_StatePlane_Vermont_FIPS_4400 PCS, the map will have the same spatial reference, and all other layers will project on the fly to match this spatial reference. This on-the-fly raster projection is meant for a richer display experience but does not preserve the raster structure (different cells can have on-the-fly-projected different sizes, rotations, and distortions). However, when you project a raster using the Project Raster tool or specifying the Output Coordinate System environment of a geoprocessing tool, the raster is actually  projected into a new raster structure (every cell is an identical rectangle in the output spatial reference, with sides parallel to the coordinate system axes). When measuring geodesic distance for the comparison of the cell size projection methods, it is recommended to use the actual projected raster instead of the raster that is projected on the fly.

In figure 3, the cell size of the input raster, R_input is 30 meters. This is approximately the same as its geodesic ground distance, which you can find out using the Measure tool in ArcGIS Pro.

Figure 3: Cell boundaries of R_input, cell centers of R_input, R_out_CU, R_out_PR and the geodesic distance between the cell centers. To overlay the points, the cell centers have been projected back to the spatial reference of R_input for comparison.

Figure 3: Cell boundaries of R_input, cell centers of R_input, R_out_CU, R_out_PR and the geodesic distance between the cell centers. To overlay the points, the cell centers have been projected back to the spatial reference of R_input for comparison.

When the raster is projected using the ‘convert units’ methods, the projected cell size of the output raster, R_out_CU remains 30 meters, but 30m in WGS 1984 World Mercator is a much smaller distance on the ground, 21 meters. So, raster projection using the ‘convert units’ method has unnecessarily increased the resolution of the output raster. If we were projecting in the opposite direction (starting from WGS 1984 World Mercator), then we would have lost a significant amount of raster data. When the same raster is projected using the ‘preserve resolution’ method, its cell size becomes 42 meters and the geodesic ground distance remains 30 meters, which is the same as the geodesic distance of the input raster.

Example 2:

In this example, we will project from a UTM zone to its adjacent zone, which can happen when mosaicking together many different DEMs for a larger (state sized) area. In figure 4, let’s take a raster (R_input2) in WGS 1984 UTM Zone 11N and project it to its adjacent zone WGS 1984 UTM Zone 12N, creating output (R_out_CU2) and (R_out_PR2) for ‘convert units’ and ‘preserve resolution’ respectively. From here we will again compare the geodesic distance between the cell centers to determine which method preserve the geodesic distance more accurately.

Figure 4: Cell boundaries of R_input2, cell centers of R_input2, R_out_CU2, R_out_PR2 and the geodesic distance between the cell centers. To overlay the points, the cell centers have been projected back to the spatial reference of R_input2 for comparison.

Figure 4: Cell boundaries of R_input2, cell centers of R_input2, R_out_CU2, R_out_PR2 and the geodesic distance between the cell centers. To overlay the points, the cell centers have been projected back to the spatial reference of R_input2 for comparison.

The cell size for the input raster, R_input2 is 30 meters, which is approximately the same as the geodesic ground distance in this area. When the raster is projected using the ‘convert units’ method, the cell size of the output raster, R_out_CU2 becomes 30 meters and the geodesic ground distance becomes approximately 31 meters. When the same raster is projected using the ‘preserve resolution’ method, its cell size becomes 28.99 meters, and the geodesic ground distance is 30 meters, which is the same as the input raster.

In both the examples, the ‘preserve resolution’ method seems to preserve the geodesic ground distance between cell centers better than the ‘convert units’ method. Other combinations of input and output spatial references may, of course, show difference between the methods, but overall it is safe to say that the ‘preserve resolution’ Method is a better approach for preserving geodesic distance while projecting datasets.

An important property of the ‘preserve resolution’ method is that the output cell size depends on the location of the dataset. The same combination of input and output spatial reference will yield a different output cell size if the input raster dataset is at a different geographic location. If you need to use one cell size for different raster datasets (for example, processing adjacent DEM tiles), specify one raster dataset to use as the cell size source while performing raster analysis for the tiles.

Next time you use a Spatial Analyst geoprocessing tool or python command to:

  • create an output with a spatial reference different from that of the input dataset,
  • use input datasets with different spatial references,
  • specify an analysis cell size using a dataset with a different spatial reference,

pay attention to the output cell size and consider using either the preserve resolution or center of extent methods. By default, the projection method will do the ‘convert units’, which existed in previous versions of ArcGIS, but as we have seen, this method may unnecessarily increase or decrease the resolution of your valuable raster data.

Additional resources

Handling projections during analysis in Spatial Analyst

How the analysis window is determined in Spatial Analyst

This blog post has been prepared by James TenBrink, senior software engineer in the raster analysis group at Esri, and Sarmistha Chatterjee.

Original post: https://www.esri.com/arcgis-blog/products/spatial-analyst/analytics/introducing-the-new-resolution-p...

5 Comments
DanPatterson_Retired
MVP Emeritus

Interesting blog.  Is there documentation summarizing the findings on a latitudinal basis? particularly for latitudes north of 60 in the northern hemisphere.  Normal issues in this area are associated with projecting between GCS's and UTM or Lambert CC

by Anonymous User
Not applicable

Hi Dan

Let me elaborate on the behavior of the Convert Units (CU) cell size projection method when converting from GCS to PCS or vice versa.

In that case, an average of six cell sizes, determined from the ratios of the source and projected lengths of the diagonals and sides of the extent of the raster dataset is used.

For example, the diagram below shows how three such cell size terms are calculated, using the lower left and upper right corner points of the input raster extent. Those corners are projected into the output system, and output cell size terms are computed using ratios of indicated dimensions: out_cell_sizei = in_cell_size * ni/di

Figure 1- geometry of first three ratios used in CU cell size projection method, GCS <-> PCS case

Figure 1- geometry of first three ratios used in CU cell size projection method, GCS <-> PCS case

The other three terms are calculated using the other corner point pair and the average of all 6 terms is used as the output cell size.

 

In general, I think this approach is ok, but I think the Preserve Resolution (PR) or Center of Extent (CE) methods are more robust. I think of PR as the “one cell, one vote” method.

 

I compared CU and PR methods in the GCS to PCS case for a 10x10 degree grid with 1-degree cell size (100 cells), at latitudes 50-60 degrees, and at 70-80 degrees, going from GCS to Canada Lambert Conformal Conic. The challenge for the software is to automatically pick a reasonable square output cell size given that square cells in the input GCS are increasingly rectangular on the ground. Square cells are important for spatial analysis because most SA operations are implemented to assume that (and compact cells that minimize the distance to the cell value are better as a general rule).  The figure below shows the results for the CU and PR methods at 50-60 degrees latitude. The precisely projected GCS input is shown in shades of magenta. Both projected results are shown in shades of cyan. The light vertical and horizonal strips highlight the differences in the methods. The results are very close. CU and PR methods both create an output grid with 150 square cells (interestingly, cell size of PR method was slightly larger: 83,400m instead of 82,850m.

Figure 2- when projecting a GCS raster (shades of magenta) between latitudes 50 and 60 degrees to Canada Lambert Conformal Conic, CU and PR produce similar results, with same count of output cells (150)

Figure 2- when projecting a GCS raster (shades of magenta) between latitudes 50 and 60 degrees to Canada Lambert Conformal Conic, CU and PR produce similar results, with same count of output cells (150)

So, both methods have increased the resolution in this case.  However, I’m not convinced that the CU method will always do that. The PR method should never decrease the cell count in the output.

 

At 70-80 degrees, PR creates more cells (180 as opposed to CU’s 171).

Figure 3- when projecting a GCS raster to Canada Lambert Conformal Conic between latitudes of 70-80 degrees, CU method creates 171 square output cells.

Figure 3- when projecting a GCS raster to Canada Lambert Conformal Conic between latitudes of 70-80 degrees, CU method creates 171 square output cells.

Figure 4- when projecting a GCS raster to Canada Lambert Conformal Conic between latitudes of 70-80 degrees, PR method creates 180 output cells

Figure 4- when projecting a GCS raster to Canada Lambert Conformal Conic between latitudes of 70-80 degrees, PR method creates 180 output cells

So, to summarize:

The CU cell size projection method has two parts:

  • the PCS-PCS behavior. The CU behavior for this case is too simple. Spatial analyst users should not assume that the best output PCS cell size is the same as the input PCS cell size. The PR and CE methods are better.
  • the GCS-PCS behavior. The CU behavior is ok, but as seen from Figure 1, there can be a wide range in the scale factors that are averaged together, depending which PCS is involved. The PR method (one cell one vote) is not affected by the shape and orientation of the output extent, just the change in area.

Regards,

-James TenBrink

DanPatterson_Retired
MVP Emeritus

Great summary!

FrancesBiles1
Occasional Contributor

Great article! Thank you for providing this level of detail, exactly what I was looking for.

My question is: are there any situations where CU is the better method to use? GCS-to-GCS?

Makes me wonder why CU is still the default method for geoprocessing in the latest software releases - is ESRI just waiting for people to be better acquainted with the new options?

by Anonymous User
Not applicable

Hi Frances:

I can't think of a situation where you would prefer CU to the newer methods. If you encounter one, please let us know.

Yes, we would like to make this the default at some point in the future but didn't want to do it immediately because of the potential for disrupting applications that are currently making assumptions about what the projected cell size will be (for example, pre-allocating a memory buffer of a size determined by dividing the extent by the assumed cell size...). Application developers should test their apps for an unexpected dependency on cell size projection method by changing the global gp environment setting to "preserve resolution" or "center of extent" and validating the resulting behavior.

Regards,

-James

About the Author
Sarmistha is a Senior Product Engineer in the raster analysis group at Esri, and works on raster and scientific multidimensional data analysis. Her primary interest is in the application of GIS for environmental and climate change modeling to study changes for conservation and improved decision making. When not making maps, Sarmistha likes to experiment with her cooking skills!