Learn R Programming

sits (version 0.10.0)

sits_get_data.raster_cube: Obtain time series from raster cube

Description

Obtain time series from raster cube

Usage

# S3 method for raster_cube
sits_get_data(
  cube,
  file = NULL,
  ...,
  longitude = NULL,
  latitude = NULL,
  start_date = NULL,
  end_date = NULL,
  bands = NULL,
  label = "NoClass",
  impute_fn = sits_impute_linear()
)

Arguments

cube

Data cube from where data is to be retrieved.

file

File with information on the data to be retrieved.

...

Other parameters to be passed for specific types

longitude

Longitude of the chosen location.

latitude

Latitude of the chosen location.

start_date

Start of the interval for the time series in "YYYY-MM-DD" format (optional).

end_date

End of the interval for the time series in "YYYY-MM-DD" format (optional).

bands

Bands to be retrieved (optional).

label

Label to be assigned to the time series (optional).

impute_fn

Imputation function for NA values.

Value

A tibble with time series data and metadata.

Examples

Run this code
# NOT RUN {
# Read a point in a Raster Brick
# define the file that has the raster brick
files <- c(system.file("extdata/raster/mod13q1/sinop-crop-ndvi.tif",
    package = "sits"
))
# define the timeline
data(timeline_modis_392)
# create a data cube based on the information about the files
raster_cube <- sits_cube(
    type = "BRICK", satellite = "TERRA",
    sensor = "MODIS", name = "Sinop-crop",
    timeline = timeline_modis_392,
    bands = c("NDVI"), files = files
)

# read the time series of the point from the raster
point_ts <- sits_get_data(raster_cube,
    longitude = -55.554,
    latitude = -11.525
)
plot(point_ts)
# }

Run the code above in your browser using DataLab