-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #380 from wdwatkins/master
make sure CRAN doesn't have to make web service calls
- Loading branch information
Showing
8 changed files
with
71 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
Package: geoknife | ||
Type: Package | ||
Title: Web-Processing of Large Gridded Datasets | ||
Version: 1.6.2 | ||
Date: 2018-08-20 | ||
Version: 1.6.3 | ||
Date: 2019-01-29 | ||
Authors@R: c( person("Jordan", "Read", role = c("aut","cre"), | ||
email = "[email protected]"), | ||
person("Jordan", "Walker", role = c("aut"), | ||
|
@@ -53,4 +53,4 @@ Suggests: | |
rgdal, | ||
maps | ||
VignetteBuilder: knitr | ||
RoxygenNote: 6.1.0 | ||
RoxygenNote: 6.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,57 @@ | ||
# Run this script in the testthat directory to refresh all the rds files loaded by tests. | ||
# Try to use RDS files when static objects can be used to keep chattyness of tests down. | ||
|
||
library(geoknife) | ||
|
||
if(!"geoknife/tests/testthat" == substr(getwd(), nchar(getwd())-22, nchar(getwd()))) { | ||
warning("this script assumes it is in the testthat directory of the geoknife package!!!") | ||
} | ||
|
||
gconfig(wps.url = "https://cida-test.er.usgs.gov/gdp/process/WebProcessingService") | ||
fabric <- webdata('prism') | ||
times(fabric)[2] <- "1895-01-01" | ||
saveRDS(fabric, "data/test_webdata_fabric.rds") | ||
wp <- webprocess() | ||
saveRDS(wp, "data/test_webprocess_knife.rds") | ||
|
||
default.sleep <- geoknife:::gconfig('sleep.time') | ||
saveRDS(webprocess(sleep.time = default.sleep+5), "data/test_webprocess_sleep-plus-five.rds") | ||
saveRDS(query(wp, 'algorithms'), "data/test_webprocess_algorithms.rds") | ||
|
||
saveRDS(webprocess(DELIMITER = 'TAB'), "data/test_webprocess_tab.rds") | ||
|
||
gconfig('wps.url'="https://cida.usgs.gov/gdp/process/WebProcessingService") | ||
wp <- webprocess() | ||
saveRDS(wp, "data/test_webprocess_knife_prod.rds") | ||
saveRDS(query(wp, 'algorithms'), "data/test_webprocess_algorithms_prod.rds") | ||
|
||
gconfig(wps.url = "https://cida-test.er.usgs.gov/gdp/process/WebProcessingService") | ||
|
||
saveRDS(webgeom('HUC8::09020306'), "data/test_webgeom_huc08.rds") | ||
saveRDS(webgeom('state::Wisconsin'), "data/test_webgeom_WI.rds") | ||
saveRDS(simplegeom(data.frame(point1 = c(-48.6, 45.2), point2=c(-88.6, 45.2))), | ||
"data/test_simplegeom_two_points.rds") | ||
|
||
saveRDS(webdata('prism',times = as.POSIXct(c('2001-01-01','2002-02-05'))), | ||
"data/test_webdata_prism_year.rds") | ||
|
||
# from custom data source vignette | ||
wg <- webgeom(url="https://www.sciencebase.gov/catalogMaps/mapping/ows/54296bf0e4b0ad29004c2fbb") | ||
geom(wg) <- "sb:Yahara_River_HRUs_alb_eq" | ||
attribute(wg) <- "GRIDCODE" | ||
|
||
wd <- webdata(url = 'https://cida.usgs.gov/thredds/dodsC/prism_v2', | ||
variables = c('tmx', 'tmn', 'ppt'), | ||
times = as.POSIXct(c('2000-01-01', '2010-01-01'))) | ||
|
||
saveRDS(wg, "data/test_XML_no_gmlid_wg.rds") | ||
saveRDS(wd, "data/test_XML_no_gmlid_wd.rds") | ||
|
||
wp <- webprocess(algorithm = list('OPeNDAP Subset'="gov.usgs.cida.gdp.wps.algorithm.FeatureCoverageOPeNDAPIntersectionAlgorithm")) | ||
inputs(wp, "OUTPUT_TYPE") <- "geotiff" | ||
saveRDS(wp, "data/test_XML_wp_opendapsubset.rds") | ||
|
||
webdata <- query("webdata") | ||
saveRDS(webdata, "data/test_query_webdata.rds") | ||
test_that("test data can be created", { | ||
testthat::skip_on_cran() | ||
library(geoknife) | ||
|
||
if(!"geoknife/tests/testthat" == substr(getwd(), nchar(getwd())-22, nchar(getwd()))) { | ||
warning("this script assumes it is in the testthat directory of the geoknife package!!!") | ||
} | ||
gconfig(wps.url = "https://cida-test.er.usgs.gov/gdp/process/WebProcessingService") | ||
fabric <- webdata('prism') | ||
times(fabric)[2] <- "1895-01-01" | ||
saveRDS(fabric, "data/test_webdata_fabric.rds") | ||
wp <- webprocess() | ||
saveRDS(wp, "data/test_webprocess_knife.rds") | ||
|
||
default.sleep <- geoknife:::gconfig('sleep.time') | ||
saveRDS(webprocess(sleep.time = default.sleep+5), "data/test_webprocess_sleep-plus-five.rds") | ||
saveRDS(query(wp, 'algorithms'), "data/test_webprocess_algorithms.rds") | ||
|
||
saveRDS(webprocess(DELIMITER = 'TAB'), "data/test_webprocess_tab.rds") | ||
|
||
gconfig('wps.url'="https://cida.usgs.gov/gdp/process/WebProcessingService") | ||
wp <- webprocess() | ||
saveRDS(wp, "data/test_webprocess_knife_prod.rds") | ||
saveRDS(query(wp, 'algorithms'), "data/test_webprocess_algorithms_prod.rds") | ||
|
||
gconfig(wps.url = "https://cida-test.er.usgs.gov/gdp/process/WebProcessingService") | ||
|
||
saveRDS(webgeom('HUC8::09020306'), "data/test_webgeom_huc08.rds") | ||
saveRDS(webgeom('state::Wisconsin'), "data/test_webgeom_WI.rds") | ||
saveRDS(simplegeom(data.frame(point1 = c(-48.6, 45.2), point2=c(-88.6, 45.2))), | ||
"data/test_simplegeom_two_points.rds") | ||
|
||
saveRDS(webdata('prism',times = as.POSIXct(c('2001-01-01','2002-02-05'))), | ||
"data/test_webdata_prism_year.rds") | ||
|
||
# from custom data source vignette | ||
wg <- webgeom(url="https://www.sciencebase.gov/catalogMaps/mapping/ows/54296bf0e4b0ad29004c2fbb") | ||
geom(wg) <- "sb:Yahara_River_HRUs_alb_eq" | ||
attribute(wg) <- "GRIDCODE" | ||
|
||
wd <- webdata(url = 'https://cida.usgs.gov/thredds/dodsC/prism_v2', | ||
variables = c('tmx', 'tmn', 'ppt'), | ||
times = as.POSIXct(c('2000-01-01', '2010-01-01'))) | ||
|
||
saveRDS(wg, "data/test_XML_no_gmlid_wg.rds") | ||
saveRDS(wd, "data/test_XML_no_gmlid_wd.rds") | ||
|
||
wp <- webprocess(algorithm = list('OPeNDAP Subset'="gov.usgs.cida.gdp.wps.algorithm.FeatureCoverageOPeNDAPIntersectionAlgorithm")) | ||
inputs(wp, "OUTPUT_TYPE") <- "geotiff" | ||
saveRDS(wp, "data/test_XML_wp_opendapsubset.rds") | ||
|
||
webdata <- query("webdata") | ||
saveRDS(webdata, "data/test_query_webdata.rds") | ||
expect_gt(length(list.files('data')), 1) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters