92 | | || float64 || ztolerance || |
93 | | || float64 || mtolerance (omitted if magic = 5) || |
94 | | || float64 || xmin of layer extent || |
95 | | || float64 || ymin of layer extent || |
96 | | || float64 || xmax of layer extent || |
97 | | || float64 || ymax of layer extent || |
98 | | |
99 | | The organization of following bytes is a bit messy and seems to comply to the following algorithm : |
100 | | 1) Store current offset |
101 | | 2) Skip one byte |
102 | | 3) Read int32 value "magic2". |
103 | | a) if magic2 = 0, then rewind to the stored offset and read 2 float64 (that happen to be NaN values). And then go to 2) |
104 | | b) otherwise (generally magic2 = 1 or magic2 = 3), skip magic2 x float64 values |
| 92 | || float64 || ztolerance (omitted if magic = 1) || |
| 93 | || float64 || mtolerance (omitted if magic = 1 or 5) || |
| 94 | || float64 || xmin of layer extent (omitted if magic = 1) || |
| 95 | || float64 || ymin of layer extent (omitted if magic = 1) || |
| 96 | || float64 || xmax of layer extent (omitted if magic = 1) || |
| 97 | || float64 || ymax of layer extent (omitted if magic = 1) || |
| 98 | |
| 99 | If magic > 1, there are extra bytes whose organization seems to comply to the following algorithm : |
| 100 | |
| 101 | {{{ |
| 102 | 1) Store current offset |
| 103 | 2) Skip one byte |
| 104 | 3) Read int32 value "magic2". |
| 105 | a) if magic2 = 0, then rewind to the stored offset and read 2 float64 (that happen to be NaN values). And then go to 2) |
| 106 | b) otherwise (generally magic2 = 1 or magic2 = 3), skip magic2 x float64 values |
| 107 | }}} |
| 108 | |
170 | | * varuint : a sequence of bytes [b0, b1, ... bN]. All bytes except last one have their msb (most significant bit) set to 1. The presence of a msb = 0 marks the end of the sequence. The value of the varuint is (b0 & 0x7F) | ((b1 & 0x7F) << 7) | ((b2 & 0x7F) << 14 | ... | (bN & 0x7F) << (7 * N). Note that a valid sequence might be just 1 byte. |
171 | | * varint : same concept as varuint. But the 2nd most significant bit of b0 (i.e. the one obtained by masking with 0x40) indicates the sign of the result, and should be ignored in the computation of the unsigned value. If the bit sign is set to 1, the value must be negated. |
| 174 | * varuint (64 bit): a sequence of bytes [b0, b1, ... bN]. All bytes except last one have their msb (most significant bit) set to 1. The presence of a msb = 0 marks the end of the sequence. The value of the varuint is (b0 & 0x7F) | ((b1 & 0x7F) << 7) | ((b2 & 0x7F) << 14 | ... | (bN & 0x7F) << (7 * N). Note that a valid sequence might be just 1 byte. |
| 175 | * varint (64 bit): same concept as varuint. But the 2nd most significant bit of b0 (i.e. the one obtained by masking with 0x40) indicates the sign of the result, and should be ignored in the computation of the unsigned value : (b0 & 0x3F) | ((b1 & 0x7F) << 6) | ((b2 & 0x7F) << 13 | ... | (bN & 0x7F) << (7 * N - 1). If the bit sign is set to 1, the value must be negated. |