Creating the Array Domain

After creating some dimensions, you can create the array domain as follows:

#include <tiledb/tiledb.h>

// .. create context `ctx`, and dimensions `dim1`, `dim2`

// Create domain and add two dimensions
tiledb_domain_t* domain;
tiledb_domain_alloc(ctx, &domain);
tiledb_domain_add_dimension(ctx, domain, dim1);
tiledb_domain_add_dimension(ctx, domain, dim2);

// ...

// Make sure to free the domain object
tiledb_domain_free(&domain);

The order of the dimensions as added to the domain is important later when slicing subarrays. Remember to give priority to more selective dimensions, in order to maximize the pruning power during slicing.

When creating the domain, the dimension names must be unique.

Last updated