Giter Club home page Giter Club logo

rspatial-terra-web's Introduction

rspatial

R package with data sets used in the material on the https://rspatial.org website to teach spatial data analysis with R.

You can install the package like this

remotes::install_github("rspatial/rspatial")

rspatial-terra-web's People

Contributors

ani-ghosh avatar aramburumerlos avatar christophfriedrich avatar ec-nebi avatar lindbrook avatar pakillo avatar rhijmans avatar yutannihilation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rspatial-terra-web's Issues

outdated references in SDM tutorial

The text in 2_sdm_occdata.rmd still references wrld_simpl in three places, but the code has been updated to use geodata::world.

Object 'ovr' has, for each point, the matching record from `wrld`. We need the variable 'NAME_0' in the data.frame of wrld_simpl

You also have one reference to gridSample, but don't mention dismo anymore. I think this is also an outdated line:

https://github.com/rspatial/rspatial-terra-web/blob/33a26aa24527e7e61114ccdb2e949173f659d640/source/sdm/_R/2_sdm_occdata.rmd#L240C44-L240C44

Thanks for maintaining this great resource!

Raster vs. raster vs. SpatRaster

Reading through https://rspatial.org/terra/spatial/8-rastermanip.html I not only came across the SpatRaster class, but apparently also raster and Raster. Sometimes this confused me. Especially I didn't know if rasterand Raster are the same or not.

Examples:

Many generic functions that allow for simple and elegant raster algebra have been implemented for Raster objects [...] In these functions you can mix raster objects with numbers, as long as the first argument is a raster object. [...] Create an empty SpatRaster and assign values to cells.

The origin of a Raster object is the point closest to (0, 0) that you could get if you moved from a corner of a SpatRaster toward that point in steps of the x and y resolution.

The crop function lets you take a geographic subset of a larger raster object. You can crop a SpatRaster by providing an extent object or another spatial object from which an extent can be extracted (objects from classes deriving from Raster and from Spatial in the sp package).

Could you clarify the connection between these somewhere? It may be obvious for you developers, but it isn't for newbies.

Sorry if this already exists, but I didn't come across it in https://rspatial.org/terra/spatial/2-spatialdata.html nor https://rspatial.org/terra/spatial/4-rasterdata.html.

Documentation falsely references to `clump`, should be `patches`?

Hello,

Terra documentation seems to falsely point to clump (a raster method) when it should be patches. I assume this is an error?

The `clump` method identifies groups of cells that are connected. `boundaries` identifies edges, that is, transitions between cell values. `area` computes the size of each grid cell (for unprojected rasters), this may be useful to, e.g. compute the area covered by a certain class on a longitude/latitude raster.

Many thanks for the maintenance of this resource.

simplification in docs re: rasterize

I found the following in your (wonderful!) online manual:

nc <- rasterize(crime, r, fun=function(i){length(i)}, background=0)

If I'm not mistaken, this accomplishes the same thing as:

nc <- rasterize(crime, r, fun = length, background=0) 

Although perhaps the more complex form is useful as a clue for how to use arbitrary functions in rasterize? If that's your intent, please ignore this issue!

Thanks again for all your work building and maintaining these tools!

Issue with rs.zip file for 'remote sensing with terra'

Hi, I have tried to download the data from https://rspatial.org/terra/rs/1-introduction.html#data using:

dir.create("data", showWarnings = FALSE)
if (!file.exists("data/rs/samples.rds")) {
    download.file("https://biogeo.ucdavis.edu/data/rspatial/rs.zip", dest = "data/rs.zip")
    unzip("data/rs.zip", exdir="data")
}

but get this error:

trying URL 'https://biogeo.ucdavis.edu/data/rspatial/rs.zip'
Content type 'application/zip' length 187858667 bytes (179.2 MB)
downloaded 132.9 MB

Error in download.file("https://biogeo.ucdavis.edu/data/rspatial/rs.zip", :
download from 'https://biogeo.ucdavis.edu/data/rspatial/rs.zip' failed
In addition: Warning messages:
1: In download.file("https://biogeo.ucdavis.edu/data/rspatial/rs.zip", :
downloaded length 139395072 != reported length 187858667
2: In download.file("https://biogeo.ucdavis.edu/data/rspatial/rs.zip", :
URL 'https://data.biogeo.ucdavis.edu/data/rspatial/rs.zip': Timeout of 60 seconds was reached

Unzipping the file does not work:

> unzip("data/rs.zip", exdir="data")
Warning message:
In unzip("data/rs.zip", exdir = "data") :
  error 1 in extracting from zip file

Same when using the terminal:

$ unzip rs.zip
Archive:  rs.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of rs.zip or
        rs.zip.zip, and cannot find rs.zip.ZIP, period.

small typo in rspatial tutorial

In https://rspatial.org/terra/spatial/7-vectmanip.html#records
Where it says: "See ?select for interactively"

Might be '?sel', instead. (although '?sel' doens't correctly show any help page). Anyway, sel(df) works fine selecting geometries in a plot.

My R version 4.0.4, terra_1.7-3

PS. Sorry I forgot to ask if it is useful or appropiate to inform about typos here as issues.
PPS. Here is another dummy typo: "For this example, we first we get the name of an example file [...]" at https://rspatial.org/terra/spatial/8-rastermanip.html#creating-spatraster-objects.

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.