-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raster over international date line #225
Comments
Hi all, I came across this same issue as well and wanted to add that this only seems to be an issue with rasters. Adding circles or markers with points beyond 180 works fine as well:
While a raster can be rotated, it is far from ideal and looks terrible when the raster is split into two parts. Are there any ideas floating around on how to fix this up? I'd even take a quick fix for now. Regards, |
I had a similar problem, and found using Here's the reproducible code and results... define rasterlibrary(raster)
library(leaflet)
# define raster that exceeds [-180,180]
r <- raster(xmn = 165, xmx = 185, ymn = -50, ymx = -31, crs = "+init=epsg:4326", nrows = 50, ncols = 50)
r[] <- rnorm(ncell(r)) map with > 180 chopped offleaflet() %>% addTiles() %>% addRasterImage(r) %>% addGraticule() option A:
|
This issue was filed in mapview (r-spatial/mapview#6)
As mapview uses leaflet and this is a leaflet issue I reproduce it here.
This works fine:
But not this, with the raster being cropped and the cells being stretched:
Any idea how I can make this work?
Rotating the raster helps somewhat, but it would be nice for the raster to not be split into two parts at either end of the map (as is the case for polygons, see below).
There is no problem with polygons (ideally this is the behaviour we would want for ratsers too):
Thanks in advance,
Tim
The text was updated successfully, but these errors were encountered: