src/main/java/de/blau/android/osm/StorageDelegator.java
/**
     * Reverse any direction dependent tags on the way nodes
     * 
     * @param nodes List of nodes
     * @return a List of results from the operation, if empty nothing had to be done
     */
Reverse any direction dependent tags on the way nodes

@param nodes List of nodes
@return a List of results from the operation, if empty nothing had to be done
Reverse any direction dependent tags on the way nodes @param nodes List of nodes @return a List of results from the operation if empty nothing had to be done
@NonNull
    List<Result> reverseWayNodeTags(List<Node> nodes) {
        List<Result> result = new ArrayList<>();
        for (Node n : nodes) {
            Map<String, String> nodeDirTags = Reverse.getDirectionDependentTags(n);
            if (nodeDirTags != null) {
                undo.save(n);
                Result nodeResult = new Result();
                nodeResult.setElement(n);
                nodeResult.addIssue(ReverseIssue.TAGSREVERSED);
                nodeResult.addTags(nodeDirTags);
                if (getCurrentStorage().getWays(n).size() > 1) {
                    nodeResult.addIssue(ReverseIssue.SHAREDNODE);
                }
                result.add(nodeResult);
                Reverse.reverseDirectionDependentTags(n, nodeDirTags, true);
                n.updateState(OsmElement.STATE_MODIFIED);
                try {
                    apiStorage.insertElementSafe(n);
                } catch (StorageException e) {
                    Log.e(DEBUG_TAG, "reverseWayNodeTags got " + e.getMessage());
                }
            }
        }
        return result;
    }
@ NonNull List < Result > reverseWayNodeTags ( List < Node > nodes ) { List < Result > result = new ArrayList < > ( ) ; for ( Node n : nodes ) { Map < String , String > nodeDirTags = Reverse . getDirectionDependentTags ( n ) ; if ( nodeDirTags != null ) { undo . save ( n ) ; Result nodeResult = new Result ( ) ; nodeResult . setElement ( n ) ; nodeResult . addIssue ( ReverseIssue . TAGSREVERSED ) ; nodeResult . addTags ( nodeDirTags ) ; if ( getCurrentStorage ( ) . getWays ( n ) . size ( ) > 1 ) { nodeResult . addIssue ( ReverseIssue . SHAREDNODE ) ; } result . add ( nodeResult ) ; Reverse . reverseDirectionDependentTags ( n , nodeDirTags , true ) ; n . updateState ( OsmElement . STATE_MODIFIED ) ; try { apiStorage . insertElementSafe ( n ) ; } catch ( StorageException e ) { Log . e ( DEBUG_TAG , "reverseWayNodeTags got " + e . getMessage ( ) ) ; } } } return result ; }
Reverse any direction dependent tags on the way nodes
Reverse any direction dependent tags on the way nodes
// TODO handle OOM