What landscape type(material) am I standing now ,How to know what landscape type am I standing now.

I want to make my character speed depend on the landcaoe type he is standing now. How can I figure out type of this lanscape material? For example: on dirt material my SPEED < then my SPEED on grass material.