  Let $(\Omega, \mathfrak{A}, \mu)$ and $(\Gamma, \mathfrak{B}, \nu)$ be two
arbitrary measure spaces, and $p\in [1,\infty]$. Set $$L^p(\mu)_+^\mathrm{sp}:=
\{f\in L^p(\mu): \|f\|_p =1; f\geq 0\ \mu\text{-a.e.} \}$$ i.e., the positive
part of the unit sphere of $L^p(\mu)$. We show that every metric preserving
bijection $\Phi: L^p(\mu)_+^\mathrm{sp} \to L^p(\nu)_+^\mathrm{sp}$ can be
extended (necessarily uniquely) to an isometric order isomorphism from
$L^p(\mu)$ onto $L^p(\nu)$. A Lamperti form, i.e., a weighted composition like
form, of $\Phi$ is provided, when $(\Gamma, \mathfrak{B}, \nu)$ is localizable
(in particular, when it is $\sigma$-finite).
  On the other hand, we show that for compact Hausdorff spaces $X$ and $Y$, if
$\Phi$ is a metric preserving bijection from the positive part of the unit
sphere of $C(X)$ to that of $C(Y)$, then there is a homeomorphism $\tau:Y\to X$
satisfying $\Phi(f)(y) = f(\tau(y))$ ($f\in C(X)_+^\mathrm{sp}; y\in Y$).
