Skip to content

odgersn/terra

This branch is 1803 commits behind rspatial/terra:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 8, 2023
ad382cf · Jan 8, 2023
Oct 2, 2022
Jan 8, 2023
Jan 15, 2022
Jan 8, 2023
Jan 8, 2023
Mar 28, 2020
Jan 8, 2023
Nov 8, 2020
Jun 23, 2020
Dec 17, 2021
Dec 17, 2021
Jan 5, 2023
Sep 16, 2018
Jan 8, 2023
Jan 5, 2023
Oct 12, 2022
Mar 31, 2020
Oct 11, 2022
Oct 11, 2022

Repository files navigation

terra

rcmdcheck CRAN status CRAN RStudio mirror downloads

logo by Zane Dax

terra is an R package for spatial data analysis. There are tutorials at rspatial.org/terra.

stackoverflow is the best place to ask questions if you get stuck. Make sure to include a simple reproducible example. But if you think you have found a bug, please file an issue.

terra replaces the raster package. The interfaces of terra and raster are similar, but terra is simpler, faster and can do more.

Installation

terra is available from CRAN, so you can use install.packages("terra") to get the current released version.

The easiest way to use the development version on Windows or MacOS, is to install it from the R-universe, like this:

install.packages('terra', repos='https://rspatial.r-universe.dev')

From source-code

To install from source-code, first install the Rcpp package that terra depends on:

install.packages("Rcpp")

And then continue based on the OS you are using.

Windows

On Windows, you need to first install Rtools to get a C++ compiler that R can use. You need a recent version of Rtools42 (rtools42-5355-5357).

Then, in R, install the package.

Sys.setenv("R_REMOTES_NO_ERRORS_FROM_WARNINGS" = "true")
remotes::install_github("rspatial/terra")

macOS

On macOS, first install gdal and proj with homebrew

brew install pkg-config
brew install gdal

Followed by (note the additional configuration argument needed for the current homebrew version of proj (9.1.0)

remotes::install_github("rspatial/terra", configure.args = "--with-proj-lib=/opt/homebrew/Cellar/proj/9.1.0/lib/")

To install the CRAN version from source you would do

install.packages("terra", configure.args = "--with-proj-lib=/opt/homebrew/Cellar/proj/9.1.0/lib/")

Linux

The easy way to install terra on linux is with r2u.

The harder way: C++11, GDAL (>= 2.2.3), GEOS (>= 3.4.0), PROJ (>= 4.9.3), sqlite3 are required, but more recent versions highly recommended.

To install these system requirements on Ubuntu you can do:

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libgdal-dev libgeos-dev libproj-dev 

And now, in R, install the package

remotes::install_github("rspatial/terra")

See the sf instructions for installation on other linux systems --- and for possible updates/improvements on the above instructions.

Releases

No releases published

Packages

No packages published

Languages

  • C++ 64.6%
  • R 27.7%
  • C 6.7%
  • Other 1.0%