Calculate shipping based on square meters (m2)
I'm struggling with a a similar problem.

From what I can see, the only way to do it with Ubercart is to connect to the API of an appropriate shipping company that supports volumetric shipping calculations. The availability of this (in terms of an existing module) will depend on which country you're working in, plus it will depend on whether there is an existing module that supports the specific carrier you've chosen.

The US is obviously well-served in this regard. Outside the US, support can be patchy, to say the least.