I have a set of sea surface temperature (SST) monthly data and I want to apply some cluster methodology to detect regions with similar SST patterns. I have a set of monthly data files running from 1985 to 2009 and want to apply clustering to each month as a first step.

Each file contains gridded data for 358416 points where approximately 50% are land and are marked with a 99.99 value that will be NA. Data format is:

   lon     lat   sst
-10.042  44.979  12.38
 -9.998  44.979  12.69
 -9.954  44.979  12.90
 -9.910  44.979  12.90
 -9.866  44.979  12.54
 -9.822  44.979  12.37
 -9.778  44.979  12.37
 -9.734  44.979  12.51
 -9.690  44.979  12.39
 -9.646  44.979  12.36

I have tried CLARA clustering method and got some apparently nice results but it also seems to me that is just smoothing (grouping) isolines. Then I am not sure this is the best clustering method to analyse spatial data.

Is there any other clustering method devoted to this type of datasets? Some reference would be good to start reading.

Thanks in advance.

  • 2
    $\begingroup$ You should check out cran.r-project.org/web/views/Spatial.html . There are a few packages that have cluster right in the name that would probably be of interest. $\endgroup$
    – Andy W
    Commented Apr 19, 2011 at 14:57
  • $\begingroup$ Did you find any good R package to cluster spatial data? $\endgroup$
    – kaptan
    Commented Dec 6, 2011 at 2:48
  • $\begingroup$ @kaptan Unfortunately I didn't and it is one of the $\endgroup$
    – pacomet
    Commented Dec 6, 2011 at 23:04
  • $\begingroup$ This question's title is confusing: $(x,y,T)\in\mathbb{R}^3$, not $\mathbb{R}$! $\endgroup$
    – GeoMatt22
    Commented Sep 19, 2016 at 1:13

2 Answers 2


There is different approach for scalable clustering, divide and conquer approach, parallel clustering and incremental one. This is for general approach after you can use normal clustering methods. There a good method of clustering i really appreciate is DBSCAN (Density-Based Spatial Clustering of Applications with Noise) it is one of the most used clustering algorithm.

  • $\begingroup$ Ok, I'll look for DBSCAN and give it a try. Thanks $\endgroup$
    – pacomet
    Commented May 13, 2011 at 6:43
  • $\begingroup$ If any answer helped you or you find out another way it is better to give us, so all community will take advantage of that. Or choose an answer to close the question, thx. $\endgroup$ Commented May 20, 2011 at 15:26
  • $\begingroup$ I'm sorry for the delay in answering but the point is I haven't got much time to try dbscan and first attempts resulted in a memory problem. R says it can not allocate vector. I start with a 4 km spaced grid with 779191 points that ends in 300000 points when removing land (not valid) SST points. Maybe I'm not getting the right approach, any hint would be appreciated. $\endgroup$
    – pacomet
    Commented May 23, 2011 at 12:21
  • 1
    $\begingroup$ Hi, I can't still find a solution. I have read some docs about DBSCAN and have some questions about. How to find minimum distance with R? As my data are three dimensional longitude, latitude and temperature, which "distance" should I use? whicn dimension is related to that distance? temperature? Is there a method to determine the minimum number of points for a cluster? Searching thorugh Google I could not find an R example for using dbscan in a dataset similar to mine, do you know any website with such kind of examples? So I can read and try to adapt to my case. Thanks again $\endgroup$
    – pacomet
    Commented May 31, 2011 at 9:42

A nicely documented python library for spatial analysis that has some clustering is pySAL.

Another python library in the development stage that is focused on spatial clustering is clusterPy (pdf slide presentation).

With a more limited choice of clustering algorithms but with nice mapping interface is the GUI software GeoGrouper.

  • $\begingroup$ Thanks, I have not ever worked with python. I will try to find an R solution $\endgroup$
    – pacomet
    Commented May 6, 2011 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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