Rasterio
The TileDB GDAL driver enables indexed and efficient access to integral and partial tiles of geospatial data. The Python community typically use the Rasterio library to access GDAL drivers. Here we show how to ingest large raster data into TileDB in parallel using GDAL, Rasterio, xarray and Dask.
To highlight how TileDB works with large dense arrays we will use a dataset from the Sentinel-2 mission. You can either register and download a sample yourself from the Copernicus hub or use the requestor pays bucket from the AWS open data program, the latter being preferable if you wish to run your code on AWS using public data. The directory size of the Sentinel-2 image we are using is 788 MB.
Installation
You can run the Rasterio code as follows:
To verify that the Sentinel-2 dataset can be read by our installation of Rasterio,run the following (changing the filename):
Rasterio should successfully print out the metadata about the subdatasets within the the Sentinel-2 dataset as follows:
Ingestion
To ingest the Sentinel-2 data into TileDB with Rasterio, run:
A faster way to ingest large raster data into TileDB and take advantage of TileDB's parallel writes is by using Dask. Below we provide a detailed example on how to do this:
Last updated