Format of the Cvx BGL Files: Difference between revisions
| Line 11: | Line 11: | ||
== File Header == | == File Header == | ||
The header consists of 0x38 (56) bytes. It contains the number of sections defined in the file as well as the bounding geographical coordinates of the covered squared area. | The header consists of 0x38 (56) bytes. It contains the number of sections defined in the file as well as the bounding geographical coordinates of the covered squared area. | ||
{| class="wikitable" | |||
|- | |||
! Offset | |||
! Number of bytes | |||
! Description | |||
|- | |||
| 0x00 | |||
| 4 - DWORD | |||
| Magic Number #1 – Must be 0x01, 0x02, 0x92, 0x19 | |||
|- | |||
| 0x04 | |||
| 4 - DWORD | |||
| Header size : 0x38 | |||
|- | |||
| 0x08 | |||
| 4 - DWORD | |||
| Unknown – Maybe a timestamp | |||
|- | |||
| 0x0C | |||
| 4 - DWORD | |||
| Unknown – Maybe a timestamp | |||
|- | |||
| 0x10 | |||
| 4 - DWORD | |||
| Magic Number #2 – Must be 0x03, 0x18, 0x05, 0x08<br/>Maybe to identify the FS version | |||
|- | |||
| 0x14 | |||
| 4 - DWORD | |||
| The number of sections following this header. | |||
|- | |||
| 0x18 | |||
| 32 | |||
| Array[8] of unsigned integers (DWORD).<br/>Each value describes the bounding coordinates of a squared subarea.<br/> | |||
Even if 8 slots are provided, it is not necessary to have all 8 values filled. The list stops at the first null (0x00000000) value.<br/> | |||
I don’t know what these subareas are used for.<br/>To compute the bounding coordinates, please see Annexe A.<br/>To get the bounding coordinates of the square area covered by the file, just keep the minimal and maximal values of each bounding coordinates. | |||
|} | |||
== Sections == | == Sections == | ||
== Subsections == | == Subsections == | ||
Revision as of 16:09, 18 July 2014
Introduction
CVX Files can be read by the TmfViewer.exe application provided with the FS SDK. They contain TERRAIN_VECTOR_DB sections. These sections and subsections describe the different layers (roads, railways, water polygons, etc.) along with the geographical coordinates.
In this document, I will often take examples from the cvx2815.bgl file since that is the one I used to figure out the structure of the cxv file and it describes the area I live in. This file is located in: (....)\Microsoft Flight Simulator X\Scenery\0301\scenery.
BGL Common Format
All BGL files share the same generic format. A BGL file is made of a header, sections, subsections and subsection data. Subsections are children of sections. The sections are here to help us locate the subsections in the file. Data specific information is contained in the subsections data and their format is dependent on the section type.
A BGL file always start with a header (Size = 0x38 bytes), followed by a list of section pointers. The number of section pointers is defined in the header.
File Header
The header consists of 0x38 (56) bytes. It contains the number of sections defined in the file as well as the bounding geographical coordinates of the covered squared area.
| Offset | Number of bytes | Description |
|---|---|---|
| 0x00 | 4 - DWORD | Magic Number #1 – Must be 0x01, 0x02, 0x92, 0x19 |
| 0x04 | 4 - DWORD | Header size : 0x38 |
| 0x08 | 4 - DWORD | Unknown – Maybe a timestamp |
| 0x0C | 4 - DWORD | Unknown – Maybe a timestamp |
| 0x10 | 4 - DWORD | Magic Number #2 – Must be 0x03, 0x18, 0x05, 0x08 Maybe to identify the FS version |
| 0x14 | 4 - DWORD | The number of sections following this header. |
| 0x18 | 32 | Array[8] of unsigned integers (DWORD). Each value describes the bounding coordinates of a squared subarea. Even if 8 slots are provided, it is not necessary to have all 8 values filled. The list stops at the first null (0x00000000) value. |