-
I have been looking into the implementation of rasterio.merge.merge to "prefetch" common bounds from a group of rasters. Once working on my implementation (since the function isn't currently too modular) I realized that I was getting errors when calculating common bounds of tiffs. After some investigation, it turns out this was because the CRS of each tif was different, resulting in bounds given in different units. Before implementing my own solution, I looked at the merge implementation again but found no consideration for this. In the end, I implemented a solution based on rasterio.warp.transform_bounds. I'm writing here to check if I missed something. If not, I would be happy to make changes to the merge function to either fix this or specify the assumption that all tiffs (and the target bounds parameters) are assumed to share the same CRS before running merge. I have a good approach for a solution if necessary, but I wanted to confirm my suspicions before implementing a PR. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Any chance to get a response? I may try to send a pull request with an additional merge implementation that takes CRS into account to see if it's useful, get the conversation going, but I figured a prior discussion may be better :) . |
Beta Was this translation helpful? Give feedback.
-
rioxarray wraps rasterio merge and it re-projects the rasters to the same CRS and resolution before merge. Here is a link to the code ref. It may be a helpful reference. |
Beta Was this translation helpful? Give feedback.
-
Merging is requires all rasters to have the same CRS and is optimized for this case. |
Beta Was this translation helpful? Give feedback.
Merging is requires all rasters to have the same CRS and is optimized for this case.