hypertidy / tissot

Create and plot the Tissot Indicatrix
https://hypertidy.github.io/tissot/
17 stars 1 forks source link

Error in {PROJ} package affecting {tissot} #5

Open dylanbeaudette opened 3 years ago

dylanbeaudette commented 3 years ago

Thanks for this package, solving a long-standing gap in functionality.

Attempting:

library(tissot)
r <- tissot(lambda = -66.5901, phi = 18.2208, proj.in = 'EPSG:4326', proj.out = 'EPSG:5070')

i0 <- indicatrix(r, scale=1e2, n=71)
plot(i0)

Error:

Error in names(out) <- c("x_", "y_") : 
  attempt to set an attribute on NULL

Backtrace:

10. PROJ::proj_trans(matrix(z, ncol = 2), proj.out, source = proj.in) 
9. eval(expr, pf) 
8. eval(expr, pf) 
7. withVisible(eval(expr, pf)) 
6. evalVis(expr) 
5. capture.output(out <- PROJ::proj_trans(matrix(z, ncol = 2), proj.out, 
    source = proj.in)) 
4. .prj(x, proj.out = proj.out, proj.in = proj.in) 
3. numericDeriv(quote(.prj(x, proj.out = proj.out, proj.in = proj.in)[1L, 
    ]), theta = "x") 
2. tissot0(lam[i], phi[i], degrees = degrees, A = A, f.inv = f.inv, 
    proj.in = proj.in, proj.out = proj.out, ...) 
1. tissot(lambda = -66.5901, phi = 18.2208, proj.in = "EPSG:4326", 
    proj.out = "EPSG:5070") 

Specifically: https://github.com/hypertidy/PROJ/blob/c2f9e8b58dad53e4a33eed98b0daecde4c5660cf/R/proj_trans.R#L56

mdsumner commented 3 years ago

thanks :)

you currently need the dev version of PROJ:

remotes::install_github("hypertidy/PROJ")

which in turn relies on the dev version of paleolimbot/libproj - so it takes a while to install, but installing from github like that should sort out the deps.

I'm fairly confident we'll get that sorted out soon (i.e. libproj on CRAN, PROJ will update or disappear) so I don't want to change how it's done, but let me know!

dylanbeaudette commented 3 years ago

OK, thanks! Unfortunately. I'm working on a government, windows 10, computer with no access to a real operating system or compiler.

In the meantime, I've found this implementation: https://mgimond.github.io/tissot/

I need to read / think some more about the two implementations.