Skip to content

Commit

Permalink
Functions that take multiple files are auto-quoted by default opengeo…
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed May 6, 2022
1 parent 5ebb6ea commit 59d53f0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
13 changes: 12 additions & 1 deletion PY2R/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def function_block(line, ff):
+ "\n"
)
ff.write(" }" + "\n")
elif '"' not in para and ("wd" in para or "inputs" in para):
elif '"' not in para and "wd" in para:
ff.write(" if (!missing(" + para + ")) {" + "\n")
ff.write(
' args <- paste(args, paste0("--'
Expand All @@ -110,6 +110,17 @@ def function_block(line, ff):
+ "\n"
)
ff.write(" }" + "\n")
elif '"' not in para and "inputs" in para:
ff.write(" if (!is.null(" + para + ")) {" + "\n")
ff.write(
' args <- paste(args, paste0("--'
+ para
+ '=", wbt_file_path('
+ para
+ ")))"
+ "\n"
)
ff.write(" }" + "\n")
elif '"' not in para:
ff.write(" if (!is.null(" + para + ")) {" + "\n")
ff.write(
Expand Down
2 changes: 1 addition & 1 deletion PY2R/scripts/image_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ wbt_mosaic <- function(output, inputs=NULL, method="nn", wd=NULL, verbose_mode=F
args <- ""
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!is.null(inputs)) {
args <- paste(args, paste0("--inputs=", inputs))
args <- paste(args, paste0("--inputs=", wbt_file_path(inputs)))
}
if (!is.null(method)) {
args <- paste(args, paste0("--method=", method))
Expand Down
4 changes: 2 additions & 2 deletions PY2R/scripts/lidar_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ wbt_las_to_zlidar <- function(inputs=NULL, outdir=NULL, compress="brotli", level
wbt_init()
args <- ""
if (!is.null(inputs)) {
args <- paste(args, paste0("--inputs=", inputs))
args <- paste(args, paste0("--inputs=", wbt_file_path(inputs)))
}
if (!is.null(outdir)) {
args <- paste(args, paste0("--outdir=", outdir))
Expand Down Expand Up @@ -2194,7 +2194,7 @@ wbt_zlidar_to_las <- function(inputs=NULL, outdir=NULL, wd=NULL, verbose_mode=FA
wbt_init()
args <- ""
if (!is.null(inputs)) {
args <- paste(args, paste0("--inputs=", inputs))
args <- paste(args, paste0("--inputs=", wbt_file_path(inputs)))
}
if (!is.null(outdir)) {
args <- paste(args, paste0("--outdir=", outdir))
Expand Down
2 changes: 1 addition & 1 deletion R/image_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ wbt_mosaic <- function(output, inputs=NULL, method="nn", wd=NULL, verbose_mode=F
args <- ""
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!is.null(inputs)) {
args <- paste(args, paste0("--inputs=", inputs))
args <- paste(args, paste0("--inputs=", wbt_file_path(inputs)))
}
if (!is.null(method)) {
args <- paste(args, paste0("--method=", method))
Expand Down
4 changes: 2 additions & 2 deletions R/lidar_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ wbt_las_to_zlidar <- function(inputs=NULL, outdir=NULL, compress="brotli", level
wbt_init()
args <- ""
if (!is.null(inputs)) {
args <- paste(args, paste0("--inputs=", inputs))
args <- paste(args, paste0("--inputs=", wbt_file_path(inputs)))
}
if (!is.null(outdir)) {
args <- paste(args, paste0("--outdir=", outdir))
Expand Down Expand Up @@ -2194,7 +2194,7 @@ wbt_zlidar_to_las <- function(inputs=NULL, outdir=NULL, wd=NULL, verbose_mode=FA
wbt_init()
args <- ""
if (!is.null(inputs)) {
args <- paste(args, paste0("--inputs=", inputs))
args <- paste(args, paste0("--inputs=", wbt_file_path(inputs)))
}
if (!is.null(outdir)) {
args <- paste(args, paste0("--outdir=", outdir))
Expand Down

0 comments on commit 59d53f0

Please sign in to comment.