geoknife

R tools for geo-web processing of gridded data via the Geo Data Portal. geoknife slices up gridded data according to overlap with irregular features, such as watersheds, lakes, points, etc.

https://github.com/doi-usgs/geoknife

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    8 of 9 committers (88.9%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.4%) to scientific vocabulary

Keywords

geo-data-portal grid-data r r-package rstats usgs
Last synced: 10 months ago · JSON representation

Repository

R tools for geo-web processing of gridded data via the Geo Data Portal. geoknife slices up gridded data according to overlap with irregular features, such as watersheds, lakes, points, etc.

Basic Info
Statistics
  • Stars: 69
  • Watchers: 14
  • Forks: 23
  • Open Issues: 20
  • Releases: 36
Topics
geo-data-portal grid-data r r-package rstats usgs
Created about 13 years ago · Last pushed over 3 years ago
Metadata Files
Readme License

README.Rmd

---
title: "README"
author: "Jordan S Read"
package version: "`r as.character(packageVersion('geoknife'))`"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
  md_document:
    variant: markdown_github
---
# `geoknife` package version `r packageVersion('geoknife')`


[![CRAN](https://www.r-pkg.org/badges/version/geoknife)](https://cran.r-project.org/package=geoknife)
[![Download Count](http://cranlogs.r-pkg.org/badges/geoknife)](https://cran.r-project.org/package=geoknife)  

Tools for geo-web processing of gridded data via the [Geo Data Portal](https://labs.waterdata.usgs.gov/gdp_web/ "Geo Data Portal"). `geoknife` slices up gridded data according to overlap with irregular features, such as watersheds, lakes, points, etc. The result is subsetted data in plain text, NetCDF, geotiff or other formats.

GDP


### Installing `geoknife` To install the `geoknife` from CRAN: ``` r install.packages("geoknife") ``` ```{r setup, echo=FALSE} library(knitr) opts_chunk$set(fig.path = "inst/", dev='png') ``` Or to install the current development version of the package: ```{r, eval=FALSE} install.packages("remotes") remotes::install_github('DOI-USGS/geoknife') ``` ### Reporting bugs Please consider reporting bugs and asking questions on the Issues page: [https://github.com/DOI-USGS/geoknife/issues](https://github.com/DOI-USGS/geoknife/issues) ### Code of Conduct We want to encourage a warm, welcoming, and safe environment for contributing to this project. See the [code of conduct](https://github.com/DOI-USGS/geoknife/blob/master/CONDUCT.md) for more information. ### Package Support The Water Mission Area of the USGS supports the development and maintenance of `geoknife` through September 2018, and most likely further into the future. Resources are available primarily for maintenance and responding to user questions. Priorities on the development of new features are determined by the `geoknife` development team. [![USGS](http://doi-usgs.github.io/images/usgs.png)](https://www.usgs.gov/) ## `geoknife` overview The `geoknife` package was created to support web-based geoprocessing of large gridded datasets according to their overlap with landscape (or aquatic/ocean) features that are often irregularly shaped. `geoknife` creates data access and subsequent geoprocessing requests for the USGS's Geo Data Portal to carry out on a web server. The results of these requests are available for download after the processes have been completed. This type of workflow has three main advantages: 1) it allows the user to avoid downloading large datasets, 2) it avoids reinventing the wheel for the creation and optimization of complex geoprocessing algorithms, and 3) computing resources are dedicated elsewhere, so `geoknife` operations do not have much of an impact on a local computer. `geoknife` interacts with a remote server to figure out what types of processing capabilities are available, in addition to seeing what types of geospatial features are already available to be used as an area of interest (commonly, these are user-uploaded shapefiles). Because communication with web resources are central to `geoknife` operations, users must have an active internet connection. The main elements of setting up and carrying out a `geoknife` 'job' (`geojob`) include defining the feature of interest (the `stencil` argument in the `geoknife` function), the gridded web dataset to be processed (the `fabric` argument in the `geoknife` function), and the the processing algorithm parameters (the `knife` argument in the `geoknife` function). The status of the `geojob` can be checked with `check`, and output can be loaded into a data.frame with `result`. ### What can `geoknife` do? ##### Define a stencil that represents the geographic region to slice out of the data ```{r, message=FALSE, warning=FALSE} library(geoknife) # from a single point stencil <- simplegeom(c(-89, 46.23)) # -- or -- # from a collection of named points stencil <- simplegeom(data.frame( 'point1' = c(-89, 46), 'point2' = c(-88.6, 45.2))) # -- or -- #for a state from a web available dataset stencil <- webgeom('state::New Hampshire') stencil <- webgeom('state::New Hampshire,Wisconsin,Alabama') # -- or -- #for HUC8s from a web available dataset stencil <- webgeom('HUC8::09020306,14060009') ``` ##### Define a fabric that represents the underlying data ```{r} # from the prism dataset: fabric <- webdata('prism') # -- or -- # explicitly define webdata from a list: fabric <- webdata(list( times = as.POSIXct(c('1895-01-01','1899-01-01')), url = 'https://cida.usgs.gov/thredds/dodsC/prism_v2', variables = 'ppt')) # modify the times field: times(fabric) <- as.POSIXct(c('2003-01-01','2005-01-01')) ``` ##### Create the processing job that will carry out the subsetting/summarization task ```{r} job <- geoknife(stencil, fabric, wait = TRUE) # use existing convienence functions to check on the job: check(job) ``` see also: ```{r, eval=FALSE} running(job) error(job) successful(job) ``` ##### Plot the results ```{r, fig.height=3.5, fig.width=7} data <- result(job) plot(data[,1:2], ylab = variables(fabric)) ``` ##### Use an email to listen for process completion ```{r, eval=FALSE} job <- geoknife(webgeom('state::New Hampshire'), fabric = 'prism', email = 'fake.email@gmail.com') ``` ### `geoknife` Functions (as of v1.1.5) | Function | Title | | ------------- |:-------------| | `geoknife` | slice up gridded data according to overlap with feature(s) | | `gconfig` | set or query package settings for `geoknife` processing defaults | | `algorithm` | the algorithm of a `webprocess` | | `attribute` | the attribute of an `webgeom` | | `check` | check status of `geojob` | | `download` | download the results of a `geojob` | | `error` | convenience function for state of `geojob` | | `running` | convenience function for state of `geojob` | | `successful` | convenience function for state of `geojob` | | `start` | start a `geojob` | | `cancel` | cancel a `geojob` | | `geom` | the geom of a `webgeom` | | `inputs` | the inputs of a `webprocess` | | `id` | the process id of a `geojob` | | `values` | the values of a `webgeom` | | `result` | load the output of a completed `geojob` into data.frame | | `variables` | the variables for a `webdata` object | | `wait` | wait for a `geojob` to complete processing | | `times` | the times of a `webdata` object | | `url` | the url of a `webdata`, `webgeom`, `geojob`, or `webprocess` | | `version` | the version of a `webgeom` or `webdata` | | `xml` | the xml of a `geojob` | | `query` | query datasets or variables | ### `geoknife` classes (as of v0.12.0) | Class | Title | | ------------- |:-------------| | `simplegeom` | a simple geometric class. Extends `sp::SpatialPolygons` | | `webgeom` | a web feature service geometry | | `webprocess` | a web processing service | | `webdata` | web data | | `geojob` | a geo data portal processing job | | `datagroup` | a simple class that contains data lists that can be `webdata` | ## What libraries does `geoknife` need? This version requires `httr`, `sp`, and `XML`. All of these packages are available on CRAN, and will be installed automatically when using the `install.packages()` instructions above. ## Check Notes: In addition to typical R package checking, a Dockerfile is included in this repository. Once built, it can be run with the following command. ``` docker build -t geoknife_test . docker run --rm -it -v %cd%:/src geoknife_test /bin/bash -c "cp -r /src/* /check/ && cp /src/.Rbuildignore /check/ && cd /check && Rscript -e 'devtools::build()' && R CMD check --as-cran ../geoknife_*" ``` ## Release Procedure For release of the sbtools package, a number of steps are required. 1. Ensure all checks pass and code coverage is adequate. 1. Ensure `NEWS.md` reflects updates in version. 1. Update `DESCRIPTION` to reflect release version. 1. Convert `DISCLAIMER.md` to approved language and rebuild `README.Rmd`. 1. Create release candidate branch and commit release candidate. 1. Build source package and upload to CRAN. 1. Once accepted to CRAN, tag release candidate branch an push to repositories. 1. Change `DISCLAIMER.md` back to development mode and increment description version. 1. Merge release candidate and commit. 1. Open PR/MR in development state. ```{r disclaimer, child="DISCLAIMER.md", eval=TRUE} ``` [ ![CC0](https://i.creativecommons.org/p/zero/1.0/88x31.png) ](https://creativecommons.org/publicdomain/zero/1.0/)

Owner

  • Name: U.S. Geological Survey
  • Login: DOI-USGS
  • Kind: organization
  • Email: gs_help_git@usgs.gov
  • Location: United States of America

By integrating our diverse scientific expertise, we understand complex natural science phenomena and provide scientific products that lead to solutions.

GitHub Events

Total
  • Fork event: 1
Last Year
  • Fork event: 1

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 981
  • Total Committers: 9
  • Avg Commits per committer: 109.0
  • Development Distribution Score (DDS): 0.222
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Jordan S Read j****d@u****v 763
David Blodgett d****t@u****v 98
wdwatkins w****s@u****v 77
Jordan Walker j****r@u****v 16
Luke Winslow l****w@u****v 9
Laura DeCicco l****o@u****v 7
Alison Appling a****g@u****v 7
Scott Chamberlain m****s@g****m 2
Lindsay Carr l****r@u****v 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 60
  • Total pull requests: 43
  • Average time to close issues: almost 2 years
  • Average time to close pull requests: 16 days
  • Total issue authors: 20
  • Total pull request authors: 3
  • Average comments per issue: 3.27
  • Average comments per pull request: 1.53
  • Merged pull requests: 41
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jordansread (21)
  • dblodgett-usgs (12)
  • lindsayplatt (4)
  • MgSCardano (2)
  • wdwatkins (2)
  • tg-nwf (2)
  • ldecicco-USGS (2)
  • lisefiore (1)
  • tucker-furniss (1)
  • ghost (1)
  • flakesw (1)
  • rsbivand (1)
  • jesse-ross (1)
  • lerban (1)
  • brendanwallison (1)
Pull Request Authors
  • dblodgett-usgs (27)
  • wdwatkins (13)
  • ldecicco-USGS (3)
Top Labels
Issue Labels
wontfix (4) low priority (4) bug (2) enhancement (2) helpwanted (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 959 last-month
  • Total docker downloads: 20,534
  • Total dependent packages: 2
  • Total dependent repositories: 7
  • Total versions: 20
  • Total maintainers: 1
cran.r-project.org: geoknife

Web-Processing of Large Gridded Datasets

  • Versions: 20
  • Dependent Packages: 2
  • Dependent Repositories: 7
  • Downloads: 959 Last month
  • Docker Downloads: 20,534
Rankings
Forks count: 3.3%
Stargazers count: 5.2%
Average: 10.4%
Dependent repos count: 11.1%
Downloads: 11.9%
Dependent packages count: 13.7%
Docker downloads count: 17.3%
Maintainers (1)
Last synced: about 1 year ago

Dependencies

DESCRIPTION cran
  • R >= 3.5 depends
  • curl * imports
  • httr >= 1.0.0 imports
  • methods * imports
  • progress >= 1.1.2 imports
  • sf * imports
  • utils * imports
  • whisker * imports
  • xml2 * imports
  • dplyr * suggests
  • ggmap * suggests
  • ggplot2 * suggests
  • knitr * suggests
  • raster * suggests
  • rasterVis * suggests
  • rgdal * suggests
  • rmarkdown * suggests
  • sp * suggests
  • testthat * suggests
  • xtable * suggests
.github/workflows/R-CMD-check.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact master composite
  • r-lib/actions/setup-r v1 composite
Dockerfile docker
  • rocker/geospatial latest build