On the metric dimension of affine planes, biaffine planes and generalized quadrangles