Skip to content

Commit

Permalink
fix sds change
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Jan 27, 2024
1 parent 4417533 commit 4520ba7
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 48 deletions.
14 changes: 8 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: whatarelief
Title: Get topography elevation and online imagery data
Version: 0.0.1.9011
Version: 0.0.1.9012
Authors@R: person("Michael D.","Sumner", role = c("aut", "cre"), email = "[email protected]")
Description: Obtain elevation data, topography relief for any region on the Earth.
Topography and bathymetry data is supported by default. Sensible defaults exist
Expand All @@ -16,18 +16,20 @@ Description: Obtain elevation data, topography relief for any region on the Eart
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.0
Imports:
spatial.datasources,
sds,
readr,
vapour (>= 0.9.3.9003)
Suggests:
terra,
raster,
knitr,
rmarkdown,
ximage
rmarkdown,
ximage,
testthat (>= 3.0.0)
VignetteBuilder: knitr
URL: https://github.com/hypertidy/whatarelief
BugReports: https://github.com/hypertidy/whatarelief/issues
Remotes: hypertidy/ximage, hypertidy/vapour, hypertidy/spatial.datasources
Remotes: hypertidy/ximage, hypertidy/vapour, hypertidy/sds
Config/testthat/edition: 3
14 changes: 8 additions & 6 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

export(coastline)
export(elevation)
export(gebco)
export(gebco21)
export(imagery)
export(raad_source)
export(satbox)
export(streetmap)
importFrom(spatial.datasources,cop30)
importFrom(spatial.datasources,cop90)
importFrom(spatial.datasources,gebco)
importFrom(spatial.datasources,gebco21)
importFrom(grDevices,contourLines)
importFrom(grDevices,dev.cur)
importFrom(graphics,lines)
importFrom(graphics,par)
importFrom(sds,cop30)
importFrom(sds,cop90)
importFrom(sds,wms_openstreetmap_tms)
importFrom(stats,na.omit)
importFrom(utils,head)
3 changes: 1 addition & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# whatarelief dev



* Now importing gebco and all source related functions from spatial.datasources.
* Now importing gebco and all source related functions from sds.

* New internal helper function to plot an image with the output of vapour:::gdal_raster_data.

Expand Down
37 changes: 13 additions & 24 deletions R/000_dsn.R
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@


.imagery_sources <- c(wms_arcgis_mapserver_ESRI.WorldImagery_tms = spatial.datasources::wms_arcgis_mapserver_ESRI.WorldImagery_tms(),
wms_bluemarble_s3_tms = spatial.datasources::wms_bluemarble_s3_tms(),
wms_googlehybrid_tms = spatial.datasources::wms_googlehybrid_tms(),
wms_virtualearth = spatial.datasources::wms_virtualearth(),
wms_ESA_worldcover_2020_tms = spatial.datasources::wms_ESA_worldcover_2020_tms(),
wms_mapbox_satellite = spatial.datasources::wms_mapbox_satellite())
.imagery_sources <- c(wms_arcgis_mapserver_ESRI.WorldImagery_tms = sds::wms_arcgis_mapserver_ESRI.WorldImagery_tms(),
wms_bluemarble_s3_tms = sds::wms_bluemarble_s3_tms(),
wms_googlehybrid_tms = sds::wms_googlehybrid_tms(),
wms_virtualearth = sds::wms_virtualearth(),
wms_ESA_worldcover_2020_tms = sds::wms_ESA_worldcover_2020_tms(),
wms_mapbox_satellite = sds::wms_mapbox_satellite())




.elevation_sources <- c(wms_amazon_elevation = spatial.datasources::wms_amazon_elevation(),
wms_amazon_elevation = spatial.datasources::wms_amazon_elevation(),
gebco = spatial.datasources::gebco())
.elevation_sources <- c(wms_amazon_elevation = sds::wms_amazon_elevation(),
wms_amazon_elevation = sds::wms_amazon_elevation(),
gebco = sds::gebco())

.streemap_sources <- c(wms_openstreetmap_tms = spatial.datasources::wms_openstreetmap_tms(),
wms_openstreetmap_tms= spatial.datasources::wms_openstreetmap_tms(),
wms_virtualearth_street = spatial.datasources::wms_virtualearth_street(),
wms_arcgis_mapserver_tms = spatial.datasources::wms_arcgis_mapserver_tms())
.streemap_sources <- c(wms_openstreetmap_tms = sds::wms_openstreetmap_tms(),
wms_openstreetmap_tms= sds::wms_openstreetmap_tms(),
wms_virtualearth_street = sds::wms_virtualearth_street(),
wms_arcgis_mapserver_tms = sds::wms_arcgis_mapserver_tms())



#' @importFrom spatial.datasources gebco
#' @export
#' @name gebco
"gebco"

#' @importFrom spatial.datasources gebco21
#' @export
#' @name gebco21
"gebco21"
4 changes: 3 additions & 1 deletion R/coastline.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
#'
#' @return matrix of coordinates in longlat (or whatever projection is specified)
#' @export
#'
#' @importFrom grDevices contourLines dev.cur
#' @importFrom graphics par
#' @importFrom utils head
#' @examples
#' plot(coastline(extent = c(-180, 180, -90, 90)), type = "l")
#'
Expand Down
9 changes: 5 additions & 4 deletions R/elevation.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ format_out <- function(x) {
#'
#' @return a matrix, or depending on format of 'extent' a terra rast or raster object with elevation data
#' @export
#' @importFrom spatial.datasources cop30 cop90
#' @importFrom sds cop30 cop90
#' @examples
#'
#' image(elevation(), useRaster = TRUE)
Expand All @@ -87,8 +87,9 @@ format_out <- function(x) {
#'
#' elevation(raster::raster(raster::extent(80, 120, -60, -40), res = 0.25, crs = "OGC:CRS84"))
#' \donttest{
#' elevation(raster::raster(raster::extent(c(-1, 1, -1, 1) * 15e3), nrows = 1024, ncols = 1024,
#' elevation(terra::rast(terra::ext(c(-1, 1, -1, 1) * 15e3), nrows = 256, ncols = 256,
#' crs = "+proj=laea +lat_0=44.6371 +lon_0=-63.5923"))
#'
#' }
elevation <- function(extent = c(-180, 180, -90, 90), ..., dimension = NULL, projection = NULL, resample = "bilinear", source = NULL, threshold = 0.5) {

Expand All @@ -115,8 +116,8 @@ elevation <- function(extent = c(-180, 180, -90, 90), ..., dimension = NULL, pro
}

if (is.null(source)) {
rso <- c(gebco(),
spatial.datasources::cop90(), spatial.datasources::cop30())
rso <- c(sds::gebco(),
sds::cop90(), sds::cop30())
if (no_srtm30) rso <- rso[1:2] else rso <- rso[c(1, 3)]
if (no_srtm) rso <- rso[1L]
if (!no_srtm) print("SRTM in use, in addition to GEBCO")
Expand Down
6 changes: 3 additions & 3 deletions R/imagery.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#' plt(imagery())
#' plt(imagery(c(100, 150, -60, -20), projection = "OGC:CRS84"))
#' ## can't do yet
#' #plt(imagery(terra::rast())
#' #plt(imagery(terra::rast()))
#' #imagery(raster::raster())
#'
imagery <- function(extent = c(-180, 180, -90, 90), ..., dimension = NULL, projection = "OGC:CRS84", resample = "near", source = NULL) {
Expand Down Expand Up @@ -69,7 +69,7 @@ imagery <- function(extent = c(-180, 180, -90, 90), ..., dimension = NULL, proje

}


#' @importFrom sds wms_openstreetmap_tms
#' @export
#' @name imagery
streetmap <- function(extent = c(-180, 180, -90, 90), ..., dimension = NULL, projection = "OGC:CRS84", resample = "cubic", source = NULL) {
Expand All @@ -78,7 +78,7 @@ streetmap <- function(extent = c(-180, 180, -90, 90), ..., dimension = NULL, pro
x <- format_out(list(extent = extent, dimension = dimension, projection = projection))

if (is.null(source)) {
rso <- .streetmap_sources["wms_openstreetmap_tms"]
rso <- sds::wms_openstreetmap_tms()
} else {
rso <- source
}
Expand Down
1 change: 1 addition & 0 deletions R/imfun.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

#' @importFrom stats na.omit
#' @importFrom graphics lines
imfun <- function(X, coastline = TRUE) {
if (!requireNamespace("ximage")) stop("{ximage} package required for imfun()")
Expand Down
3 changes: 2 additions & 1 deletion man/elevation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/imagery.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4520ba7

Please sign in to comment.