I'm having trouble putting chunks into an array.
I've created an array using:
scidb::ArrayID aid = catalog.addArray(*dptr, scidb::psLocalNode); // dptr is a pointer to a scidb::ArrayDesc
scidb::DBArray array(aid);
It is a one-attribute array.
boost::shared_ptr<scidb::ArrayIterator> ai = array.getIterator(0);
scidb::Chunk& outChunk = ai->newChunk(c); // c is an instance of scidb::Coordinates --> [0,0,0]
outChunk.allocate(i.byteSize());
outChunk.setSparse(false); // Never sparse
i.readInto(outChunk.getData()); // Write i.byteSize() bytes into outChunk.getData()
Is this a reasonable approach? I ask since I keep getting a segfault during the write, so I wanted to double-check. I haven't ruled out my own faulty code that is supposed to fill the chunk.
The array I am writing to has dimensions and attributes as follows:
AFL% dimensions(image);
[("unnamed0",0,1024,1024,0,0,1023,"int64"),("unnamed1",0,1024,1024,0,0,1023,"int64"),("unnamed2",0,9223372036854775808,42247,0,0,42246,"int64")]
AFL% attributes(image);
[("","uint16",false)]
AFL%
Does anything seem obviously wrong?
Thanks for your help,
-Daniel
