Byte Offset  Content  Notes 

0  START [hex 00]  a GEOMETRY encoded BLOB value must always start with a 0x00 byte 
1  ENDIAN [hex 00 or hex 01] [hex 80 or hex 81] 
if this GEOMETRY is BIG_ENDIAN ordered must contain a 0x00 byte value otherwise, if this GEOMETRY is LITTLE_ENDIAN ordered must contain a 0x01 byte value Any other value [neither 0x00 nor 0x01], means that this BLOB cannot be a valid GEOMETRY Starting from version 5.0 the special values 0x80 or 0x81 identify the new BLOB TinyPoint encoding. 
2  5  SRID  a 32bits integer value [little
bigendian ordered, accordingly with the precedent one] corresponding to the SRID for this GEOMETRY 
6  13  MBR_MIN_X  a double value [little
bigendian ordered, accordingly with the precedent one] corresponding to the MBR minimum X coordinate for this GEOMETRY 
14  21  MBR_MIN_Y  a double value corresponding to the MBR minimum Y coordinate 
22  29  MBR_MAX_X  a double value corresponding to the MBR maximum X coordinate 
30  37  MBR_MAX_Y  a double value corresponding to the MBR maximum Y coordinate 
38  MBR_END [hex 7C]  a GEOMETRY encoded BLOB value must always have an 0x7C byte in this position 
39  42  CLASS TYPE  a 32bits integer; must identify a valid WKB class, i.e.
Using recent versions (v.2.4 or any subsequent) the following extended classes are supported as well:

43  ...  geometry class specific  length and content depends on geometry class [POINT, LINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION etc] 
LAST  END [hex FE]  a GEOMETRY encoded BLOB value must always end with a 0xFE byte 
GEOMETRY class 



POINT 


LINESTRING 


POLYGON 


MULTIPOINT 


MULTILINESTRING 


MULTIPOLYGON 


GEOMETRYCOLLECTION 

Byte Offset  Content  Notes 

0  ENTITY [hex 69]  a GEOMETRY encoded BLOB value must always have an 0x69 byte in this position 
1  4  CLASS TYPE  a 32bits integer; must identify a valid WKB class that can be included within a collection, i.e.

5  ...  geometry class specific  Length and content depends on geometry class [POINT, LINESTRING or POLYGON] 
XYZ GEOMETRY class 



POINT Z 


LINESTRING Z 


POLYGON Z 


MULTIPOINT Z 


MULTILINESTRING Z 


MULTIPOLYGON Z 


GEOMETRYCOLLECTION Z 

Byte Offset  Content  Notes 

0  ENTITY [hex 69]  a GEOMETRY encoded BLOB value must always have an 0x69 byte in this position 
1  4  CLASS TYPE  a 32bits integer; must identify a valid WKB class that can be included within a collection, i.e.

5  ...  geometry class specific  Length and content depends on geometry class [POINT Z, LINESTRING Z or POLYGON Z] 
XYM GEOMETRY class 



POINT M 


LINESTRING M 


POLYGON M 


MULTIPOINT M 


MULTILINESTRING M 


MULTIPOLYGON M 


GEOMETRYCOLLECTION M 

Byte Offset  Content  Notes 

0  ENTITY [hex 69]  a GEOMETRY encoded BLOB value must always have an 0x69 byte in this position 
1  4  CLASS TYPE  a 32bits integer; must identify a valid WKB class that can be included within a collection, i.e.

5  ...  geometry class specific  Length and content depends on geometry class [POINT M, LINESTRING M or POLYGON M] 
XYZM GEOMETRY class 



POINT ZM 


LINESTRING ZM 


POLYGON ZM 


MULTIPOINT ZM 


MULTILINESTRING ZM 


MULTIPOLYGON ZM 


GEOMETRYCOLLECTION ZM 

Byte Offset  Content  Notes 

0  ENTITY [hex 69]  a GEOMETRY encoded BLOB value must always have an 0x69 byte in this position 
1  4  CLASS TYPE  a 32bits integer; must identify a valid WKB class that can be included within a collection, i.e.

5  ...  geometry class specific  Length and content depends on geometry class [POINT ZM, LINESTRING ZM or POLYGON ZM] 
Uncompressed Class  Compressed Class 

2 = LINESTRING  1000002 = COMPRESSED LINESTRING 
3 = POLYGON  1000003 = COMPRESSED POLYGON 
1002 = LINESTRING Z  1001002 = COMPRESSED LINESTRING Z 
1003 = POLYGON Z  1001003 = COMPRESSED POLYGON Z 
2002 = LINESTRING M  1002002 = COMPRESSED LINESTRING M 
2003 = POLYGON M  1002003 = COMPRESSED POLYGON M 
3002 = LINESTRING ZM  1003002 = COMPRESSED LINESTRING ZM 
3003 = POLYGON ZM  1003003 = COMPRESSED POLYGON ZM 
Byte Offset  Content  Notes  

0  3  number of POINTs  a 32bits integer specifying the number of POINTs in this compressed LINESTRING  
4  19  first POINT  first POINT always is uncompressed  
20  ...  compressed POINTs 
any further POINT [except the last one] always is expected to be compressed 

END16  END  last POINT  last POINT always is uncompressed so to fully preserve topological consistency 
Byte Offset  Content  Notes 

0  3  number of RINGs  a 32bits integer specifying the number of RINGs in this compressed POLYGON 
4  ...  RINGs  a corresponding sequence of compressed RINGs [ compressed LINESTRINGs] 
Byte Offset  Content  Notes  

0  3  number of POINTZs  a 32bits integer specifying the number of POINTZs in this compressed LINESTRING Z  
4  27  first POINT Z  first POINT Z always is uncompressed  
28  ...  compressed POINTZs 
any further POINT Z [except the last one] always is expected to be compressed 

END24  END  last POINT Z  last POINT Z always is uncompressed so to fully preserve topological consistency 
Byte Offset  Content  Notes 

0  3  number of RINGZs  a 32bits integer specifying the number of RINGZs in this compressed POLYGON Z 
4  ...  RINGZs  a corresponding sequence of compressed RINGZs [ compressed LINESTRINGZs] 
Byte Offset  Content  Notes  

0  3  number of POINTMs  a 32bits integer specifying the number of POINTMs in this compressed LINESTRING M  
4  27  first POINT M  first POINT M always is uncompressed  
28  ...  compressed POINTMs 
any further POINT M [except the last one] always is expected to be compressed 

END24  END  last POINT M  last POINT M always is uncompressed so to fully preserve topological consistency 
Byte Offset  Content  Notes 

0  3  number of RINGMs  a 32bits integer specifying the number of RINGMs in this compressed POLYGON M 
4  ...  RINGMs  a corresponding sequence of compressed RINGMs [ compressed LINESTRINGMs] 
Byte Offset  Content  Notes  

0  3  number of POINTZMs  a 32bits integer specifying the number of POINTZMs in this compressed LINESTRING ZM  
4  35  first POINT ZM  first POINT ZM always is uncompressed  
36  ...  compressed POINTZMs 
any further POINT ZM [except the last one] always is expected to be compressed 

END32  END  last POINT ZM  last POINT ZM always is uncompressed so to fully preserve topological consistency 
Byte Offset  Content  Notes 

0  3  number of RINGZMs  a 32bits integer specifying the number of RINGZMs in this compressed POLYGON ZM 
4  ...  RINGZMs  a corresponding sequence of compressed RINGZMs [ compressed LINESTRINGZMs] 