@Override
    public void addSortToSql(final SqlBuilder sql, final boolean sortDesc) {
        //also sort by favourite count, should resemble ratio close enough
        sql.addOrder(sql.getMainTableId() + ".favourite_cnt", !sortDesc);
    }
sorts caches by popularity ratio (favorites per find in %).
main/src/main/java/cgeo/geocaching/sorting/PopularityRatioComparator.java