If upon the hearing it shall appear to the court that testimony is necessary for the proper disposition of the matter, it may take evidence, or appoint a referee to take such evidence as it may direct and report the same to the court with his findings of fact and conclusions of law, which shall constitute a part of the proceedings upon which the determination of the court shall be made.
SDCL 11-4-28