Skip to content

Commit

Permalink
Merge pull request #1415 from mdsumner/patch-1
Browse files Browse the repository at this point in the history
project.Rd: project the description
  • Loading branch information
rhijmans authored Jan 30, 2024
2 parents 2140919 + 8f74917 commit c0f70ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion man/project.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The PROJ.4 notation of coordinate reference systems has been partly deprecated i

Transforming (projecting) raster data is fundamentally different from transforming vector data. Vector data can be transformed and back-transformed without loss in precision and without changes in the values. This is not the case with raster data. In each transformation the values for the new cells are estimated in some fashion. Therefore, if you need to match raster and vector data for analysis, you should generally transform the vector data.

When using this method with a \code{SpatRaster}, the preferable approach is to provide a template \code{SpatRaster} as argument \code{y}. The template is then another raster dataset that you want your data to align with. If you do not have a template to begin with, you can do \code{project(x, crs)} and then manipulate the output to get the template you want. For example, where possible use whole numbers for the extent and resolution so that you do not have to worry about small differences in the future. You can use commands like \code{dim(z) = c(180, 360)} or \code{res(z) <- 100000}.
When using this method with a \code{SpatRaster}, the preferable approach is to provide a template \code{SpatRaster} as argument \code{y}. The template is then another raster dataset that you want your data to align with. If you do not have a template to begin with, you can do \code{project(rast(x), crs)} and then manipulate the output to get the template you want. For example, where possible use whole numbers for the extent and resolution so that you do not have to worry about small differences in the future. You can use commands like \code{dim(z) = c(180, 360)} or \code{res(z) <- 100000}.

The output resolution should generally be similar to the input resolution, but there is no "correct" resolution in raster transformation. It is not obvious what this resolution is if you are using lon/lat data that spans a large North-South extent.
}
Expand Down

0 comments on commit c0f70ff

Please sign in to comment.