I am trying to use st_transform on PERZONES shapefile available here . In its native projection, it looks like this:
However, when I run the command:
tansformedPF<-st_transform(PF,"+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs")
##This should be the MODIS sinusoidal projection
I thought maybe st_transform_proj
would fix the problem but it did not. I also tried to plot the transformed file in Earth Engine just in case it was a problem with R's plotting and not the raster itself, but EE also shows the bands. I've used st_transform with the same destination crs with other shapefiles with no problem.
I also tried st_wrap_dateline(PF, options = c("WRAPDATELINE=YES")
and st_wrap_dateline(PF, options = c("WRAPDATELINE=YES", "DATELINEOFFSET=180")
before passing to st_transform
, but no luck. The native proj4string is "+proj=stere +lat_0=90 +lat_ts=71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs".
Any workarounds to reproject this file without the bands? I am open to another reproject function, but st_transform seems to be the one to use.