A logical approach towards terrain pattern recognition for engineering purposes