Here, we are dealing with the macroscopic traffic-flow model by Lighthill-Whitham-Richards (LWR), which consists in a scalar hyperbolic conservation law
$$
\frac{\partial}{\partial t} \rho + \frac{\partial}{\partial x} Q(\rho) = 0 \, ,
$$
where the flux $Q(\rho)=\rho\, v(\rho)$ depends only on the density of cars $\rho$. The simplest expression for the car velocity of the form $v(\rho) = 1 - \rho$ was introduced by Greenshields. The car density is constant along the characteristics, which are given by $dx/dt = Q'(\rho) = 1 - 2\rho$. The characteristic curve issued from $x_0$ is a straight line in $x$-$t$ space, $x(t) = (1-2\rho_0(x_0))t + x_0$, on which the car density equals its initial value
$$
\rho_0(x_0) = \left\lbrace
\begin{aligned}
&a &&\text{if}\quad x_0<-1\\
&a(1-x_0)/2 &&\text{if}\quad {-1}<x_0<0\\
&a(1+x_0)/2 &&\text{if}\quad 0<x_0<1\\
&a &&\text{if}\quad 1<x_0\, .
\end{aligned}\right.
$$
Let us assume that $0< a < 1/2$. The slope of the characteristics is larger in the slit* than outside. Since the slope is positive, the characteristics cross on the right of the slit: a shock-wave arises. On the left of the shock trajectory $(x(t),t)$, we have the data coming from the slit. From the equation of characteristics, we deduce
$$
\rho_0(x_0) = -\frac{1}{2}\left( \frac{x(t) - x_0}{t} -1 \right) = \frac{a}{2} \left(1 \mp x_0\right) .
$$
Solving with respect to $x_0$, one obtains
$$
x_0 = \frac{x(t) - t + at}{ 1 \pm at} \quad\text{and}\quad
\rho_0(x_0) = \frac{a}{2} \frac{1 \mp (x(t) - t)}{1 \pm at} \, ,
$$
depending whether $(x(t),t)$ has $x_0$ in $[-1,0]$ or in $[0,1]$. On the right, we have the data from outside the slit: $\rho_0(x_0) = a$. Therefore, the Rankine-Hugoniot condition writes
$$
x'(t) = \frac{Q\!\left(\frac{a}{2} \frac{1 \mp (x(t) - t)}{1 \pm at}\right) - Q(a) }{\frac{a}{2} \frac{1 \mp (x(t) - t)}{1 \pm at} - a}\, ,
$$
which is a differential equation with initial condition $x(0) = 1$. Solving this equation gives the shock trajectory. The case $1/2<a<1$ is tackled in a similar manner.
*slit : area where ${-1}<x_0<1$.