Learn R Programming

sits (version 1.12.0)

sits_shp_to_csv: Export a shapefile with points to a CSV file for later processing

Description

Converts points from a shapefile to a CSV file. The CSV file will not contain the actual time series. Its columns will be the same as those of a CSV file used to retrieve data from ground information ("latitude", "longitude", "start_date", "end_date", "coverage", "label").

Usage

sits_shp_to_csv(shpfile, csvfile, label, timeline, start_date, end_date,
  interval = "12 month")

Arguments

shpfile

A point shapefile.

csvfile

The name of the exported CSV file.

label

Label associated to the samples.

timeline

The timeline of the data set.

start_date

Starting date for which the samples are valid.

end_date

End date for which the samples are valid.

interval

Interval between two samples of the same place.

Value

Status of the operation.

Examples

Run this code
# NOT RUN {
# set the timeline
data("timeline_2000_2017")
# set the start and end dates
start_date <- lubridate::ymd("2002-08-29")
end_date   <- lubridate::ymd("2013-08-13")
# define the input shapefile
shpfile <- system.file ("extdata/shapefiles/cerrado_forested.shp", package = "sits")
# define the output csv file
csvfile <- paste0("cerrado_forested.csv")
# define the label
label <- "Cerrado_Forested"
# read the points in the shapefile and produce a CSV file
sits_shp_to_csv(shpfile, csvfile, label, timeline_2000_2017, start_date, end_date)
# }

Run the code above in your browser using DataLab