README.md

Land Use Change Calculus - lucC (LUC Calculus)

This package implements the LUC Calculus for reasoning about land use change events. Based on a set of classified time series, we build expressions to answer specific questions, such as Which events of "Forest" areas were replaced by "Pasture"?

With package "lucC" is possible to build questions using Allen's interval temporal logic relationships and also others extended from their study. I suggest the reader read (Allen 1983) and (Allen 1984) for more details. Besides, is possible to generate graphics with event information and plot maps with results. Using these events the user can to perform analysis on time series data to discover important land use changes.

wtss is an R client package for handling Web Time-Series Service (WTSS) in the client side at https://github.com/e-sensing/wtss.R

Classification method can be found using package dtwSat at https://github.com/vwmaus/dtwSat

Tools to Satellite Image Time Series analysis can be found using package sits at https://github.com/gilbertocamara/sits

Prerequisites:

How to use the package:

Example 1

alter start_date and end_date to a especific range in order to extract events

lucC_starting_point() data_tb <- example_TWDTW %>% lucC_standard_date_events(data_tb = ., month_year = "09", day_month = "01") %>% dplyr::select(longitude, latitude, start_date, end_date, label, id, index) data_tb

Fig. 1. Plot time series classified data

Fig. 1. Plot time series classified data

# p = properties of locations :
p1 <- "Pasture"

# t = interval:
t1 <- lucC_interval("2000-09-01","2017-03-01")

# Test holds for many time series 
question_holds <- function(data.tb){

  aux.df = NULL
  if (nrow(event2 <- lucC_predicate_holds(data.tb, p1, t1)) >= 1)
    aux.df <- event2
  else
    aux.df <- NULL

  data.frame(aux.df)

}

temp.tb <- data_tb

output.tb = data.frame(do.call("rbind", parallel::mclapply( X = split(temp.tb, temp.tb$index), 
                                                            mc.cores=1, #parallel::detectCores(),
                                                            FUN = question_holds)))
output.tb
Fig. 2. Plot events discovered from time series classified data

Fig. 2. Plot events discovered from time series classified data

Fig. 3.(a) Barplot with total area Fig. 3.(a) Barplot with total area Fig. 3.(b) Sequence plot Fig. 3.(b) Sequence plot

Example 2

# load library
library(lucC)
lucC_starting_point()

# load data example
data("example_TWDTW")
example_TWDTW

# alter start_date and end_date to a especific range in order to extract events
# because we work with annual intervals
# select only one time serie with index equals 13
data_tb <- example_TWDTW %>% 
  lucC_standard_date_events(data_tb = ., month_year = "09", day_month = "01") %>% 
  dplyr::select(longitude, latitude, start_date, end_date, label, id, index) %>% 
  dplyr::filter(., .$index == 13)
data_tb

# p = properties of locations :
p1 <- "Forest"
p2 <- "Pasture"

# t = interval:
t1 <- lucC_interval("2000-09-01","2004-09-01")
t2 <- lucC_interval("2004-09-01","2017-09-01")

# Test holds for one time serie
question_holds <- function(data.tb){

  aux.df = NULL

  if (nrow(ev1 <- lucC_predicate_holds(data.tb, p1, t1)) >= 1 &
      nrow(ev2 <- lucC_predicate_holds(data.tb, p2, t2)) >= 1 ){

    if(nrow(ev1) != 0 & nrow(ev2) != 0){

      if(isTRUE(lucC_relation_meets(tail(lucC_interval(ev1$start_date, ev1$end_date), 1),
                                    head(lucC_interval(ev2$start_date, ev2$end_date), 1))))
        aux.df <- rbind(ev1,ev2)
    } else 
      aux.df <- NULL

  } else {
    aux.df <- NULL
  }

  data.frame(aux.df)
}

temp.tb <- data_tb
output.tb2 = data.frame(do.call("rbind", parallel::mclapply( X = split(temp.tb, temp.tb$index), 
                                                             mc.cores=1, #parallel::detectCores(),
                                                             FUN = question_holds)))
output.tb2
Fig. 4.(a) Pixel over time Fig. 4.(a) Pixel over time Fig. 4.(b) Pixel with events Fig. 4.(b) Pixel with events

Example 3

# load library
library(lucC)
lucC_starting_point()

# load data example
data("example_TWDTW")
example_TWDTW

# alter start_date and end_date to a especific range in order to extract events
# because we work with annual intervals
data_tb <- example_TWDTW %>% 
  lucC_standard_date_events(data_tb = ., month_year = "09", day_month = "01") %>% 
  dplyr::select(longitude, latitude, start_date, end_date, label, id, index) 
data_tb

# p = properties of locations :
p1 <- c("Forest", "Pasture", "Single_cropping", "Double_cropping")

# t = interval:
t1 <- lucC_interval("2000-09-01","2017-09-01")

# Test holds for one time serie
question_holds <- function(data.tb){

  aux.df = NULL

  aux.df <- lucC_event_transitions(data.tb, properties = p1, time_intervals = t1)

  data.frame(aux.df)
}

temp.tb <- data_tb
output.tb3 = data.frame(do.call("rbind", parallel::mclapply( X = split(temp.tb, temp.tb$index), 
                                                             mc.cores=1, #parallel::detectCores(),
                                                             FUN = question_holds)))
output.tb3
Fig. 5. Plot events discovered from time series classified data

Fig. 5. Plot events discovered from time series classified data

Fig. 6.(a) Barplot with total area Fig. 6.(a) Barplot with total area Fig. 6.(b) Sequence plot Fig. 6.(b) Sequence plot



ammaciel/lucC documentation built on Oct. 7, 2017, 2:56 p.m.