Skip to content

Commit

Permalink
remove api_raster_terra.R
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertocamara committed Feb 12, 2025
1 parent 8a41c51 commit 641bd65
Show file tree
Hide file tree
Showing 9 changed files with 282 additions and 848 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ Collate:
'api_preconditions.R'
'api_raster.R'
'api_raster_sub_image.R'
'api_raster_terra.R'
'api_reclassify.R'
'api_reduce.R'
'api_regularize.R'
Expand Down
38 changes: 0 additions & 38 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -112,39 +112,6 @@ S3method(.opensearch_cdse_search,RTC)
S3method(.opensearch_cdse_search,S2MSI2A)
S3method(.predictors,sits)
S3method(.predictors,sits_base)
S3method(.raster_cell_from_rowcol,terra)
S3method(.raster_check_package,terra)
S3method(.raster_col,terra)
S3method(.raster_crop,terra)
S3method(.raster_crop_metadata,terra)
S3method(.raster_crs,terra)
S3method(.raster_extract,terra)
S3method(.raster_extract_polygons,terra)
S3method(.raster_file_blocksize,terra)
S3method(.raster_freq,terra)
S3method(.raster_get_values,terra)
S3method(.raster_ncols,terra)
S3method(.raster_new_rast,terra)
S3method(.raster_nlayers,terra)
S3method(.raster_nrows,terra)
S3method(.raster_open_rast,terra)
S3method(.raster_quantile,terra)
S3method(.raster_rast,terra)
S3method(.raster_read_rast,terra)
S3method(.raster_row,terra)
S3method(.raster_sample,terra)
S3method(.raster_scale,terra)
S3method(.raster_set_na,terra)
S3method(.raster_set_values,terra)
S3method(.raster_summary,terra)
S3method(.raster_write_rast,terra)
S3method(.raster_xmax,terra)
S3method(.raster_xmin,terra)
S3method(.raster_xres,terra)
S3method(.raster_xy_from_cell,terra)
S3method(.raster_ymax,terra)
S3method(.raster_ymin,terra)
S3method(.raster_yres,terra)
S3method(.reg_tile_convert,dem_cube)
S3method(.reg_tile_convert,grd_cube)
S3method(.reg_tile_convert,rainfall_cube)
Expand Down Expand Up @@ -497,11 +464,6 @@ S3method(summary,sits_area_accuracy)
S3method(summary,variance_cube)
export("sits_bands<-")
export("sits_labels<-")
export(.dc_bands)
export(.detect_change_tile_prep)
export(.raster_cell_from_rowcol)
export(.raster_sample)
export(.raster_xy_from_cell)
export(impute_linear)
export(sits_accuracy)
export(sits_accuracy_summary)
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
* Support for the Swiss Data Cube ([swissdatacube.org](https://www.swissdatacube.org/))
* Support for mosaic visualization in `sits_view`
* Introduced new function `sits_as_sf` to convert sits objects to sf
* Export images as [COG](https://www.cogeo.org/) in `sits_regularize`
* Export images as COG in `sits_regularize`
* Add `roi` parameter in `sits_regularize` function
* Add `crs` parameter in `sits_get_data`
* Change Microsoft Planetary Computer source name to `"MPC"`
Expand Down
27 changes: 18 additions & 9 deletions R/api_detect_change.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,23 @@
# Return detection tile
segs_tile
}

#' @export
#' @title Pre-process tile to run detect_change method
#' @name .detect_change_tile_prep
#' @keywords internal
#' @noRd
#' @param dc_method Detect change method
#' @param tile Single tile of a data cube.
#' @param ... Additional parameters
#' @param impute_fn Imputation function
.detect_change_tile_prep <- function(dc_method, tile, ...) {
UseMethod(".detect_change_tile_prep", dc_method)
}

#' @rdname .detect_change_tile_prep
#' @export
.detect_change_tile_prep.default <- function(dc_method, tile, ...) {
return(NULL)
}

#' @rdname .detect_change_tile_prep
#' @export
.detect_change_tile_prep.bayts_model <- function(dc_method, tile, ..., impute_fn) {
deseasonlize <- environment(dc_method)[["deseasonlize"]]
Expand Down Expand Up @@ -267,7 +273,6 @@
})
do.call(cbind, quantile_values)
}

.detect_change_create_timeline <- function(tile) {
# Get the number of dates in the timeline
tile_tl <- .as_chr(.tile_timeline(tile))
Expand Down Expand Up @@ -305,17 +310,21 @@
.dc_samples <- function(dc_method) {
environment(dc_method)[["samples"]]
}

#' @export
#' @title Retrieve bands associated to detect_change method
#' @name .dc_bands
#' @keywords internal
#' @noRd
#' @param dc_method Detect change method
#' @return Bands associated to the detect change method
.dc_bands <- function(dc_method) {
UseMethod(".dc_bands", dc_method)
}

#' @rdname .dc_bands
#' @export
.dc_bands.sits_model <- function(dc_method) {
.samples_bands(.dc_samples(dc_method))
}

#' @rdname .dc_bands
#' @export
.dc_bands.bayts_model <- function(dc_method) {
if (.has(.dc_samples(dc_method))) {
Expand Down
Loading

0 comments on commit 641bd65

Please sign in to comment.