SimonDedman / movegroup

Home Range for marine animals using dynamic brownian bridge movement models
Other
16 stars 1 forks source link

Consistent projection inputs to movegroup #22

Closed mhpob closed 11 months ago

mhpob commented 1 year ago

The proj and rasterCRS arguments take the output from sp::CRS, while projectedCRS takes a proj-string which is then put into sp::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 and rasterCRS are meant to be the same -- would removing one work?

(Edited to fix links)

SimonDedman commented 12 months ago

Good spot - i'll have a look and try to simplify. Thanks!

SimonDedman commented 11 months ago

need raster CRS in format for raster, could have user only enter projected CRS & convert it into format for raster invisibly later.

SimonDedman commented 11 months ago

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!