src/main/java/de/blau/android/osm/StorageDelegator.java
/**
     * Replace an existing way Node with a new one
     * 
     * @param existingNode the existing Node
     * @param newNode the new Node
     * @param way the Way to exchange the Node in
     */
Replace an existing way Node with a new one

@param existingNode the existing Node
@param newNode the new Node
@param way the Way to exchange the Node in
Replace an existing way Node with a new one @param existingNode the existing Node @param newNode the new Node @param way the Way to exchange the Node in
void replaceNodeInWay(@NonNull final Node existingNode, @NonNull final Node newNode, @NonNull final Way way) {
        dirty = true;
        undo.save(way);
        way.replaceNode(existingNode, newNode);
        way.updateState(OsmElement.STATE_MODIFIED);
        try {
            int size = way.nodeCount();
            if (size < Way.MINIMUM_NODES_IN_WAY || (way.isClosed() && size < Way.MINIMUM_NODES_IN_CLOSED_WAY)) {
                Log.w(DEBUG_TAG, "replaceNodeInWay removing degenerate way " + way.getOsmId());
                removeWay(way);
            } else {
                apiStorage.insertElementSafe(way);
                onElementChanged(null, way);
            }
        } catch (StorageException e) {
            Log.e(DEBUG_TAG, "replaceNodeInWay got " + e.getMessage());
        }
    }
void replaceNodeInWay ( @ NonNull final Node existingNode , @ NonNull final Node newNode , @ NonNull final Way way ) { dirty = true ; undo . save ( way ) ; way . replaceNode ( existingNode , newNode ) ; way . updateState ( OsmElement . STATE_MODIFIED ) ; try { int size = way . nodeCount ( ) ; if ( size < Way . MINIMUM_NODES_IN_WAY || ( way . isClosed ( ) && size < Way . MINIMUM_NODES_IN_CLOSED_WAY ) ) { Log . w ( DEBUG_TAG , "replaceNodeInWay removing degenerate way " + way . getOsmId ( ) ) ; removeWay ( way ) ; } else { apiStorage . insertElementSafe ( way ) ; onElementChanged ( null , way ) ; } } catch ( StorageException e ) { Log . e ( DEBUG_TAG , "replaceNodeInWay got " + e . getMessage ( ) ) ; } }
Replace an existing way Node with a new one
Replace an existing way Node with a new one
// TODO handle OOM