library(graticule)
lons <- seq(-80, -40, by = 5)
lats <- seq(77, 84.5, by = .5)
latpts <- cbind(min(lons), lats)
lonpts <- cbind(lons, min(lats))
prj <- "+proj=laea +lat_0=90 +lon_0=-60"
xy_lon <- sf::sf_project(pts = lonpts, to = prj, from = "OGC:CRS84")
xy_lat <- sf::sf_project(pts = latpts, to = prj, from = "OGC:CRS84")
g <- graticule(lons,lats, proj = prj)
plot(g)
lonlab <- function(x) paste(x, ifelse(x >0, "E", "W"))
latlab <- function(x) paste(x, ifelse(x >0, "N", "S"))
text(xy_lon, lab = lonlab(lonpts[,1]), pos = 1, offset = 1)
text(xy_lat, lab = latlab(latpts[,2]), pos = 1, offset = -4)
Created
January 11, 2023 18:58
-
-
Save mdsumner/30ad75d1c6b03b020ab5a43518aa5ab4 to your computer and use it in GitHub Desktop.
💯
whatarelief is a helper experiment around a pure- GDAL reader, in between pure-read and visualisation- or format-requirements, it's about having componentry tools not everything bundled into one do-all monster package
(sf tries to dominate everything, but really fails miserably when you step even remotely off the path you're meant to stick to, I can bend it where I want to go but only after exploring the parts properly 😇)
I hear you :) I will certainly have a look at whatarelief soon and integrate it to my workflow.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
all good, this prompted me to push a few necessary changes forward 👌 we'll do this as examples with various options of how 🙏