Links

Creating the Array Domain

After creating some dimensions, you can create the array domain as follows:
C
C++
Python
R
Java
Go
#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);
#include <tiledb/tiledb>
using namespace tiledb;
// .. create context `ctx`, and dimensions `dim1`, `dim2`
// Create domain and add two dimensions
Domain domain(ctx);
domain.add_dimension(dim1)
.add_dimension(dim2);
import tiledb
import numpy as np
# .. create dimensions dim1, dim2
# Create domain with two dimensions
dom = tiledb.Domain(dim1, dim2)
# .. create dimensions `dim1`, `dim2`
# Create domain with two dimensions
dom <- tiledb_domain(dims = c(dim1, dim2))
// .. create context `ctx`, and dimensions `dim1`, `dim2`
// Create domain and add two dimensions
Domain domain = new Domain(ctx);
domain.addDimension(dim1)
.addDimension(dim2);
import tiledb "github.com/TileDB/TileDB-Go"
// .. create context `ctx`, and dimensions `dim1`, `dim2`
// Create domain and add two dimensions
domain, _ := tiledb.NewDomain(ctx)
domain.AddDimensions(dim1, dim2)
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.