[Developers] Data on locations
Bert Bril
Bert.Bril at opendtect.org
Tue Nov 3 16:18:22 CET 2009
Hi all,
Regularly we need to program things dependent on collecting data on
locations throughout the survey. Sometimes it's just the locations you
want, sometimes there are also values attached to each of the positions.
Conceptually, you can see this as a matrix of data: the columns are the
different types of data, the rows are the 'samples'. For example:
Inl Crl Z Ampl AcImp
300 555 2.345 92456 3.2109e7
301 878 2.344 88888 1.2567e7
When we started the OpendTect project, we had no special objects for the
situation. We simply made things like TypeSet<BinIDValue> and passed
them (un)happily between objects.
If you try to find certain positions in such a set, you're in trouble.
The search time is O(N), which gives typical O(N^2) bottlenecks. Of
course this could be improved, so we made the BinIDValueSet (see
General/binidvalset.h). This covers the data matrix with a BinID and any
mumber of columns. The data is stored per inline (sorted) and for each
inline per crossline (sorted). The cost of building the set is a bit
higher than a set of BinID+Value, but when any search needs to be done,
this is easily regained by the O(log(N)) search performance.
The BinIDValueSet does not bother about any description of the data
columns, which is what the PosVecDataSet (General/posvecdataset.h) adds.
It is essentially a BinIDValueSet + data column definitions. This
enables not only easier sharing of data, but also more generalized
store/retrieve.
A couple of years ago, we realized that this is not enough. The
BinIDValueSet is not very good with 2D positioned data (trace numbers,
(X,Y)), the positions may not be precise enough, there is no
grouping/selection, the BinIDValueSet::Pos iterator is not very easy to
use, and it is not a DataPack. That gave rise to the DataPointSet
(General/datapointset.h). It is now the vehicle of choice for all kinds
of location-based data sets. We made tools around it, most notably the
uiDataPointSet enabling editing, cross-plotting, store/retrieve, and more.
Therefore: if you handle sets of data points with locations, you may
want to take a look at the DataPointSet and its buddies. As long as the
amount of points is not really huge, it will probably be a very useful
and convenient object.
/Bert
--
-- Bert Bril / OpendTect developer at dGB
-- mailto:Bert.Bril at opendtect.org , http://opendtect.org
More information about the Developers
mailing list