Clustering longitude and latitude gps data
I have more than 400 thousand cars GPS locations, like: [ 25.41452217, 37.94879532], [ 25.33231735, 37.93455887], [ 25.44327736, 37.96868896], ... I need to make spatial clustering with the distance between points <= 3 meters. I tried to use DBSCAN , but it seems that it is not working for geo(longitude, latitude) . Also, I do not know the number of clusters. You can use pairwise_distances to calculate Geo distance from latitude / longitude and then pass the distance matrix into DBSCAN, by specifying metric='precomputed'. To calculate the distance matrix: from sklearn.metrics.pairwise import