Git Product home page Git Product logo

ipdw's Introduction

ipdw

CRAN_Status_Badge Project Status: Active - The project has reached a stable, usable state and is being actively developed. ipdw Downloads R-CMD-check

The R package ipdw provides the functionality to perform interpolation of georeferenced point data using inverse path distance weighting. Interpolation is accomplished in two steps. First, path distances are calculated from each georeferenced (measurement) point to each prediction point. Path distances, which honor barriers in the landscape, are calculated based on cell-to-cell movement through an underlying Raster object that represents movement cost. These path distances are subsequently used as interpolation weights. The two-step routine follows the order of operations described in Suominen et al. (2010) substituting the ESRI path distance algorithm with the gdistance wrapped version of the igraph adjacency algorithm.

The ipdw package was developed with coastal marine applications in mind where path distances (as the fish swims) rather than Euclidean (as the crow flies) distances more accurately represent spatial connectivity. Interpolation of sparse grids in coastal areas otherwise end up bleeding through land areas.

Installation

Stable version from CRAN

install.packages("ipdw")

or development version from GitHub

install.packages("devtools")  # package devtools needed
devtools::install_github("jsta/ipdw")

Examples

see vignette

References

J. Stachelek and Christopher J. Madden (2015). Application of Inverse Path Distance weighting for high density spatial mapping of coastal water quality patterns. International Journal of Geographical Information Science preprint | journal

Tapio Suominen, Harri Tolvanen, and Risto Kalliola (2010). Surface layer salinity gradients and flow patterns in the archipelago coast of SW Finland, northern Baltic Sea. Marine Environmental Research journal

ipdw's People

Contributors

jsta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

dempsey-cmar

ipdw's Issues

Questions about pathdistGen() and ipdwInterp()

Hello,

I am planning to use your package to interpolate values from oceanographic sensors stationed around the coast of Nova Scotia.

I have looked through the functions in some detail and have a couple of questions :

  1. How did you decide on the values of ipdw_range and ipdw_dist in pathdistGen()?
    I am particularly interested in why you chose the second break of the costfurf histogram for the first row of sf_ob (line 58).
    I am curious because I get different values of ipdw_dist depending on the order of sf_ob.

  2. Also in regard to pathdistGen(): I think I followed most of the reclassifying, but why did you need to scale `costsurf_reclass' (line 74): costsurf_scaled <- ((ipdw_range / costsurf_reclass)^2)?

  3. Finally, I am running into an issue where the contribution from some stations is 0 for the whole area (i.e., the raster layer output from ipdwInterp.R() is zero for every cell), despite the station being connected via water to the whole coast. I am trying to figure this out and will post a reprex if it doesn't get resolved, but let me know if this is a common/known issue.

Thanks!

Cannot run the example

Dear,

I am trying, first, to run the example found here (http://jsta.github.io/ipdw/articles/ipdw2.html) to see how to apply the function on my own dataset. However, I am not able to perform the pidw on salinity because of the following warning: Error in h(simpleError(msg, call)) : erreur d'�valuation de l'argument 'x' lors de la s�lection d'une m�thode pour la fonction 'extent' : ‘srs’ n'est pas un slot de la classe “BasicRaster”

Any ideas on how to deal with that?
Thank you very much,
Eric

testthat warnings on raster object formation

Testing blocks that call the raster::raster() function give the following warnings:

  1. raster should not given warning (@test-raster.R#37) - no non-missing arguments to min; returning Inf
  2. raster should not given warning (@test-raster.R#37) - no non-missing arguments to max; returning -Inf

Minimum Reproducible Example

minimum rep ex.

test_that("raster should not given warning", {
    skip_on_cran()
    skip_on_travis()
    skip_on_appveyor()

    m <- matrix(NA, 10, 10)
    foobar <- raster::raster(m, xmn = 0, xmx = 10, ymn = 0, ymx = 10)
    expect_s4_class(foobar, "RasterLayer")
})
The error goes away if I use a non-NA value in my m object but I think that completely NA rasters should still be valid.

Python version of ipdw

Can you provide python version of IPDW implementation?
I need python version to evaluate the result.

Thanks.

Please remove dependencies on **rgdal**, **rgeos**, and/or **maptools**

This package depends on (depends, imports or suggests) raster and one or more of the retiring packages rgdal, rgeos or maptools (https://r-spatial.org/r/2022/04/12/evolution.html, https://r-spatial.org/r/2022/12/14/evolution2.html). Since raster 3.6.3, all use of external FOSS library functionality has been transferred to terra, making the retiring packages very likely redundant. It would help greatly if you could remove dependencies on the retiring packages as soon as possible.

Relates to #19

Convert package to sf

This would also enable use of the fasterize package in costrasterGen. Polygon rasterization is a major speed killer.

costrasterGen CRAN error

These can be reproduced by checking with --as-cran using current
r-devel, which for now sets 

  _R_CLASS_MATRIX_ARRAY_=true
  _R_CHECK_LENGTH_1_CONDITION_="package:_R_CHECK_PACKAGE_NAME_,verbose"

in the check environment, to the effect that

  R> class(matrix(1 : 4, 2, 2))
  [1] "matrix" "array" 

(and no longer just "matrix" as before), and that conditions of length
greater than one in 'if' and 'while' statements executing in the package
being checked give an error.

Need to adjust class checking of the xymat object?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.