eaarl-io
1.0.1+71abbd4
EAARL Input/Output Library (Public API)
|
Constants and structures for the EDB file format. More...
#include "eaarlio/error.h"
#include "eaarlio/memory.h"
#include "eaarlio/stream.h"
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | eaarlio_edb_record |
EDB record. More... | |
struct | eaarlio_edb |
EDB index data. More... | |
Macros | |
#define | eaarlio_edb_record_empty() |
Empty eaarlio_edb_record value. More... | |
#define | eaarlio_edb_empty() |
Empty eaarlio_edb value. More... | |
Functions | |
eaarlio_error | eaarlio_edb_free (struct eaarlio_edb *edb, struct eaarlio_memory *memory) |
Free memory allocated to fields in eaarlio_edb. More... | |
eaarlio_error | eaarlio_edb_read (struct eaarlio_stream *stream, struct eaarlio_edb *edb, struct eaarlio_memory *memory, int include_records, int include_files) |
Read an entire EDB file. More... | |
eaarlio_error | eaarlio_edb_write (struct eaarlio_stream *stream, struct eaarlio_edb const *edb) |
Write an EDB file. More... | |
Constants and structures for the EDB file format.
EDB stands for "EAARL database". The files are also sometimes called "index files" and have the corresponding file extension ".idx". The EDB file serves as an index into a set of raw lidar TLD files. The raw lidar TLD records do not have a fixed size, so the EDB file provides the information necessary to support random-access retrieval of TLD records.
The records in the EDB also define the raster numbers for the data. Although the TLD records contain a raster field, it is not used as it cycles. Instead, the one-based index of a record in the EDB is defined as its raster number. For example, the TLD record that corresponds with the 20th record in the EDB is defined to be raster 20.
The EDB file consists of an EDB header, followed by a series of EDB records, followed by a series of length-prefixed file names.
struct eaarlio_edb_record |
EDB record.
An EDB file contains one record for each raster in its associated set of TLD files.
Data Fields | ||
---|---|---|
uint8_t | digitizer | Digitizer used: 0 or 1. |
int16_t | file_index | Index into eaarlio_edb::files for this record's TLD file. |
uint8_t | pulse_count | Number of pulses in this raster. |
uint32_t | record_length | Byte length of this record (including the header) |
uint32_t | record_offset | Byte offset in TLD file to this record. |
uint32_t | time_fraction |
Fractional seconds component of timestamp. Use eaarlio_units_edb_time to derive floating point time |
uint32_t | time_seconds |
Integer seconds component of timestamp. Use eaarlio_units_edb_time to derive floating point time |
struct eaarlio_edb |
EDB index data.
This structure represents the data from an EDB file. Correspondingly, it's the in-memory representation of the index.
Data Fields | ||
---|---|---|
uint32_t | file_count | Number of files in eaarlio_edb::files. |
char ** | files | Names of the TLD files. |
uint32_t | record_count | Number of records in eaarlio_edb::records. |
struct eaarlio_edb_record * | records | Record entries for the TLD rasters. |
#define eaarlio_edb_empty | ( | ) |
Empty eaarlio_edb value.
All numeric fields will contain zero values. All pointers will be NULL
.
#define eaarlio_edb_record_empty | ( | ) |
Empty eaarlio_edb_record value.
All fields will contain zero values.
eaarlio_error eaarlio_edb_free | ( | struct eaarlio_edb * | edb, |
struct eaarlio_memory * | memory | ||
) |
Free memory allocated to fields in eaarlio_edb.
On success:
[in,out] | edb | EDB with memory to release |
[in] | memory | Memory handler, or NULL for stdlib |
edb
is not released. NULL
. If so, they are left alone. eaarlio_error eaarlio_edb_read | ( | struct eaarlio_stream * | stream, |
struct eaarlio_edb * | edb, | ||
struct eaarlio_memory * | memory, | ||
int | include_records, | ||
int | include_files | ||
) |
Read an entire EDB file.
[in] | stream | Stream with data to read |
[out] | edb | Pointer to EDB index to be populated |
[in] | memory | Memory handler, or NULL for stdlib |
[in] | include_records | Should record data be read? 1 = yes, 0 = no |
[in] | include_files | Should TLD filenames be read? 1 = yes, 0 = no |
edb->records
is not null, then it points to newly allocated memory. edb->filenames
is not null, then it points to newly allocated memory. edb->filenames
is not null, then each non-null entry in it points to newly allocated memory. edb->record_count
and edb->file_count
are populated.edb->records
will be populated.edb->records
will be NULL
.edb->files
will be populated.edb->files
will be NULL
. edb->records
and edb->files
may be partially populated. Anything not populated will be null. eaarlio_error eaarlio_edb_write | ( | struct eaarlio_stream * | stream, |
struct eaarlio_edb const * | edb | ||
) |
Write an EDB file.
[in] | stream | Stream to be written to |
[in] | edb | Pointer to EDB index to write |
stream
.