I want to cluster based on time lat and long. Is there a way I can do this?

The context is I am trying to detect connected sites in same electric ring. The data I have is the location of the site(lat/long), date-time of electricity failure and date-time of power-up.

Simply I want to cluster sites that go down when there is a power outage.

  • 1
    For software recommendations there is the Software Recommendations Stack Exchange.
    – PolyGeo
    Sep 27, 2019 at 6:28
  • @PolyGeo's reference is helpful, however, your question is most welcome here at GIS SE.
    – Aaron
    Mar 2, 2020 at 5:35

2 Answers 2


If I had to do this kind of things, I would import the data in Postgres and make a ST_ClusterDBSCAN, this will handle the spatial issue. And then work with some times in group or partition.
Then you could show the data in Qgis as GIS , which is good.


But I also think that there is more relevant methods in Python. You can look in sklearn for clustering algorithm, Geopandas for the the spatial component. Matplotlib can help you show your data at this point.

For exemple: http://darribas.org/gds_scipy16/ipynb_md/07_spatial_clustering.html

NB : this is not THE way to go, but will be mine (so, opinion based and with what I know)

  • I am looking for ST_DBSCAN implementations. Found 3 on Github. Thanks for the input. Sep 30, 2019 at 6:16

I found a good answer in Github. Basically is the implementation of ST-DBSACAN Algorithm.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.