Splitting and Merging Large Requests

I’m aware of the large area utilities, but AFAIK there isn’t a utility for combining the data from a gridded request back into a single array (though I would imagine this is often the desired behavior for a large-area request). I wanted to check whether someone has written a nice general tool for splitting and merging large area requests, gridding as much as is necessary.

I currently split large requests into a 3x3 grid, accumulate the data in a list, and assign the relevant sections to a numpy array. But there are a few things inconvenient about it:

  • I’m manually defining the grid order to loop through (though I could probably do it programmatically, sorting by lat and then lon)
  • My code doesn’t (currently) generalize to NxN grid, which would be nice (some areas I want are far too large even when split into 9 parts).
  • The three returned segments that are supposed to share an edge don’t have the same size (e.g., 2/3 have a width that’s 1 pixel thinner than the full-size image). Not sure how to get around this…

Hi @jmlynch3,

There exist a few options on how to merge raster data back together. I recommend checking out:

The typical workflow for this would be that you download and process each patch from the grid, then you export results into GeoTiffs and use one of the above tools to geospatially merge GeoTiffs together into one large GeoTiff.