45,000 sounds plausible countrywide. Few years ago I heard there were 10,000 or so in Warsaw alone.
I think the numbers simply come from the regional Immigration Offices; one in Warsaw, one in Krakow. I have no idea whether there are other such government offices in, say, TriCity or Wroclaw, but I imagine a Brit finding himself in Swidnik or Zamosc will have to submit papers to an office which forwards them to Krakow to be processed, and in that way, it looks like there are 18,000 foreigners in that city, when they are in fact spread over the whole of Galicia.