#!/usr/bin/env python # coding: utf-8 # # Writing xarray -> COGs # # Hi all, # # I'm looking for guidance / best practices on writing an xarray object to (a collection of) COGs. Let's start with a common case of a DataArray that's indexed by `(time, band, y, x)`. Let's also assume that it's a chunked DataArray, with a chunksize of 1 for `time` and `band`, and it might be chunked along `y` and `x` as well. # # My high-level questions: # # 1. Does rioxarray's `.rio.to_raster(path, driver="COG")` have the right defaults? Anything special we should do to make sure we write "good" COGs for a single chunk? # 2. Is there an established convention for organizing a directory of COG files that represent a 4-d datacube? # # I'm particularly interested in item 2. My proposed naming convention is # # ``` # /time=