Search code examples
javageolocationcluster-analysiselki

clustering geographic data in Java


My aim is to use a machine learning library so that I can cluster points (Lat/Long) and (x, y). I want to use an API that allows me to easily switch between different clustering algorithms.

I started using Java-ML http://java-ml.sourceforge.net/content/clustering-basics and I'm able to get the tutorials working but I dont see how I can create an instance that geographic points. Do I have to extend net.sf.javaml.core.AbstractInstance to get this to work? There are only two instance types that can be created 'SparseInstance' and 'DenseInstance'.

I then found Elki and someone who has used it to cluster geo data Running DBSCAN in ELKI but I dont want to use a gui I just want to run the algorithms from a java class.

Any advice/ references is much appreciated.


Solution

  • You could look at the unit tests in the ELKI source tree, e.g. at

    http://elki.dbs.ifi.lmu.de/browser/elki/elki/src/test/java/de/lmu/ifi/dbs/elki/distance/distancefunction/SpatialPrimitiveDistanceFunctionTest.java

    or

    http://elki.dbs.ifi.lmu.de/browser/elki/elki/src/test/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/TestOPTICSListResults.java

    I can't tell what exactly you need to accomplish. In any case, maybe you'll find some suitable code examples in other subdirectores of the "src/test" dirtree. These could serve as a starting point.

    Note that beyond tutorials I haven't used ELKI much either. Just saying that "Looking at the Unit Tests in Order to Understand Code" is a general strategy.