@Override
    public void addToSql(final SqlBuilder sqlBuilder) {
        final Geopoint gp = (useCurrentPosition || coordinate == null) ?
                LocationDataProvider.getInstance().currentGeo().getCoords() : coordinate;
        final String sql = DataStore.getSqlDistanceSquare(
                sqlBuilder.getMainTableId() + ".latitude", sqlBuilder.getMainTableId() + ".longitude", gp);

        addRangeToSqlBuilder(sqlBuilder, sql, v -> v * v);
    }
Returns the coordinate which will effectively be used for calculation (either fixed-value or current position)
main/src/main/java/cgeo/geocaching/filters/core/DistanceGeocacheFilter.java