Osb spec v2

Primitives

id Type Size (bytes) Description
<PTR>int648Offset inside the file
<STRING>int32 + n * int164 + n * 2A string. length in bytes + n*Wchar, UTF16 encoded

Structure

Elements

Type Size (bytes) Description Remarks
char(3)3'O', 'S', 'B'Magic
int1622Version
<PTR>8[RegionToc]Offset to file Region Table-of-content
<PTR>8[TagKeys]Offset to Tag keys table
<PTR>8[TagValues]Offset to Tag values table

Tags

TagKeys

TypeSize (bytes)DescriptionRemarks
int328[numKeys]Number of unique keys
String(String)*[numKeys]KeysList of Keys

TagValues

TypeSize (bytes)DescriptionRemarks
int328[numValues]Number of unique values
<STRING><STRING>*[numValues]ValuesList of Values

Features

Nodes

TypeSize (bytes)DescriptionRemarks
char1'N'Magic
int648idOSM id
int324longitude
int324latitude

Ways

TypeSize (bytes)DescriptionRemarks
char1'R'Magic
int648idOSM id
int324(numNodes)number of nodes
<PTR>8*(numNodes)list of node offset

Relations

Header

TypeSize (bytes)DescriptionRemarks
char1'L'Magic
int648idOSM id
int324(numChildren)number of children
Children

TypeSize (bytes)DescriptionRemarks
char1'N' or 'R' or 'L'Child type
<PTR>8[Child]Offset to child definition
String(String)RoleChild role

TileTOC

Header

TypeSize (bytes)DescriptionRemarks
int324[numFeatures]number of features in the tile

Item

TypeSize (bytes)DescriptionRemarks
<PTR>8Feature offsetOffset to one feature in the tile

TileRegionTOC

Header

TypeSize (bytes)DescriptionRemarks
int324[numTiles]number of tiles in the region

Item

TypeSize (bytes)DescriptionRemarks
int324[idTile]the ID of the Tile
<PTR>8Tiles offsetOffset to the list of features for the tile

RegionToc

Header

TypeSize (bytes)DescriptionRemarks
int324[numRegions]number of regions in the TOC

Item

TypeSize (bytes)DescriptionRemarks
int324[idRegion]the ID of the Region
<PTR>8Tiles offsetOffset to the list of tiles for the region
This article is issued from Openstreetmap. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.