Nonparametric clustering for spatio-temporal datasets