The only way that I have been able to code for this is to do it on a per product ... but the question then begs to be answered ... what if you have 1 product from one location and another product from another location?

This then results in needing to compute both products separately ... and that may or may not be what you are looking for ...

To do this does require some extensive customization to be done ...

What shipping module(s) are you trying to use for this?