  We consider the localization number and metric dimension of certain graphs of
diameter $2$, focusing on families of Kneser graphs and graphs without
4-cycles. For the Kneser graphs with diameter $2$, we find upper and lower
bounds for the localization number and metric dimension, and in many cases
these parameters differ only by an additive constant. Our results on the metric
dimension of Kneser graphs improve on earlier ones, yielding exact values in
infinitely many cases. We determine bounds on the localization number and
metric dimension of Moore graphs of diameter $2$ and polarity graphs.
