This article proposes a new method combining convex optimization and viability theory for estimating traffic flow conditions on highway segments. Traffic flow is modeled by a Hamilton-Jacobi equation. Using a Lax-Hopf formula, we formulate the necessary and sufficient conditions for a mixed boundary and internal conditions problem to be well posed. The well-posedness conditions result in a system of linear inequalities, which enables us to compute upper and lower bounds on traffic flow parameters as the solution to a linear program. We illustrate the capabilities of the method with a data assimilation problem for the estimation of the travel time function using Eulerian and Lagrangian measurements generated from Next Generation Simulation (NGSIM) traffic data.