Loading [MathJax]/jax/output/HTML-CSS/config.js
Riegl RDB Format Definition

OPALS supports reading and writing of Riegl DataBase (RDB) files (file extension is typically ".rdbx") with full attribute support using OPALS Format Definition (OFD) files. Conceptually RDB files are similar to ODM files since they can store arbitrary attributes and contain a spatial index based on primary coordinates. Whereas ODMs are limited to one arbitrary coordinate system, RDB supports multiple specific coordinate systems at the same time (although the spatial index is always based on to the primary coordinates).

Since RDB files are managed in a tangential cartesian coordinate system (Riegl call them project/application coordinate system), RDB files contain a 4x4 pose transformation matrix that allows direct conversion into ECEF (earth-centered, earth-fixed) coordinates. Furthermore, RDB files typically contain sensor coordinates as well, which is why, they can be used as direct input for Module StripAdjust as well.

RDB coordinate systems

The knowledge of those different coordinate system is relevant, because the user can control which coordinates should be imported or exported:

  • proj: project/application coordinate system (default)
  • ecef: earth centered earth fixed coordinate system (requirement pose transformation matrix exists)
  • scs: sensor coordinate system (import only; if available in the RDB file)
  • map: map projection coordinates (import only; if available in the RDB file)

From an OPALS point of view, points can be imported in proj, ecef and scs coordinate system. Furthermore, map coordinates can also be read if if stored in the RDB file. When exporting OPALS point clouds to RDB only two coordinate systems are reasonable: proj and ecef. If the OPALS point coordinates are given in ecef one must also specify the pose transformation matrix, allowing an implicit conversion to proj during export. This is done through the <pose> element in the OFD file, which takes either the matrix explcitely (matrix=) or alternavily takes the latitude, longitude and altitude of a certain point (point=) to compute the matrix.

Attributes within RDB files

When importing RDB files all attributes are read by default and where possible mapped to predefined opals Attributes. Custom attribtue selections for import (and export) can be created using a corresponding "OFD" file, similar as in the las/laz format. Note that attributes in RDB are not stored using a specific data type, but as integer values of different size. Floating-point values are converter to integer value based on the given scale, minValue and maxValue (for more details refer to Riegl rdblib documentation). This is why appropriate values for the aforementioned parameters are essential for storing attributes in RDB. When exporting RDB files those parameters can by either defined within the OFD file, or they are derived from the ODM statistic by Module Export. In other modules (e.g. Module Translate) the input attribute statistics might not be available. In this situation the definition of scale, minValue and maxValue is mandatory.

The following table contians all the XML-attributes which can be set for every <attribute> element in the OFD file:

OFD XML-attributes for describing RDB attributes
attribute relevance description required? default
name I/E the OPALS attribute's name YES
type I/E the OPALS data type (for a user-defined attributes) NO; only for opals user-def attr. 1
rdbName I/E the rdb attribute name; can contain index ([i]) for multi-dim Attributes YES name
rdbTitle E the rdb attribute title NO; only for non-predef rdb attr. 2 <empty>
rdbDescription E textual description of the rdb attribute NO; only for non-predef rdb attr. 2 <empty>
unit E the physical rdb unit symbol, like "m", "rad", "K", etc. NO; only for non-predef rdb attr. 2 <empty>
scale E the scale/resolution to select the appropriate rdb storage size NO; only for non-predef rdb attr. 2; derivable from ODM 3 <see text>
minValue E the theoretical minimum value to select the appropriate rdb storage size NO; only for non-predef rdb attr. 2; derivable from ODM 3 <see text>
maxValue E the theoretical maximum value to select the appropriate rdb storage size NO; only for non-predef rdb attr. 2; derivable from ODM 3 <see text>
defaultValue E the default value (minimum <= default <= maximum) NO; only for non-predef rdb attr. 2 <see text>
invalidValue E the invalid value (minimum <= invalid <= maximum; use "not-a-number" if there is no invalid value) NO; only for non-predefined rdb attr. 1 <see text>
toOpals I the conversion formula from rdb to OPALS attribute (e.g. "x*pi/180") NO; somtimes adviced for conv. 4 <empty>
toRdb E the conversion formula from OPALS to rdb attribute (e.g. "x/pi*180") NO; somtimes adviced for conv. 4 <empty>

In the simplest case (predefined rdb and opals attributes) name and rdbName are enough to fully define an attribute for import/export. All other XML-attributes are only required in some of the following cases:

  • 1: only required to export opals user-defined attributes
  • 2: only required for export of non-predefined rdb attributes
  • 3: can in some cases be derived from ODM satistics if not provided
  • 4: never mandatory but strongly advided for conversion of certain attibutes (e.g. angles are stored ad rad in opals and as deg in rdblib)

To identify invalid attribute values (=nodata) RDB uses an invalidValue similar as the nodata value for raster file. This optional number must also lie within the defined minValue and maxValue. In case no invalid value should be used, set invalidValue to nan (not-a-number).

For the export of predefined RDB attributes (starting with "riegl.") the rdbName is enough as all other information about the attribute (rdbTitle, rdbDescription, unit, scale, minValue, maxValue, defaultValue, invalidValue) is already set with a fixed value within rdblib and cannot be overwritten! Doing so, doesn't have any effect, since the predefined values are used instead.

For completeness it is mentioned that min, max and scale parameters have to be set for coordinates as well. But there only one parameter set is used for all coordinate axes. Hence, x, y and z of all points needs to fit between min and max. As for the attributes, the OPALS modules use the coordinate bounding box of input data to set appropriate parameters. If not available the definition within the OFD file is mandatory. This is done through the min, mac and scale attributes of the optional <primaryAttribute> xml element.

Example

The follow example imports an rdbx file with defined attributes and sensor coordinates into an ODM. Then, the ODM is exported back into an rdbx file filtering low amplitude echos (lower than -35db) to eliminate most outliers. The use OFD file can be found in the demo directory and is listed below:

<opalsFormatDefinition>
<description>RDB format definition with standard attributes and sensor coordinates</description>
<rdb coordinateSystem="proj"> <!-- proj/ecef/scs/map -->
<!-- optional element to set the pose for the export from ECEF coordinates:
<pose matrix='1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1'/> -->
<!-- optional element to set min, max and scale of coordinates; necessary for export if not derivable from ODM statistics:
<primaryAttribute min='' max='' scale='' /> -->
<!-- Non-predefined opals attributes need type for a working export -->
<attribute name='_BeamVectorSCSX' rdbName='riegl.xyz_socs[0]' type='float' />
<attribute name='_BeamVectorSCSY' rdbName='riegl.xyz_socs[1]' type='float' />
<attribute name='_BeamVectorSCSZ' rdbName='riegl.xyz_socs[2]' type='float' />
<attribute name='_amplitude_db' rdbName='riegl.reflectance' type='float' />
<attribute name='_deviation' rdbName='riegl.deviation' type='float' />
<!-- Predefined rdb attributes; rdbName is satisfactory for export -->
<attribute name='GPSTime' rdbName='riegl.timestamp' />
<attribute name='Amplitude' rdbName='riegl.amplitude' />
<attribute name='NrOfEchos' rdbName='riegl.target_count' />
<attribute name='EchoNumber' rdbName='riegl.target_index' />
<!-- angles usually should to be converted to radians during Import (toOpals) and back to degrees during export (toFile) -->
<attribute name='ScanAngle' rdbName='riegl.scan_angle' toOpals="x*pi/180" toFile="x/pi*180" />
</rdb>
</opalsFormatDefinition>
opalsImport -inf 211125_112749_1.rdbx -iformat rdb_with_scs.xml
opalsExport -inf 211125_112749_1.odm -outf test.rdbx -oformat rdb_with_scs.xml -filter "generic[_amplitude_db>-35]"

Figure 1 shows different 3d views of the demo data set. As visible on the left the raw point cloud contains a significant amount of noisy echoes. Coloring the point cloud by amplitude values, reveals a low amplitude for most outliers. Applying an appropriate amplitude filter (see above) a cleaned point cloud can be achieved, as shown on the right.

Fig. 1: Raw point cloud height colored (left) and colored by amplitude (center) and amplitude filtered point cloud (right)
Author
jo, gm
opalsImport is the executable file of Module Import
Definition: ModuleExecutables.hpp:113
opalsExport is the executable file of Module Export
Definition: ModuleExecutables.hpp:73
@ filter
string to be parsed in construction of DM::IFilter (various modules)