james-willis commented on code in PR #938: URL: https://github.com/apache/sedona-db/pull/938#discussion_r3444370091
########## docs/working-with-zarr-ndarray-sedonadb.md: ########## @@ -0,0 +1,240 @@ +<!--- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> + +# Working with Zarr and NDArray data in SedonaDB + +SedonaDB's raster type is **N-dimensional**: a band isn't limited to a 2-D +`(y, x)` grid — it can carry additional axes such as `time` or `band`. This +makes it a natural fit for *datacubes*: climate reanalyses, satellite time +series, and model outputs. + +The `sedonadb-zarr` extension reads [Zarr](https://zarr.dev/) groups — +local or in cloud object storage — directly into that raster type, so a +datacube becomes a table you can query in SQL. + +This page walks through loading a Zarr datacube, inspecting its dimensions, +slicing out a 2-D plane, and handing the result to NumPy. + +## Install + +`sedonadb-zarr` is an extension, distributed separately from the core +SedonaDB package: + +```bash +pip install "apache-sedona[db]" sedonadb-zarr zarr numpy geoarrow-pyarrow +``` + +`zarr` and `numpy` are used to build the sample datacube below; +`geoarrow-pyarrow` is required to export query results with +`to_arrow_table()`. + +## Create a sample datacube + +If you don't already have a Zarr group handy, this creates a small +`[time, y, x]` temperature cube to follow along with: Review Comment: working on it! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
