Skip to content
forked from rspatial/terra

R package for spatial data handling

License

Notifications You must be signed in to change notification settings

jeffreyevans/terra

 
 

Repository files navigation

terra

Travis build status CRAN status CRAN RStudio mirror downloads

terra is an R package that replaces raster. It has a very similar interface, but it is simpler and much faster. The first (beta-) release was on 20 March 2020.

terra is written in C++. Classes, methods and properties are exposed via a Rcpp module. The R side has two main classes (SpatRaster and SpatVector) that represent spatial data. These classes are used to provide a standard R user-interface. There are tutorials at rspatial.org/terra.

Installation

terra is available from CRAN, so you can use install.packages("terra").

See below for instructions on installing the development version

All OS

First intstall the packages that terra depends on

install.packages("raster")

Windows

If you are on Windows, you need to first install Rtools to get a C++ compiler that R can use.

Then, in R, install the package.

remotes::install_github("rspatial/terra")

Mac - OSX

The libraries GDAL (>= 3.0.0), GEOS (>= 3.3.0) and Proj.4 (>= 6.0.0) are required

Install Homebrew if you have not done so before, and then from the terminal:

brew install pkg-config
brew install gdal

And now, in R, install the package

remotes::install_github("rspatial/terra")

If you get configure: error: libproj not found in standard or given locations. Then you need to install like this

remotes::install_github("rspatial/terra", configure-args="--with-proj-lib=/usr/local/lib/")

Linux

The libraries GDAL (>= 3.0.0), GEOS (>= 3.3.0) and Proj.4 (>= 6.0.0) are required

To install these on Ubuntu version 18.04 (Bionic) 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. But note that terra depends on on more recent versions of GDAL and PROJ libraries

About

R package for spatial data handling

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 100.0%