{ "cells": [ { "cell_type": "markdown", "id": "85512a6e-ea2f-46d3-aff1-3f0257fc4727", "metadata": {}, "source": [ "# Writing xarray -> COGs\n", "\n", "Hi all,\n", "\n", "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.\n", "\n", "My high-level questions:\n", "\n", "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?\n", "2. Is there an established convention for organizing a directory of COG files that represent a 4-d datacube?\n", "\n", "I'm particularly interested in item 2. My proposed naming convention is\n", "\n", "```\n", "/time=