My source for most of these figures: http://pubs.acs.org/doi/full/10.1021/es702969f
Only 10% or so of emissions come from transport, and only 4% come from “final transport” (which is what is used when determining if food is local). A lot of the transit costs are incurred by moving say farm tools to the farm, and these costs are often incurred by local farmers to the same degree as remote farmers. Then 83% of the costs (greenhouse gas costs) are related to actually growing the food. So it’s beneficial to grow food further from the delivery point if doing so is more efficient (in a better than 7 to 1 ratio). Or it’s worth spending a lot more on transit to save a little on growing costs.
Of course, all else being equal, it’s better to not spend any transit costs. So the better question is likely not “how far did this food have to be transported to get to the store”, but rather “how suitable is the climate of the location where this food is being grown to agriculture of this sort”.