You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using SOmap_auto because of the projection in some instances the points added using SOplot fall outside the plot bounds and are not plotted. It would be good if there was a way to check the window to see if it will not be plotted and give a warning.
library(SOmap)
#> Loading required package: raster#> Loading required package: sp#this works fine:
SOmap_auto(x=c(175, -175), y=c(-60, -50))
#> old-style crs object detected; please recreate object with a recent sf::st_crs()#> Warning in image.default(x = x, y = y, z = value, useRaster = useRaster, :#> unsorted 'breaks' will be sorted before use#This does not for the first dot
SOplot(x=c(175, 178, -175), y=c(-50, -50, -60), col=2)
#> No projection provided, assuming longlat
in the above example, the longlat bounds returned by SOextent() are c(-175, 175, -60, -50), so point (175, -50) lies inside that extent but still won't be plotted because it's outside the plot xlim, ylim
point (180, -50) is outside the SOextent() and triggers a warning but will be plotted, because of the jolly gosh darned dateline issue
I think to solve #98 we'd have to keep the current plot extent as a polygon, and test for points in polygon. We can't just keep the projected extent of the map, because for a standard SOmap() in polar projection, the projected extent of the underlying bathy layer includes areas masked by the white mask, so those points won't be plotted. We'd have to construct the visible plot region as an extra object. For what is essentially a convenience function for the user, I am not sure it's worth the effort.
When using SOmap_auto because of the projection in some instances the points added using SOplot fall outside the plot bounds and are not plotted. It would be good if there was a way to check the window to see if it will not be plotted and give a warning.
Created on 2021-11-16 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: