Skip to content

Latest commit

 

History

History
66 lines (41 loc) · 3.73 KB

FORMAT.md

File metadata and controls

66 lines (41 loc) · 3.73 KB

Specific formats

This documentation gives a presentation of the formats that are used in these sotfware solutions.

UV3 format

The uv3 (universal vector + three information bytes) format is defined to store large scale point and vector based models in the most simplest expression. It allows to store points, lines and triangles associated with color to each vertex in arbitrary amount. It uses the double precision to store the vertex coordinates in order to deal with any type of model aligned in a geographical frame, including the Cartesian frames associated to Earth.

The format of the uv3 file has a very simple structure made of records, each record encoding a vertex of the model stored in it. A vertex is defined as three coordinates for spatial position encoding, a number giving the type of the vertex (point, line or triangle vertex) and three numbers encoding the associated information. The associated information is traditionally the color of the vertex (red, green and blue components).

A structure of an uv3 record can then be summarized as follows :

[x][y][z][type][red][green][blue]

The three spatial coordinates are encoded using the IEEE 754 double precision standard using eight bytes in little endian. The type number is coded using a single byte and as to be :

1 for a point vertex
2 for a line vertex
3 for a triangle

The three color component, in red-green-blue order, are encoding using whole number form 0 to 255 each encoded on one byte. The size of a record is then equal to 28 bytes.

A uv3 file is then a collection of records :

[x][y][z][type][red][green][blue][x][y][z][type][red][green][blue] ...

The amount of record in an uv3 file can be retrieved by dividing the size in bytes of the file by 28.

There is not imposed order for the storage of the primitives, but for poly-vertex primitives (lines and triangles), the vertex of the primitive have to be contiguous in the file :

[x][y][z][1][red][green][blue]
[x][y][z][1][red][green][blue]
[x][y][z][2][red][green][blue]
[x][y][z][2][red][green][blue]
[x][y][z][1][red][green][blue]
[x][y][z][2][red][green][blue]
[x][y][z][2][red][green][blue]
[x][y][z][3][red][green][blue]
[x][y][z][3][red][green][blue]
[x][y][z][3][red][green][blue]
[x][y][z][1][red][green][blue]
...

The amount of primitive stored in an uv3 file is not limited. It follows that any tool using the uv3 format has to implement methodologies to deal with potentially very large file without exhausting the available volatile memory.

Note on UV3 format and geographical coordinates

In case an uv3 file is used to store model expressed in geographical coordinates system, the coordinates stored through the records vertex have to follow the strict following order :

x : dimension associated to longitude direction
y : dimension associated to latitude direction
z : dimension associated to height or altitude

In addition, in case of angular coordinates, the uv3 impose to store all the angle in radians (decimal degrees are not allowed).

UF3 Format (Predecessor of UV3)

The uf3 format was the initial version of the uv3 format. It was also introduce to be able to store very large amount of data expressed in any type of coordinates system. It was nevertheless limited to point-based model storage.

It structure was similar to UV3 but without the vertex type information. A record of the an uf3 can then be summarized as follows :

[x][y][z][red][green][blue]

The same encoding standard were used to store these records. As a result, an uf3 record contains one byte less that an uv3 record, making it 27 bytes long.

The uf3 format is no longer in used and should not be considered for any futur purpose.