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

merge_rasters cannot handle mixed 3/4 band rasters #30

Closed
mikemahoney218 opened this issue Apr 21, 2021 · 1 comment
Closed

merge_rasters cannot handle mixed 3/4 band rasters #30

mikemahoney218 opened this issue Apr 21, 2021 · 1 comment

Comments

@mikemahoney218
Copy link
Member

The NAIP endpoint has a tendency, when transparent = TRUE, to return a mix of 3 and 4 band images (I imagine 3 when there are no transparent pixels and 4 when there are, but I haven't validated this). This causes problems with at least my naive use of gdalwarp, where the output raster is assumed to have the same number of bands as the first input file. The older implementation of merge_rasters is much slower in this case (by virtue of reading every file into memory) but doesn't error out.

In the short term, I plan to fix this by reintroducing the older code as a fallback mechanism. In the mid term, I think I can handle this particular case by the -dstnodata flag, and make it less common by changing the default transparency argument for the NAIP endpoint.

@mikemahoney218
Copy link
Member Author

Short-term fix implemented as #32, closing

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