Skip to content

st_wrap_dateline() not working as expected #1999

@pieterprovoost

Description

@pieterprovoost

I'm trying to split a polygon at the dateline, but st_wrap_dateline() is not behaving as expected:

st_point(c(170, 0)) %>%
  st_sfc(crs = 4326) %>%
  st_buffer(2000000) %>%
  st_wrap_dateline(options = c("WRAPDATELINE=YES", "DATELINEOFFSET=180")) %>%
  plot()

Rplot

Session info:

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] glue_1.6.2     mapview_2.11.0 sf_1.0-9       dplyr_1.0.9   

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9              pillar_1.8.0            compiler_4.1.2          base64enc_0.1-3         class_7.3-20            tools_4.1.2            
 [7] digest_0.6.29           jsonlite_1.8.0          satellite_1.0.4         lifecycle_1.0.1         tibble_3.1.8            lattice_0.20-45        
[13] png_0.1-7               pkgconfig_2.0.3         rlang_1.0.4             DBI_1.1.3               cli_3.3.0               rstudioapi_0.13        
[19] crosstalk_1.2.0         yaml_2.3.5              fastmap_1.1.0           terra_1.6-7             e1071_1.7-11            s2_1.1.0               
[25] raster_3.5-21           leaflet.providers_1.9.0 generics_0.1.3          vctrs_0.4.1             htmlwidgets_1.5.4       webshot_0.5.3          
[31] stats4_4.1.2            classInt_0.4-7          leaflet_2.1.1           grid_4.1.2              tidyselect_1.1.2        R6_2.5.1               
[37] fansi_1.0.3             sp_1.5-0                purrr_0.3.4             magrittr_2.0.3          scales_1.2.0            codetools_0.2-18       
[43] htmltools_0.5.3         units_0.8-0             assertthat_0.2.1        colorspace_2.0-3        utf8_1.2.2              KernSmooth_2.23-20     
[49] proxy_0.4-27            wk_0.6.0                munsell_0.5.0           leafem_0.2.0            crayon_1.5.1           
> 
> sf::sf_extSoftVersion()
          GEOS           GDAL         proj.4 GDAL_with_GEOS     USE_PROJ_H           PROJ 
      "3.11.0"        "3.5.2"        "9.1.0"         "true"         "true"        "9.1.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions