diff --git a/NAMESPACE b/NAMESPACE index 2ccbc1b..f98fe06 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -58,7 +58,6 @@ exportMethods(ncol) exportMethods(nlayers) exportMethods(nrow) exportMethods(plot) -exportMethods(projection) exportMethods(projecttwdtwRaster) exportMethods(res) exportMethods(resampleTimeSeries) diff --git a/R/getTimeSeries.R b/R/getTimeSeries.R index 7651f06..039aeb8 100644 --- a/R/getTimeSeries.R +++ b/R/getTimeSeries.R @@ -137,7 +137,7 @@ setMethod("getTimeSeries", "twdtwRaster", extractTimeSeries.twdtwRaster = function(x, y){ # Reproject points to raster projection - y = spTransform(y, CRS(projection(x))) + y = spTransform(y, CRS(projection(x@timeseries[[1]]))) # Check if the coordinates are over the raster extent pto = .getPointsOverRaster(x, y) if(length(pto)<1) diff --git a/R/methods.R b/R/methods.R index 3d901bd..174c8d9 100644 --- a/R/methods.R +++ b/R/methods.R @@ -15,9 +15,6 @@ setGeneric("layers", function(x) standardGeneric("layers")) -setGeneric("projection", - function(x) standardGeneric("projection")) - setGeneric("index", function(x) standardGeneric("index")) @@ -75,10 +72,6 @@ dim.twdtwRaster = function(x){ res } -projection.twdtwRaster = function(x){ - projection(x@timeseries[[1]]) -} - res.twdtwRaster = function(x){ res(x@timeseries[[1]]) } @@ -193,12 +186,6 @@ setMethod("writeRaster", "twdtwRaster", } ) -#' @inheritParams twdtwRaster-class -#' @rdname twdtwRaster-class -#' @export -setMethod(f = "projection", "twdtwRaster", - definition = projection.twdtwRaster) - #' @inheritParams twdtwRaster-class #' @rdname twdtwRaster-class #' @export @@ -485,7 +472,7 @@ show.twdtwRaster = function(object){ cat("Dimensions:",dim(object),"(nlayers, nrow, ncol, length)\n") cat("Resolution:",res(object)," (x, y)\n") cat("Extent :",as.vector(extent(object)), "(xmin, xmax, ymin, ymax)\n") - cat("Coord.ref.:",projection(object),"\n") + cat("Coord.ref.:",projection(object@timeseries[[1]]),"\n") invisible(NULL) } diff --git a/R/twdtwAssess.R b/R/twdtwAssess.R index 20608bb..8799427 100644 --- a/R/twdtwAssess.R +++ b/R/twdtwAssess.R @@ -183,7 +183,7 @@ twdtwAssess.twdtwRaster = function(object, y, labels, id.labels, proj4string, co x_twdtw = object@timeseries$Distance # Reproject points to raster projection - y = spTransform(y, CRS(projection(object))) + y = spTransform(y, CRS(projection(object@timeseries[[1]]))) # Remove samples outside raster bbox n_s <- length(y) @@ -239,7 +239,7 @@ twdtwAssess.twdtwRaster = function(object, y, labels, id.labels, proj4string, co sp.data = SpatialPointsDataFrame(coords = samples_all[,c("longitude", "latitude")], data = samples_all[,!names(samples_all)%in%c("longitude", "latitude")], - proj4string = CRS(projection(object))) + proj4string = CRS(projection(object@timeseries[[1]]))) new("twdtwAssessment", accuracySummary = accuracy_summary, accuracyByPeriod = accuracy_by_period, diff --git a/man/twdtwRaster-class.Rd b/man/twdtwRaster-class.Rd index 5b3ab6e..f4e083d 100644 --- a/man/twdtwRaster-class.Rd +++ b/man/twdtwRaster-class.Rd @@ -9,7 +9,6 @@ \alias{res,twdtwRaster-method} \alias{extent,twdtwRaster-method} \alias{writeRaster,twdtwRaster,ANY-method} -\alias{projection,twdtwRaster-method} \alias{ncol,twdtwRaster-method} \alias{nrow,twdtwRaster-method} \alias{nlayers,twdtwRaster-method} @@ -53,8 +52,6 @@ \S4method{writeRaster}{twdtwRaster,ANY}(x, filepath = ".", ...) -\S4method{projection}{twdtwRaster}(x) - \S4method{ncol}{twdtwRaster}(x) \S4method{nrow}{twdtwRaster}(x)