< OSM Map On Magellan < Format

OSM Map On Magellan/Format/raimadb

Raima DB

The Magellan Map file uses a Raima DB Version 3.0 for storing text informations. This tries not to be a complete specification on the data base binary format. It shall only list, what is needed to know about it, to generate a compatible map.

The Raima Db conatains several tables, each stored within a single file and a dictionary file (db00.dbd) When the database is used in compression mode, there also exists one file per table, containing compression data/indexes.


db00.dbd

The dictionary lists all files, tables and fields belonging to the db. The file starts with a 22 bytes header, followed by the file table, then the list of tables and at least all fields within the tables.

Header
Bytes 0 - 21 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
0x56 (byte)0x33 (byte)0x2E (byte)0x30 (byte)0x30 (byte)0x1A (byte) PageSize (short) Number of Files (short) Number of Tables (short) Number of Fields (short) 0x00 (byte)0x00 (byte)0x00 (byte)0x00 (byte)0x00 (byte)0x00 (byte)0x00 (byte)0x00 (byte)

The PageSize is used in the table files. The data in the tables is organized in pages. This values specifies how big they are.


File Descriptor

Each file belonging to the database is described in the list of file descriptor. Each file descriptor is 60 bytes long. The first 49 bytes are reserved for the file name, the rest contains some flags and parameters belonging to the file.

File Descriptor
Bytes 22 - 81 0 - 48 49 50 51 52 53 54 55 56 57 58 59
File Name (ASCII) 0x00 (byte) 0x63=Closed (short) 0x64=Data (short) Aligned Record Length (short) 0x200 Page Size (short) 0x40=Compressed (short)

Each record inside a table must start on an even byte position. When the record length is odd the aligned record length is the real record length plus 1.

Here is the file descriptor for a compression table:

Compression Data File Descriptor
Bytes 82 - 141 0 - 48 49 50 51 52 53 54 55 56 57 58 59
File Name (ASCII) 0x00 (byte) 0x63=Closed (short) 0x63=Compression Data (short) Aligned Record Length (short) 0x200 Page Size (short) 0x40=Compressed (short)

Compression data Files have the file name extension as the corresponding file and also the name is nearly the same. The difference is a trailing c in the name of the compression data file.

Data File 00cn.dat => Compression data File 00cnc.dat

Table Descriptor

Next follows the list of tables. Each Entry in this list is 12 bytes long. The compression tables are not listed here only the tables containing data.


Table Descriptor
Bytes 142 - 153 01234567891011
Index of Table File in File List (short) Record Length (short) 0x06 (short) Index of first Field in Field List (short) Number of Fields (short) 0x00 (short)

List of Fields

Each table may have multiple fields per row. All fields of all tables are listed next. In the table descriptor there is an index (Index of first Field in Field list) pointing to the first field belonging to a table. Following types of fields are used within magellan data base files:

byte
012345678910111213141516171819
0x63 (byte) 0x01 Field length (short) 0x00 Dimension (short) 0x00 (short) 0x00 (short) 0x00 (short) 0x00 (short) Field offset within table row (short) Number of Table (short) 0x04 (short) 0x00 (byte)
short
012345678910111213141516171819
0x73 (byte) 0x02 Field length (short) 0x00 Dimension (short) 0x00 (short) 0x00 (short) 0x00 (short) 0x00 (short) Field offset within table row (short) Number of Table (short) 0x04 (short) 0x00 (byte)
integer
012345678910111213141516171819
0x6C (byte) 0x04 Field length (short) 0x00 Dimension (short) 0x00 (short) 0x00 (short) 0x00 (short) 0x00 (short) Field offset within table row (short) Number of Table (short) 0x04 (short) 0x00 (byte)
String (length = 248)
012345678910111213141516171819
0x63 (byte) 0xF8 Field length (short) 0xF8 Dimension (short) 0x01 (short) 0x00 (short) 0x00 (short) 0x00 (short) Field offset within table row (short) Number of Table (short) 0x00 (short) 0x00 (byte)
Array of Integer (Dim = 39)
012345678910111213141516171819
0x6C (byte) 0x9C Field length (short) 0x27 Dimension (short) 0x00 (short) 0x00 (short) 0x00 (short) 0x00 (short) Field offset within table row (short) Number of Table (short) 0x04 (short) 0x00 (byte)
String (Length = 25)
012345678910111213141516171819
0x63 (byte) 0x19 Field length (short) 0x19 Dimension (short) 0x00 (short) 0x00 (short) 0x00 (short) 0x00 (short) Field offset within table row (short) Number of Table (short) 0x00 (short) 0x00 (byte)


The file ends with the list of table names and field names, each seperated by a Carriage return ('\n').


Each row in a table has 6 starting bytes containing table and row number.

Row prefix
012345
Table Number (short) TableNumber << 25 + row (int)

Tables

The first table in the Database is a zip Code table and a City name table. These two tables are typically empty.

Zip Code Table (table name = "Z_R", file name = "00z.dat")
"ZIP_CODE" (integer) "C_REF" (integer)
City names (table name = "C_R", file name = "00cn.dat")
"CITY_BUF" (String[248])


This is followed by three tables per group containing names of elements in the layer files and linkage informations. ([GroupNr.] is a placeholder for the numerical number of the group, the three tables belong to.

Text table (table name = "AUX_GR[GroupNr.]", file name = "00gc[GroupNr.].aux")
"NAME_BUF" (String[248])

This table can contain several texts/names in a single row. When this is the case, all texts are seperated by a 0x00 byte. It is also possible, that a text exceeds a single line. In this case the last byte of the String is not a 0x00 but any character. This is used to tell the interpreter, that the text is continued in the next row. In all other cases the last byte in the array must always be a 0x00.

Link table (table name = "R_GR[GroupNr.]", file name = "00gc[GroupNr.].ext")
"NAME_REF" (integer) "CELL_NUM" (integer) "N_IN_C" (integer) "OBJ_TYPE" (short)

This table links between the elements in layer files.

  • 'NAME_REF' references a text entry in the Text Table. It is calculated by NAME_REF = (Offset of the text in the row) << 24 + (row number)
  • 'CELL_NUM' is the number of the cell in the layer file.
  • 'N_IN_C' is the number of the referenced element within the cell
  • 'OBJ_TYPE' is at the end nothing else than the layer itself.

(All types listed in the table description are field types from the chapter before)

CLP table (table name = "RC_GR[GroupNr.]", file name = "00gc[GroupNr.].clp")
"CELL_NUM" (integer) "N_IN_C" (integer)

This table can remain empty. (Purpose is unclear)

Example

Here is an example of an db00.dbd file for a table with a single group. All files in the table are compressed. Following files are belonging to the database:

  • 00cn.dat City Name References
  • 00cnc.dat Compression data for 00cn.dat
  • 00z.dat Zip code table
  • 00zc.dat Corresponding Compression data
  • 00gr0.aux Text Table
  • 00gr0c.aux Compression data
  • 00gr0.ext Link table
  • 00gr0c.ext Compression data
  • 00gr0.clp CLP Table
  • 00gr0c.clp Compression data
  • db00.dbd Database dictionary


0x560x330x2E0x300x300x1A0x000x020x0A0x000x050x000x0A0x000x000x000x000x000x000x000x000x000x300x300x7A0x2E0x640x610x740x000x000x000x000x000x000x00
0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00
0x630x640x240x000x0E0x000x000x020x400x000x300x300x7A0x630x2E0x640x610x740x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00
0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x630x630x3F0x000x080x000x000x020x000x000x300x30
0x630x6E0x2E0x640x610x740x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00
0x000x000x000x000x000x000x000x000x000x000x000x000x630x640x020x000xFE0x000x000x020x400x000x300x300x630x6E0x630x2E0x640x610x740x000x000x000x000x00
0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00
0x630x630x3F0x000x080x000x000x020x000x000x300x300x670x720x300x2E0x650x780x740x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00
0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x630x640x1C0x000x120x000x000x020x400x000x300x30
0x670x720x300x630x2E0x650x780x740x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00
0x000x000x000x000x000x000x000x000x000x000x000x000x630x630x3F0x000x080x000x000x020x000x000x300x300x670x720x300x2E0x630x6C0x700x000x000x000x000x00
0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00
0x630x640x2A0x000x0C0x000x000x020x400x000x300x300x670x720x300x630x2E0x630x6C0x700x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00
0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x630x630x3F0x000x080x000x000x020x000x000x300x30
0x670x720x300x2E0x610x750x780x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00
0x000x000x000x000x000x000x000x000x000x000x000x000x630x640x020x000xFE0x000x000x020x400x000x300x300x670x720x300x630x2E0x610x750x780x000x000x000x00
0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00
0x630x630x3F0x000x080x000x000x020x000x000x000x000x0E0x000x060x000x000x000x020x000x000x000x020x000xFE0x000x060x000x020x000x010x000x000x000x040x00
0x110x000x060x000x030x000x040x000x000x000x060x000x0C0x000x060x000x070x000x020x000x000x000x080x000xFE0x000x060x000x090x000x010x000x000x000x6E0x6C
0x040x000x000x000x000x000x000x000x000x000x000x000x060x000x000x000x040x000x6E0x6C0x040x000x000x000x000x000x000x000x000x000x000x000x0A0x000x000x00
0x040x000x6E0x630xF80x000xF80x000x010x000x000x000x000x000x000x000x060x000x010x000x000x000x6E0x6C0x040x000x000x000x000x000x000x000x000x000x000x00
0x060x000x020x000x040x000x6E0x6C0x040x000x000x000x000x000x000x000x000x000x000x000x0A0x000x020x000x040x000x6E0x730x020x000x000x000x000x000x000x00
0x000x000x000x000x0E0x000x020x000x040x000x6E0x630x010x000x000x000x000x000x000x000x000x000x000x000x100x000x020x000x040x000x6E0x6C0x040x000x000x00
0x000x000x000x000x000x000x000x000x060x000x030x000x040x000x6E0x730x020x000x000x000x000x000x000x000x000x000x000x000x0A0x000x030x000x040x000x6E0x63
0xF80x000xF80x000x010x000x000x000x000x000x000x000x060x000x040x000x000x000x5A0x5F0x520x0A0x430x5F0x520x0A0x520x5F0x470x520x300x0A0x520x430x5F0x47
0x520x300x0A0x410x550x580x5F0x470x520x300x0A0x5A0x490x500x5F0x430x4F0x440x450x0A0x430x5F0x520x450x460x0A0x430x490x540x590x5F0x420x550x460x0A0x4E
0x410x4D0x450x5F0x520x450x460x0A0x430x450x4C0x4C0x5F0x4E0x550x4D0x0A0x4E0x5F0x490x4E0x5F0x430x0A0x4F0x420x4A0x5F0x540x590x500x450x0A0x430x450x4C
0x4C0x5F0x4E0x550x4D0x0A0x4E0x5F0x490x4E0x5F0x430x0A0x4E0x410x4D0x450x5F0x420x550x460x0A
This article is issued from Openstreetmap. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.