Changes between Version 4 and Version 5 of FGDBSpecification


Ignore:
Timestamp:
Oct 9, 2013, 12:16:04 AM (11 years ago)
Author:
Even Rouault
Comment:

fixes in geometry field description and clearer explanations for varint

Legend:

Unmodified
Added
Removed
Modified
  • FGDBSpecification

    v4 v5  
    8181|| int16 || length (in bytes) of the WKT string describing the SRS. ||
    8282|| string || WKT string describing the SRS Or "{B286C06B-0879-11D2-AACA-00C04FA33C20}" for no SRS . ||
    83 || ubyte || "magic" (used after). Value is generally 5 or 7 ||
     83|| ubyte || "magic" (used after). Value is generally 5 or 7 (or 1 in system tables) ||
    8484|| float64 || xorigin ||
    8585|| float64 || yorigin ||
    8686|| float64 || xyscale ||
    87 || float64 || zorigin ||
    88 || float64 || zscale ||
    89 || float64 || morigin (omitted if magic = 5) ||
    90 || float64 || mscale (omitted if magic = 5) ||
     87|| float64 || zorigin (omitted if magic = 1) ||
     88|| float64 || zscale (omitted if magic = 1)  ||
     89|| float64 || morigin (omitted if magic = 1 or 5) ||
     90|| float64 || mscale (omitted if magic = 1 or 5) ||
    9191|| float64 || xytolerance ||
    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
     99If 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
    105109
    106110For field type = 8 (binary),
     
    168172
    169173Geometry blobs use 2 new encoding schemes :
    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.
    172176
    173177||'''Format'''||'''Content'''||