Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdal_utils warp: an error occured #98

Open
mlampros opened this issue Aug 26, 2020 · 0 comments
Open

gdal_utils warp: an error occured #98

mlampros opened this issue Aug 26, 2020 · 0 comments

Comments

@mlampros
Copy link
Contributor

mlampros commented Aug 26, 2020

@MatMatt, @fdetsch this issue is another case where the runGdal() function throws the error

Error in sf::gdal_utils(util = "warp", source = gdalSDS, destination = ofile,  : 
       gdal_utils warp: an error occured

but it's not related to PR96

It seems that although SDS can have a length > 1 it is hard coded to process only the first item SDS[[1]] (here, here, here, here and here) and overwrite any previous saved files.
For instance, if SDS is of length 2 and is passed to sf::gdal_utils() then gdalSDS is also of length 2 and this causes the error.

Normally, the 'source' parameter of the 'sf::gdal_utils' function can take more than 1 files however this is not the case.
I think due to the fact that only the first item of SDS is processed then it might be proper to use either the first index in gdalSDS or the last index (if it's the most updated or if it represents a different orbit). Although, I think it would be wise to compute the file size of all available products and pick the one with the highest coverage (bigger size).

                    sf::gdal_utils(
                      util = "warp"
                      , source = gdalSDS[1]
                      # , source = gdalSDS[length(gdalSDS)]

at least this works in my case.

Another option would be to add a for-loop and iterate over all available files,

            for (sds_file in seq_along(SDS)) {

but I don't know if the default behavior is to overwrite previous files in case of multiple files.

This issue might be related with issue 93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant