@Override
    public void addSortToSql(final SqlBuilder sql, final boolean sortDesc) {
        sql.addOrder(DataStore.getSqlDistanceSquare(sql.getMainTableId(), coords), sortDesc);
    }
sorts caches by distance to given position
main/src/main/java/cgeo/geocaching/sorting/AbstractDistanceComparator.java