AustralianAntarcticDivision / SOmap

Southern Ocean round maps
https://australianantarcticdivision.github.io/SOmap/
24 stars 6 forks source link

Wanted: check you're in the right hemisphere #74

Closed Maschette closed 4 years ago

Maschette commented 4 years ago

We currently don't have a check when using x and y with lat lon that lat is negative. When it is positive SOmap_auto throws an ugly error that isn't very helpful.

dat<-data.frame(
    Latitude = c(68.53618,68.53276,68.54419,68.54202,
                 68.52812,68.52126,68.52111,68.34444,68.57441,68.57398,
                 68.58282,68.58253,68.57806,68.60619,68.61079,68.63205,68.63487,
                 68.56244,68.59935,68.61335,68.61723,68.60925,68.53598,
                 68.53492,68.43603,68.42426),
   Longitude = c(78.06406,78.06702,78.10913,78.11743,
                 78.11217,78.09695,78.09576,77.55758,77.92837,77.92756,
                 77.91918,77.91656,77.9607,77.92844,77.93318,77.88718,77.88451,
                 77.98648,78.1452,77.99479,78.03844,78.11368,78.17291,
                 78.15668,78.39757,78.38402)
)

library(SOmap)
#> Loading required package: raster
#> Loading required package: sp
map <- SOmap_auto(dat$Longitude,dat$Latitude,input_lines = FALSE)
#> Warning in min(x, na.rm = na.rm): no non-missing arguments to min; returning Inf
#> Warning in max(x, na.rm = na.rm): no non-missing arguments to max; returning -
#> Inf
#> Error in seq.default(from = depthmin, to = 0, length.out = 33): 'from' must be a finite number
map
#> Error in eval(expr, envir, enclos): object 'map' not found

map <- SOmap_auto(dat$Longitude,dat$Latitude*-1,input_lines = FALSE)
map

Created on 2020-04-16 by the reprex package (v0.3.0)

Maschette commented 4 years ago

fixed in dad05bb