src/main/java/de/blau/android/osm/StorageDelegator.java
/**
     * Change the value of the tag with key proportionally to the length of the way relative to originalLength
     * 
     * @param key the tag key
     * @param originalLength the original length of the way
     * @param way the way
     */
Change the value of the tag with key proportionally to the length of the way relative to originalLength

@param key the tag key
@param originalLength the original length of the way
@param way the way
Change the value of the tag with key proportionally to the length of the way relative to originalLength @param key the tag key @param originalLength the original length of the way @param way the way
private void distributeMetric(@NonNull String key, double originalLength, @NonNull Way way) {
        String value = way.getTagWithKey(key);
        if (value != null && !"".equals(value)) {
            try {
                int metric = Tags.KEY_DURATION.equals(key) ? Duration.parse(value) : Integer.parseInt(value);
                double newLength = way.length();
                int newMetric = (int) Math.round(metric * newLength / originalLength);
                Map<String, String> tags = new TreeMap<>(way.getTags());
                tags.put(key, Tags.KEY_DURATION.equals(key) ? Duration.toString(newMetric) : Integer.toString(newMetric));
                way.setTags(tags);
            } catch (NumberFormatException nfex) {
            }
        } else {
            Log.e(DEBUG_TAG, "Unable to retrieve value for " + key);
        }
    }
private void distributeMetric ( @ NonNull String key , double originalLength , @ NonNull Way way ) { String value = way . getTagWithKey ( key ) ; if ( value != null && ! "" . equals ( value ) ) { try { int metric = Tags . KEY_DURATION . equals ( key ) ? Duration . parse ( value ) : Integer . parseInt ( value ) ; double newLength = way . length ( ) ; int newMetric = ( int ) Math . round ( metric * newLength / originalLength ) ; Map < String , String > tags = new TreeMap < > ( way . getTags ( ) ) ; tags . put ( key , Tags . KEY_DURATION . equals ( key ) ? Duration . toString ( newMetric ) : Integer . toString ( newMetric ) ) ; way . setTags ( tags ) ; } catch ( NumberFormatException nfex ) { } } else { Log . e ( DEBUG_TAG , "Unable to retrieve value for " + key ) ; } }
Change the value of the tag with key proportionally to the length of the way relative to originalLength
Change the value of the tag with key proportionally to the length of the way relative to originalLength
// ignore issue has been set in any case