README.md 1.6 KB
Newer Older
1
2
3
4
5
# gts24R package

is an R package for accessing the GTS2 API

further documentation will follow.
6
7

## Install package
Christian Hohmann's avatar
Christian Hohmann committed
8
* directly from gitlab:
9
10
11
12
13

`devtools::install_git(
  "https://gitext.gfz-potsdam.de/gts2/gts2-4r/", 
  credentials = git2r::cred_user_pass("YOURUSERNAME", getPass::getPass()), subdir="gts24r"
)`
Christian Hohmann's avatar
Christian Hohmann committed
14
15
16
17
18
19
20

* or manually:

1. or clone the repository
1. start R and set working directory to the packaage directory (gts24r)
1. install using devtools `devtools::install("gts24r")`

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
## Using the package
Currently there is one main function `get_gts2_data` for accessing gts2 data, this function returns an gts2_dataset objectm which consists of multiple list object containing data and metadata.

The data structure is:
* api_data: data about api status and you request
* metadata: metadata about the scenes and accumulated information like cloud coverage per scene
* data: which consists of the following elements
  * tile_1
    * date_1
      * resolution_1
        * data: a RasterBrick with the requested data for this spatial resolution
        * mask: a RasterLayer with the cloud mask for this spatial resolution
      * resolution_2 (if multiple spatial resolutions are returned)
    * date_2
      * ...
    * date_N
      * ...
  * tile_2 (if different tiles were returned)
    * ...

## Setup authentication

You can enter your authentication details into the `get_gts2_data` function as `auth` parameter or use the `set_gts_creds` function to constantly save your authentication details in "~/.gts24r/gts24r_auth.json", which will be readable only for the current user.

45
46
47
48
49
## ToDo

* write more tests
* check input parameters