Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automap fixes when target = NULL #51

Merged
merged 3 commits into from
Jun 6, 2019
Merged

automap fixes when target = NULL #51

merged 3 commits into from
Jun 6, 2019

Conversation

mdsumner
Copy link
Member

@mdsumner mdsumner commented Jun 4, 2019

No description provided.

@mdsumner
Copy link
Member Author

mdsumner commented Jun 4, 2019

@raymondben when ya ready

without this fix, in the second example the projection centre is NULL island (appropriate, but not desired)

library(SOmap)
mac <- raadtools::readtopo("macrie1100m")
p <- raster::raster(mac); dim(p) <- dim(p)/10
x <- raster::projectRaster(mac, p, method = "ngb")
a <- SOmap_auto(x, target = NULL)
a

print(a$bathy)
#> class      : RasterLayer 
#> dimensions : 300, 300, 90000  (nrow, ncol, ncell)
#> resolution : 1728.1, 4935.7  (x, y)
#> extent     : 232985, 751415, 3160045, 4640755  (xmin, xmax, ymin, ymax)
#> crs        : +proj=utm +zone=57 +south +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 
#> source     : memory
#> names      : layer 
#> values     : -6388, 103  (min, max)
b <- SOmap_auto(x, target = "laea", dimXY = c(800, 400))
b

print(b$bathy)
#> class      : RasterLayer 
#> dimensions : 800, 400, 320000  (nrow, ncol, ncell)
#> resolution : 1304.521, 1851.107  (x, y)
#> extent     : -260930.3, 260878.2, -740417.7, 740467.9  (xmin, xmax, ymin, ymax)
#> crs        : +proj=laea +lat_0=-55.043161794395 +lon_0=158.87733578369 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 
#> source     : memory
#> names      : layer 
#> values     : -6388, 103  (min, max)

Created on 2019-06-04 by the reprex package (v0.3.0)

@Maschette
Copy link

Your testthat tests are failing on appveyor as names dont match.

@mdsumner
Copy link
Member Author

mdsumner commented Jun 4, 2019

rounds out #50

@raymondben raymondben merged commit 16ee292 into master Jun 6, 2019
@mdsumner mdsumner deleted the null-target branch February 13, 2020 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants