umr-amap / StormR

Funtions to quantify and map the tropical storms and cyclones’ winds characteristics'
https://umr-amap.github.io/StormR/
GNU General Public License v3.0
13 stars 5 forks source link

[Bug]: Issue with dynamic plots in plotBehaviour #91

Closed thomaspibanez closed 1 week ago

thomaspibanez commented 1 month ago

What happened?

When the storm overlap with 180E their is an issue with the display of the wind fields using the dynamic plot option in the plotBehaviour function.

Minimal Complete Verifiable Example

library(StormR)

sds <- defStormsDataset("/Users/ibanezthomas/Documents/IBTrACS.SP.v04r01.nc",
                        basin="SP")

sds <- defStormsList(sds,loi="Fiji",maxDist = 500, names = "WINSTON")

plotStorms(sds)
plotStorms(sds)

ss <- spatialBehaviour(sds, product = "MSW", verbose = 0)

plotBehaviour(sds,ss)

plotBehaviour(sds,ss, dynamicPlot = T)

Propose a solution

No response

Anything else we need to know?

No response

Environment

thomasarsouze commented 1 month ago

I can reproduce the bug, thanks for spotting that.

I can't dedicate time for this right now. Maybe @BaptisteDlp knows a simple and quick way to correct this ? Otherwise I'll look at it after holiday break...

thomasarsouze commented 1 month ago

Just before leaving...

this is probably the same issue as https://github.com/rstudio/leaflet/issues/225. Although, quite old this issue is still open and I didn't find any mention of a better solution. Original mention of this issue at https://github.com/r-spatial/mapview/issues/6#issuecomment-601789627

@thomaspibanez I suggest you test this if you need a workaround before I can fix the issue.

BaptisteDlp commented 2 weeks ago

I have not found any solutions yet. I think it requires some tricks to rebuild the raster around the 180E limit in order to handle the overlap