dlab-berkeley / R-Geospatial-Fundamentals-Legacy

This is the repository for D-Lab's Geospatial Fundamentals in R with sf workshop.
Other
53 stars 18 forks source link

CRS Transformations #34

Open CheFusi opened 1 year ago

CheFusi commented 1 year ago

I think how projectExtent is used can be explained a bit more explicitly in the following code:

DEM_NAD83 = projectRaster(DEM, projectExtent(DEM, st_crs(SFtracts_NAD83)))

since there are a few nested functions. It's not immediately clear what is occurring.


And then when the incompatibility between cases in packages is explained, the use of $proj4string doesn't come across too clearly. A good amount of effort goes into explaining the incompatibility-- maybe a bit more could go into explaining how proj4string introduces compatibility across the packages. I think "st_crs(DEM_NAD83) == st_crs(SFtracts_NAD83)" gets at this point enough but for a brief moment only looking at the output of st_crs(SFtracts_NAD83)$proj4string alone may not clearly show why this workaround works.

Or, if the main point is more so trying to find workarounds then all is well. It's a bit nit picky here