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 dimensionstiledb_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 objecttiledb_domain_free(&domain);
#include<tiledb/tiledb>usingnamespace tiledb;// .. create context `ctx`, and dimensions `dim1`, `dim2`// Create domain and add two dimensionsDomaindomain(ctx);domain.add_dimension(dim1) .add_dimension(dim2);
import tiledbimport numpy as np# .. create dimensions dim1, dim2# Create domain with two dimensionsdom = tiledb.Domain(dim1, dim2)
# .. create dimensions `dim1`, `dim2`# Create domain with two dimensionsdom <-tiledb_domain(dims =c(dim1, dim2))
// .. create context `ctx`, and dimensions `dim1`, `dim2`// Create domain and add two dimensionsDomain domain =newDomain(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 dimensionsdomain, _ := tiledb.NewDomain(ctx)domain.AddDimensions(dim1, dim2)
usingTileDB.CSharp;// Create context `ctx`, and dimensions `dim1` and `dim2`.usingDomaindomain=newDomain(ctx);domain.AddDimension(dimc#1);domain.AddDimension(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.