Closed mhpob closed 11 months ago
Good spot - i'll have a look and try to simplify. Thanks!
need raster CRS in format for raster, could have user only enter projected CRS & convert it into format for raster invisibly later.
rasterCRS = sp::CRS("+proj=utm +zone=17 +datum=WGS84")
i.e. rasterCRS
uses sp
L263 cord.UTM
first use of projectedCRS
is to format in sp
: sp::CRS(projectedCRS)
L329 same. No other uses.
So. Convert projectedCRS
to sp
and remove those 2 sp
formatters.
projectedCRSsp <- sp::CRS(projectedCRS)
Warning message: In CPL_crs_from_input(x) : GDAL Message 1: +init=epsg:XXXX syntax is deprecated. It might return a CRS with a non-EPSG compliant axis order.
All the more reason to ditch it.
projectedCRSsp has PROJCRS["WGS 84 / UTM zone 17N", BASEGEOGCRS["WGS 84", & BBOX[0,-84,84,-78]]] rasterCRS has PROJCRS["unknown", BASEGEOGCRS["unknown", no BBOX But otherwise the same, lots of info, absences in rasterCRS might be irrelevant?
Need to test this!
The
proj
andrasterCRS
arguments take the output fromsp::CRS
, whileprojectedCRS
takes a proj-string which is then put intosp::CRS
later in the function (1, 2). It may be helpful (at least to me) to have all of them be one or the other.It seems that
projectedCRS
andrasterCRS
are meant to be the same -- would removing one work?(Edited to fix links)