An expression for a location may designate its inhabitants, or a term for an occupant may direct attention to its setting, provided the transfer is conventional or contextually intelligible.
For example, “The whole town came out to welcome them” normally means the residents, not the buildings. The containing place stands for the people in it.
Such usage exemplifies non-similarity transfer only if the intended referent actually differs from the literal sense. Brevity by itself does not prove metaphor.