In the theory of Anderson localization, a landscape function predicts where wave functions localize in a disordered medium, without requiring the solution of an eigenvalue problem. It is known how to construct the localization landscape for the scalar wave equation in a random potential, or equivalently for the Schrödinger equation of spinless electrons. Here we generalize the concept to the Dirac equation, which includes the effects of spin-orbit coupling and allows to study quantum localization in graphene or in topological insulators and superconductors. The landscape function u(r) is defined on a lattice as a solution of the differential equation H u(r) = 1, where H is the Ostrowsky comparison matrix of the Dirac Hamiltonian. Random Hamiltonians with the same (positive definite) comparison matrix have localized states at the same positions, defining an equivalence class for Anderson localization. This provides for a mapping between the Hermitian and non-Hermitian Anderson model.