Skip to content

Instantly share code, notes, and snippets.

@mdsumner
Created January 5, 2026 19:57
Show Gist options
  • Select an option

  • Save mdsumner/274678680d99bab69e286d0760b365f5 to your computer and use it in GitHub Desktop.

Select an option

Save mdsumner/274678680d99bab69e286d0760b365f5 to your computer and use it in GitHub Desktop.
  xx <- seq(100, 220, by = 5)
yy <- seq(-60, -30, by = 10)
x <- cbind(expand.grid(xmin = head(xx, -1), ymax = tail(yy, -1)), 
  expand.grid(xmax = tail(xx, -1), ymin = head(yy, -1)))

library(wk)
library(PROJ)
library(geos)
## source, then target
trans <- PROJ::proj_trans_create("EPSG:4326", "EPSG:3031")
## "trans" object defines the from/to crs
plot(with(x, wk_transform(geos::geos_densify(as_wkb(rct(xmin, ymin, xmax, ymax)), 1e5),  trans)))

Created on 2026-01-05 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment