Warning - Provisional
This specification is reverse engineered from the code. At least one person
has written code to successfully written code to read 3d files using it, but
it may be incorrect in minor details, and it's possible that there are points
which aren't fully spelled out. If you encounter any problems, please mail
us so we can improve this document.
Survex 3d Format Specification
If you're writing in C or C++ it's strongly recommended that you use
the img routine provided with Survex to read and write 3d files. Doing so
means that you can take advantage of any revisions to the 3d format by simply
rebuilding your software with the updated img routines, rather than having to
update your own code. It also allows you to read a sub-set of the data in
the file, restricted by Survey prefix.
This document only describes the most recent revision of the 3d format
(version 3), which is produced by Survex versions 0.97 and later.
File Header
This consists of:
- File ID: the string "Survex 3D Image File" followed by a linefeed (decimal 10, hex x0a). [Note: v0.01 files can have a carriage return before this and
other linefeeds - this is a file format error in any other format version].
- File format version: "v3" followed by a linefeed. Valid values for
older format versions are ("v0.01", "Bv0.01", "bv0.01", "v2"). Newer versions
will be "v4", "v5", ..., "v10", "v11", etc.
- Survey title: A string followed by a linefeed. There's no length limit on this string.
- Timestamp: A string followed by a linefeed. This is intended to be the
time the file was generated, rather than the time the survey data was
collected. The easiest way to generate this is with the strftime() format
"%a,%Y.%m.%d %H:%M:%S %Z" if you have access to strftime(). An example
timestamp is "Sun,2002.03.17 14:01:07 GMT".
Items
Following the header are a number of items. The last item must be a 0x00
byte when the current label is empty, which marks the end of the data. The
first byte of an item identifies what it is:
Olly Betts 2002-03-17, 2002-03-21, 2002-09-30, 2002-11-25