Skip to content

Commit c118534

Browse files
authored
Merge pull request #308259 from beharris/fix-typo-multidimensional
Fix typo multidimensional
2 parents ee8725e + 45aa33c commit c118534

6 files changed

Lines changed: 88 additions & 17 deletions

File tree

articles/planetary-computer/TOC.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@
7373
href: queryables-for-explorer-custom-search-filter.md
7474
- name: Supported color maps
7575
href: supported-colormaps.md
76-
- name: Visualize assets
77-
href: visualize-assets.md
7876
- name: Build and use applications
7977
items:
8078
- name: Build applications
@@ -97,7 +95,5 @@
9795
href: data-cube-overview.md
9896
- name: Get Started with data cubes
9997
href: data-cube-quickstart.md
100-
- name: Visualize data cubes
101-
href: visualize-assets.md
10298
- name: Get a collection SAS token
10399
href: get-collection-sas-token.md

articles/planetary-computer/data-cube-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: tanyamarton
55
ms.author: tanyamarton
66
ms.service: planetary-computer-pro
77
ms.topic: concept-article
8-
ms.date: 04/24/2025
8+
ms.date: 11/5/2025
99

1010
ms.custom:
1111
- build-2025

articles/planetary-computer/data-cube-quickstart.md

Lines changed: 86 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: brentharris
55
ms.author: brentharris
66
ms.service: planetary-computer-pro
77
ms.topic: quickstart
8-
ms.date: 4/24/2025
8+
ms.date: 11/5/2025
99
#customer intent: help customers understand the nuances of ingesting and rendering data cube assets in Microsoft Planetary Computer Pro.
1010
ms.custom:
1111
- build-2025
@@ -54,8 +54,6 @@ Remembering that a standard Render Configuration argument in JSON format looks l
5454

5555
The `options` field is where you'll want to utilize the cloud optimized, Kerchunk asset, as opposed to the original asset listed in the STAC Item. You'll also need to include the `subdataset_name` argument, which is the name of the variable you want to render.
5656

57-
More information about visualizing NetCDF and HDF5 data can be found in the [Visualizing assets in Microsoft Planetary Computer Pro](visualize-assets.md).
58-
5957
#### Render configuration for GRIB2 assets
6058

6159
The `options` field for the Render Configuration of GRIB2 assets look similar to the previous example, but you won't need to include the `subdataset_name` argument. This is because GRIB2 data is already optimally structured and referenced via their Index files. The `assets` argument, in this case, represents the band, or 2D raster layer, you want to render. Below is an example of a GRIB2 Render Configuration:
@@ -73,16 +71,98 @@ The `options` field for the Render Configuration of GRIB2 assets look similar to
7371
]
7472
```
7573

76-
More information about visualizing GRIB2 data can be found in the [Visualizing assets in Microsoft Planetary Computer Pro](visualize-assets.md).
74+
#### Render configuration for Zarr assets
75+
76+
The `options` field for the Render Configuration of Zarr assets is also similar to that of NetCDF and HDF5, however within the `assets` argument you will have to include the parameter 'sel' which enables you to select a time, step, or other variable that enables 2D rendering of one variable at one time slice from a multi-variable Zarr store. You may also need to include a 'sel_method' parameter, to ensure the right variable is selected even if the value entered is slightly off. You can read more about this 'sel' parameter in the public documentation for the Python multidimensional data read library used in the Planetary Computer Pro backend, [Xarray](https://docs.xarray.dev/en/latest/generated/xarray.DataArray.sel.html) Below is an example of a Zarr Render Configuration:
77+
78+
```json
79+
[
80+
  {
81+
    "id": "era5-zarr",
82+
    "name": "era5-zarr",
83+
    "type": "raster-tile",
84+
    "options": "assets=data&subdataset_name=precipitation_amount_1hour_Accumulation&colormap_name=viridis&sel=time=2024-01-01&sel_method=nearest&rescale=0,0.01",
85+
    "minZoom": 12
86+
  }
87+
]
88+
```
7789

7890
### Visualize data cube assets in the Explorer
7991

8092
Once your data cube assets are ingested and configured, you can visualize them in the Planetary Computer Pro Explorer. A step-by-step guide for using the Explorer can be followed in [Quickstart: Use the Explorer in Microsoft Planetary Computer Pro](use-explorer.md).
8193

94+
While Microsoft Planetary Computer Pro includes a tiler that can be used to visualize some data cube assets, there are some caveats to note when it comes to each supported data type.
95+
96+
#### NetCDF and HDF5 visualization
97+
98+
Not all NetCDF datasets that can be ingested into Microsoft Planetary Computer are compatible by the Planetary Computer Pro's visualization tiler. A dataset must have X and Y axes, latitude and longitude coordinates, and spatial dimensions and bounds to be visualized. For example, a dataset in which latitude and longitude are variables, but not coordinates, isn't compatible with Planetary Computer Pro's tiler.
99+
100+
Before attempting to visualize your NetCDF or HDF5 dataset, you can use the following to check whether it meets the requirements.
101+
102+
1. Install the required dependencies
103+
104+
```python
105+
pip install xarray[io] rioxarray cf_xarray
106+
```
107+
108+
2. Run the following function:
109+
110+
```python
111+
import xarray as xr
112+
import cf_xarray
113+
import rioxarray
114+
115+
def is_dataset_visualizable(ds: xr.Dataset):
116+
"""
117+
Test if the dataset is compatible with the Planetary Computer tiler API.
118+
Raises an informative error if the dataset is not compatible.
119+
"""
120+
if not ds.cf.axes:
121+
raise ValueError("Dataset does not have CF axes")
122+
if not ds.cf.coordinates:
123+
raise ValueError("Dataset does not have CF coordinates")
124+
if not {"X", "Y"} <= ds.cf.axes.keys():
125+
raise ValueError(f"Dataset must have CF X and Y axes, found: {ds.cf.axes.keys()}")
126+
127+
if not {"latitude", "longitude"} <= ds.cf.coordinates.keys():
128+
raise ValueError("Dataset must have CF latitude and longitude coordinates, "
129+
f"actual: {ds.cf.coordinates.keys()}")
130+
131+
if ds.rio.x_dim is None or ds.rio.y_dim is None:
132+
raise ValueError("Dataset does not have rioxarray spatial dimensions")
133+
134+
if ds.rio.bounds() is None:
135+
raise ValueError("Dataset does not have rioxarray bounds")
136+
137+
left, bottom, right, top = ds.rio.bounds()
138+
if left < -180 or right > 180 or bottom < -90 or top > 90:
139+
raise ValueError("Dataset bounds are not valid; they must be within [-180, 180] and [-90, 90]")
140+
141+
if ds.rio.resolution() is None:
142+
raise ValueError("Dataset does not have rioxarray resolution")
143+
144+
if ds.rio.transform() is None:
145+
raise ValueError("Dataset does not have rioxarray transform")
146+
147+
print("✅ Dataset is compatible with the Planetary Computer tiler API.")
148+
```
149+
#### GRIB2 visualization
150+
151+
GRIB2 assets that have been ingested into Microsoft Planetary Computer Pro can be visualized in the Explorer as long as they have an associated Index file (.idx) stored in the same Blob Storage container. The Index file is generated during ingestion and is required for optimal access and rendering of GRIB2 data.
152+
153+
#### Zarr visualization
154+
155+
Zarr assets ingested into Microsoft Planetary Computer Pro can be visualized in the Explorer as long as the Render Configuration specifies which variable and time slice to render using the `sel` parameter in the `options` field. Failure to do so will result in the Explorer attempting to render all variables and time slices of the Zarr store at once, which will cause the Explorer to crash.
156+
157+
The size of the Zarr store and spatial chunks will also impact performance. You should aim to keep the total size of a Zarr store under 2 GB, and each chunk less than 100 MB for optimal performance of the tiler.
158+
82159
#### Time slider for data cube visualization
83160

84-
If your data cube assets have a temporal component, you can use the time slider in the Explorer to visualize changes over time. The time slider will appear automatically if your STAC Items contains assets with a `time` dimension with an `extent` and `step` field.
161+
If your data cube assets have a temporal component, you can use the time slider in the Explorer to visualize changes over time. The time slider will appear automatically if your STAC Items contains assets with a `time` dimension with an `extent` and `step` field.
162+
163+
> [!NOTE]
164+
> We do not currently offer time slider support for Zarr assets. Because of this, it is critical that you specify which time slices you want to visualize in the render configuration. Failure to do so will result in the Explorer attempting to render all time slices of the Zarr store at once, which will cause the Explorer to crash.
85165

86166
## Related content
87167

88-
- [Access STAC collection data cube assets with a collection-level SAS token](./get-collection-sas-token.md)
168+
- [Access STAC collection data cube assets with a collection-level SAS token](./get-collection-sas-token.md)

articles/planetary-computer/index.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,6 @@ landingContent:
164164
links:
165165
- text: Get started with data cubes
166166
url: data-cube-quickstart.md
167-
- linkListType: how-to-guide
168-
links:
169-
- text: Visualize data cubes
170-
url: visualize-assets.md
171167
- linkListType: quickstart
172168
links:
173169
- text: Get a collection SAS token

articles/planetary-computer/render-configuration.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ The `options` string accepts the following key-value pairs (refer to [TiTiler do
396396
- [Mosaic configurations for collections](./mosaic-configurations-for-collections.md)
397397
- [Tile settings for collections](./tile-settings.md)
398398
- [Queryables for custom search filters](./queryables-for-explorer-custom-search-filter.md)
399-
- [Visualize data cube assets (GRIB/NetCDF)](./visualize-assets.md)
400399
- [STAC Overview](./stac-overview.md)
401400
- [TiTiler Documentation](https://developmentseed.org/titiler/)
402401

articles/planetary-computer/supported-data-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ It's important to understand which geospatial data formats are supported in Plan
3636
* NetCDF
3737
* HDF5
3838
* GRIB2
39+
* Zarr
3940

4041
### Other file formats and metadata files
4142
Beyond this list of supported data types, you may ingest STAC items that point to other data types as assets. For example, it's common for STAC items to list other metadata files as assets in json, xml, csv, and other formats. When ingesting STAC items that include these other file types as assets the Planetary Computer Pro stores these files, but doesn't attempt to convert them to cloud optimized formats. After ingest, you'll be able to access these nonsupported asset types using the Planetary Computer Pro's STAC API, but you won't be able to visualize them within Planetary Computer Pro's Explorer.
@@ -45,6 +46,5 @@ Cloud-optimized assets such as cloud-optimized GeoTIFF (COG) and Cloud-optimized
4546
## Related Content
4647

4748
- Learn more about STAC collections and items: [STAC Overview](./stac-overview.md)
48-
- Learn more about visualizing these assets: [Visualize data cube Assets](./visualize-assets.md)
4949
- Get started ingesting GeoTIFF STAC Items [Add STAC items to a Collection](./add-stac-item-to-collection.md)
5050
- Get started with Data Cubes: [Data Cube Quickstart](./data-cube-quickstart.md)

0 commit comments

Comments
 (0)