  [Abridged] Most disks observed at high angular resolution show substructures.
Knowledge about the gas surface density and temperature is essential to
understand these. The aim of this work is to constrain the gas temperature and
surface density in two transition disks: LkCa15 and HD 169142. We use new ALMA
observations of the $^{13}$CO $J=6-5$ transition together with archival $J=2-1$
data of $^{12}$CO, $^{13}$CO and C$^{18}$O to observationally constrain the gas
temperature and surface density. Furthermore, we use the thermochemical code
DALI to model the temperature and density structure of a typical transition
disk. The $6-5/2-1$ line ratio in LkCa15 constrains the gas temperature in the
emitting layers inside the dust cavity to be up to 65 K, warmer than in the
outer disk at 20-30 K. For the HD 169142, the peak brightness temperature
constrains the gas in the dust cavity of HD 169142 to be 170 K, whereas that in
the outer disk is only 100 K. Models also show that a more luminous central
star, a lower abundance of PAHs and the absence of a dusty inner disk increase
the temperature of the emitting layers and hence the line ratio in the gas
cavity. The gas column density in the LkCa15 dust cavity drops by a factor >2
compared to the outer disk, with an additional drop of an order of magnitude
inside the gas cavity at 10 AU. In the case of HD 169142, the gas column
density drops by a factor of 200$-$500 inside the gas cavity, which could be
due to a massive companion of several M$_{\mathrm{J}}$. The broad dust-depleted
gas region from 10-68 AU for LkCa15 may imply several lower mass planets. This
work demonstrates that knowledge of the gas temperature is important to
determine the gas surface density and thus whether planets, and if so what kind
of planets, are the most likely carving the dust cavities.
