Mapeando la ruta de vuelo más corta a través de la línea de fecha en el folleto R / Shiny, usando gcIntermediate [duplicado]

Esta pregunta ya tiene una respuesta aquí:

Plotting rutas que cruzan la fecha internacional utilizando la biblioteca de folletos en R 2 respuestas

Estoy creando un mapa de los aeropuertos australianos y sus destinos internacionales usando R-Leaflet.

Aquí están mis datos de muestra:

df<-data.frame("Australian_Airport" = "Brisbane", 
           "International" =  c("Auckland", "Bandar Seri Begawan","Bangkok","Christchurch","Denpasar","Dunedin","Hamilton","Hong Kong","Honiara","Kuala Lumpur"),
           "Australian_lon" = c(153.117, 153.117,153.117,153.117,153.117,153.117, 153.117, 153.117, 153.117, 153.117),
           "Australian_lat" = c(-27.3842,-27.3842,-27.3842,-27.3842,-27.3842,-27.3842, -27.3842, -27.3842, -27.3842, -27.3842),
           "International_lon" = c(174.7633, 114.9398, 100.5018, 172.6362, 115.2126,-82.77177, -84.56134, 114.10950, 159.97290, 101.68685),
           "International_lat" = c(-36.848460, 4.903052, 13.756331, -43.532054,-8.670458,28.019740, 39.399501, 22.396428, -9.445638,  3.139003)
           )

Pensé que sería genial usar rutas de vuelo curvas usando gcIntermediate, así que creé un objeto SpatialLines:

library(rgeos)
library(geosphere)

p1<-as.matrix(df[,c(3,4)])

p2<-as.matrix(df[,c(5,6)])

df2 <-gcIntermediate(p1, p2, breakAtDateLine=F, 
                    n=100, 
                    addStartEnd=TRUE,
                    sp=T) 

Y luego lo tracé usando el folleto y Shiny:

server <-function(input, output) {

airportmap<- leaflet() %>% addTiles() %>% 
    addCircleMarkers(df, lng = df$Australian_lon, lat = df$Australian_lat, 
    radius = 2, label = paste(df$Australian_Airport, "Airport"))%>% 
    addPolylines(data = df2, weight = 1)

output$mymap <- renderLeaflet({airportmap}) # render the base map
  }


ui<-  navbarPage("International flight path statistics - top routes",
      tabPanel("Interactive map",

      leafletOutput('mymap',  width="100%", height=900)

         )
         )

# Run the application 
shinyApp(ui = ui, server = server)

Se parece a esto

Así que las rutas son incorrectas si cruzan la línea de fecha. Cambiar breakAtDateLine a FALSE no lo arregla (la línea desaparece pero la ruta aún está rota). En esta etapa, sospecho que podría necesitar usar un sistema de mapeo diferente o algo así, pero estaría muy agradecido si alguien tiene algún consejo.

Gracias por adelantado

Respuestas a la pregunta(2)

Su respuesta a la pregunta