Carbon footprint of growing tomatoes in the wrong climate is like 4x higher than growing it in the right climate and transporting it.
Heating is one of the most power consuming activities in the world. The research has been done. The result can also be estimated numerically, carbon intensity of transport and of heating are well known.
In colder climates you must heat the greenhouse, which probably generates CO2. I say "probably" because a heat pump run on renewables is possible, but not likely.
http://shrinkthatfootprint.com/food-miles