Skip to content

Latest commit

 

History

History
97 lines (67 loc) · 2.78 KB

File metadata and controls

97 lines (67 loc) · 2.78 KB

R Client API for Web Time Series Service

wtss is an R client package for handling Web Time-Series Service (WTSS) in the client side. For more information on WTSS see its specification and documentation in the TWS site.

This R Client API is based on the orginal version developed by Alber Sanchez at https://github.com/albhasan/rwtss.

Getting started

Installing and loading wtss package

devtools::install_github("e-sensing/wtss") # github repository name is wtss.R
library(wtss) # R package name is wtss

A simple example of creating a WTSS connection

ts.server <- WTSS("http://www.dpi.inpe.br/tws/wtss")

The result is a Object of Class WTSS.

ts.server
## Object of Class WTSS

## serverUrl:  http://www.dpi.inpe.br/tws/wtss 
## listCoverages: itobi merge mixl8mod mixl8mod_f mod13q1_512

It is possible to get the list of coverages provided by the service.

coverages <- listCoverages(ts.server)

The object is a vector containing all the coverages provided by the service.

coverages
## [1] "itobi"       "merge"     "mixl8mod"     "mixl8mod_f"     "mod13q1_512"

After that, we are able to acquire the coverage metadata. This function returns a named list of the coverage containing its attributes. In the example below, we can see how to get metadata from the second coverage.

coverage.name <- "mod13q1_512"
cv <- describeCoverage(ts.server, coverage.name)

Finally, users can get the time series based on a set of required parameters.

attributes <- cv[[names(cv)]]$attributes$name

long <- -53.495
lat <- -10.408

start <- "2000-02-18"
end <- "2017-02-18"
  
ts = timeSeries(object = ts.server, 
                coverages = coverage.name, 
                attributes = attributes, 
                latitude = lat, 
                longitude = long, 
                start = start, 
                end = end)

Plot the time series

plot(ts[[1]]$attributes[,1], main=sprintf("Pixel Center Coordinates Time-Series (%5.3f, %5.3f)", ts[[1]]$center_coordinate$latitude, ts[[1]]$center_coordinate$longitude), xlab="Time", ylab="Normalized Difference Vegetation Index")

Figure 1 - Vegetation index (ts time series).

Figure 1 - Vegetation index (ts time series).

References

G. R. de Queiroz, K. R. Ferreira, L. Vinhas, G. Camara, R. W. da Costa, R. C. M. de Souza, V. W. Maus, and A. Sanchez. WTSS: um serviço web para extração de séries temporais de imagens de sensoriamento remoto. In Proceeding of the XVII Remote Sensing Brazilian Symposium, pages 7553-7560, 2015.

Reporting Bugs

Any problem should be reported to esensing-developers@dpi.inpe.br.