Example 4 Given real numbers $x, y$ satisfy $\left\{\begin{array}{l}x-y+2 \geqslant 0 \\ x+y-4 \geqslant 0 \\ 2 x-y-5 \leqslant 0\end{array}\right.$, find the maximum value of $z=|x+2 y-4|$.
Solve: First, draw the feasible region that satisfies the conditions, as shown in the shaded area in Figure 4. Convert the objective function $z=|x+2 y-4|$ to $z=\sqrt{5} - \frac{|x+2 y-4|}{\sqrt{1^{2}+2^{2}}}$, the problem is then reduced to finding the maximum value of $\sqrt{5}$ times the distance from points $(x, y)$ in the feasible region to the line $x+2 y-4=0$. Observing, the distance from point $C$ to the line $x+2 y-y=0$ is the maximum. Solving $\left\{\begin{array}{l}x-y+2=0 \\ 2 x-y-5=0\end{array}\right.$ yields $C(7,9)$, thus
$$z_{\max }=\sqrt{5} \cdot \frac{|7+2 \times 9-4|}{\sqrt{5}}=21 .$$