Commit 053c318d authored by jbferet's avatar jbferet
Browse files

Fixed zip file for alpha and beta & tools::file_path_sans_ext

parent 3ed3b632
......@@ -21,6 +21,7 @@
#'
#' @return Output.Path path for the image converted into ENVI BIL format
#' @import raster
#' @import tools
#' @export
Convert.Raster2BIL <- function(Raster.Path, Sensor = "unknown", Output.Directory = FALSE, Convert.Integer = TRUE, Multiplying.Factor = 1, Multiplying.Factor.Last = 1) {
......
......@@ -479,6 +479,7 @@ Get.Random.Subset.From.Image <- function(ImPath, HDR, ImPathShade, NbIter, Pix.P
# does the system work with little endians or big endians?
#
# @return ByteOrder
#' @import tools
Get.Byte.Order <- function() {
if (.Platform$endian == "little") {
ByteOrder <- 0
......@@ -567,7 +568,7 @@ Mean.Filter <- function(ImageInit, nbi, nbj, SizeFilt) {
E <- padarray(ImageInit, c(SizeFilt, SizeFilt), "symmetric", "both")
ImageSmooth <- matrix(0, nrow = nbi, ncol = nbj)
Mat2D <- MatSun <- matrix(0, nrow = ((2 * SizeFilt) + 1)^2, ncol = nbj)
spl <- split(seq(1:nbj), 1:((2 * SizeFilt) + 1))
spl <- split(1:nbj, 1:((2 * SizeFilt) + 1))
mid <- ceiling((((2 * SizeFilt) + 1)^2) / 2)
for (i in (SizeFilt + 1):(nbi + SizeFilt)) {
for (j in 1:((2 * SizeFilt) + 1)) {
......@@ -1067,7 +1068,7 @@ ZipFile <- function(ImagePath) {
ImageDir <- dirname(ImagePath)
ImageName <- basename(ImagePath)
setwd(ImageDir)
zip(zipfile = paste0(ImageName, ".zip"), files = ImageName)
zip::zip(zipfile = paste0(ImageName, ".zip"), files = ImageName)
file.remove(ImageName)
setwd(PathRoot)
return()
......
......@@ -15,6 +15,7 @@
#' @param Type 'raster' or 'vector'
#' @return projection
#' @importFrom rgdal readOGR
#' @import tools
#' @export
Get.Projection = function(Path.File,Type = 'raster'){
if (Type == 'raster'){
......@@ -53,6 +54,7 @@ Get.List.Shp = function(Path.Shp){
# @param Reprojected.File path for the reprojected shapefile
# @return
#' @importFrom rgdal readOGR
#' @import tools
Reproject.Vector = function(Initial.File,Projection,Reprojected.File){
Shp.Path = dirname(Initial.File)
......@@ -74,6 +76,7 @@ Reproject.Vector = function(Initial.File,Projection,Reprojected.File){
# @param Path.Vector path for the vector file. !! SHP expected
# @return ColRow list of coordinates of pixels corresponding to each polygon in shp
#' @importFrom rgdal readOGR
#' @import tools
Extract.Pixels.Coordinates = function(Path.Raster,Path.Vector){
# read vector file
Shp.Path = dirname(Path.Vector)
......@@ -157,6 +160,7 @@ Get.Alpha.Metrics = function(Distrib){
#' @param Plots list of shapefiles included in the raster
#' @return alpha and beta diversity metrics
#' @importFrom rgdal readOGR
#' @import tools
#' @export
Get.Diversity.From.Plots = function(Raster, Plots,NbClusters = 50,Name.Plot = FALSE){
# get hdr from raster
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment