MikkoVihtakari / ggOceanMaps

Plot oceanographic research data on maps using ggplot2
GNU General Public License v3.0
46 stars 7 forks source link

Error in st_cast.POINT(X[[i]], ...): cannot create MULTILINESTRING from POINT #36

Closed MikkoVihtakari closed 1 year ago

MikkoVihtakari commented 1 year ago

I get this with certain coordinates:

library(ggOceanMaps); basemap(data.frame(lon = c(1,50), lat = c(69,75)))
#> Loading required package: ggplot2
#> ggOceanMaps: Setting data download folder to a temporary folder
#> /var/folders/9v/b70pd53x04d3jjmlrbcgp4_w0000gv/T//Rtmpxhl5z1. This
#> means that any downloaded map data need to be downloaded again when you
#> restart R. To avoid this problem, change the default path to a
#> permanent folder on your computer. Add following lines to your
#> .Rprofile file: {.ggOceanMapsenv <- new.env(); .ggOceanMapsenv$datapath
#> <- 'YourCustomPath'}. You can use usethis::edit_r_profile() to edit the
#> file. '~/ggOceanMapsLargeData' would make it in a writable folder on
#> most operating systems.
#> Error in st_cast.POINT(X[[i]], ...): cannot create MULTILINESTRING from POINT

Created on 2023-11-08 with reprex v2.0.2

MikkoVihtakari commented 1 year ago

This was related to ggplot2::coord_sf(expand = FALSE) not always working as expected. Should by fixed by this: https://github.com/MikkoVihtakari/ggOceanMaps/commit/e7feb0d50403754afcf07b099707d6baf30260c8