code: def _dispatchNextType(self,reader):
          
          
          # Need to check endianess here!
          endianness = reader.unpack_byte()
          if endianness == 0:
              reader.setEndianness('XDR')
          elif endianness == 1:
              reader.setEndianness('NDR')
          else:
              raise ExceptionWKBParser("Invalid endianness in WKB format.\n"\
                                       "The parser can only cope with XDR/big endian WKB format.\n"\
                                       "To force the WKB format to be in XDR use AsBinary(<fieldname>,'XDR'")
              
          
          geotype = reader.unpack_uint32() 
  
          mask = geotype & 0x80000000 # This is used to mask of the dimension flag.
  
          srid = geotype & 0x20000000
          # ignore srid ...
          if srid != 0:
              reader.unpack_uint32()
  
          dimensions = 2
          if mask == 0:
              dimensions = 2
          else:
              dimensions = 3
         
          geotype = geotype & 0x1FFFFFFF
          # Despatch to a method on the type id.
          if self._typemap.has_key(geotype):
              self._typemap[geotype](reader, dimensions)
          else:
              raise ExceptionWKBParser('Error type to dispatch with geotype = %s \n'\
                                       'Invalid geometry in WKB string: %s' % (str(geotype),
                                                                               str(self._current_string),))
docs: Read a type id from the binary stream (reader) and call the correct method to parse it.