Boundary Format

This article has been translated from the original article in French.

''Note: The usefulness or effectiveness of the altitude in pkg files with World Wind 1.3 is up in the air. See this thread for details''

Introduction
The wwb files are used to define boundaries (countries and states), and you can make a pathlist with them using PathListArchiver.exe.

The pkg and idx files are used to define the pathlist (in 3D).

This document details the binary formats of these files and thus the associated XML files.

The types used are:

int32		32-bit integer int64		64-bit integer smallint	16-bit integer Single	1.5 x 10^-45 .. 3.4 x 10^38	4-byte real number Double	5.0 x 10^-324 .. 1.7 x 10^308	8-byte real number Pstring	string : A byte indicating the length of the string followed by characters

The altitudes are important, they allow the paths to float above the terrain, otherwise they disappear within the mountains.

wwb Format
The file begins with a 32-bit integer containing the number of entries in the file. The file continues with a series of entries consisting of a float latitude and float longitude.

int32	number of pairs (latitude, longitude) in the file // entry 1 single	latitude single	longitude // entry 2 single	latitude single	longitude

IDX Format
The file begins with the number of wwb files associated in a 32-bit integer. Next is an entry for each wwb file. Each entry consists of a string, the west, south, east, and north limits in a double, and a 64-bit integer for the offset of the data in the pkg file.

int32	Number of wwb files = Number of groups in this package // wwb file 1 (wwb offset 1) PString	name of a wwb file, a string double	west double	south double	east double	north Int64	offset wwb 1 = offset of data in pkg file // wwb file 2 (wwb offset 2) PString	name of a wwb file, a string double	west double	south double	east double	north Int64	offset wwb 1 = offset of data in pkg file // wwb file 3 (wwb offset 3) ...

pkg format
The file contains a list of the entries containing the coordinates of each of the associated wwb files. Every description starts with a 32-bit number indicating the number of entries in the section, followed by the number of elements per entry (3 for latitude, longitude and altitude). Next are the list of entries (lat, long, h).

// wwb file 1 (wwb offset 1) int32	number of entries (lat, long, h) byte	number of elements per entry = 3 (lat, long, h) // entry 1 double	lat double	long smallint	h (16 bits) // entry 2 double	lat double	long smallint	h (16 bits) ... // wwb file 2 (wwb 2) int32	number of entries (lat, long, h) byte	number of elements per entry = 3 (lat, long, h) // entry 1 double	lat double	long smallint	h (16 bits) // entry 2 double	lat double	long smallint	h (16 bits) ... // wwb file 3 ...

Example of the XML file associated with a pathlist
   Trail 1000 0 6000000 Data\WorldWindow.Earth\monchemin Cyan  </LayerSet>

The folder Data\WorldWindow.Earth\monchemin contains a file pathlist.pkg and a file pathlist.idx that define the path.

External link
Windows System Colors - for WinColorName