Skip to content

Commit

Permalink
fix adding empty options
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Jun 3, 2024
1 parent 6098b99 commit 49db105
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions R/raster-input.R
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ vapour_warp_raster <- function(x, bands = NULL,
stop("manually setting -r, -te, -t_srs, -of, -s_srs, -ot options not allowed \n ( these controlled by arguments 'resample', 'target_extent', 'target_projection', '<MEM>', 'source_projection', 'band_output_type')")
}
if (any(grepl("-te_srs", options))) stop("setting '-te_srs' projection of target extent is not supported")

vals <- warp_in_memory_gdal_cpp(x, source_WKT = source_projection,
target_WKT = projection,
target_extent = as.numeric(extent),
Expand Down
4 changes: 3 additions & 1 deletion inst/include/gdalwarpmem/gdalwarpmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ inline List gdal_warp_in_memory(CharacterVector source_filename,
papszArg = CSLAddString(papszArg, resample[0]);

for (int gwopt = 0; gwopt < options.length(); gwopt++) {
papszArg = CSLAddString(papszArg, options[gwopt]);
if (!options[gwopt].empty()) {
papszArg = CSLAddString(papszArg, options[gwopt]);
}
}


Expand Down

0 comments on commit 49db105

Please sign in to comment.