Smoothing mixed models for spatial and spatio-temporal data