src/main/java/de/blau/android/osm/StorageDelegator.java
/**
     * Remove node from specified way
     * 
     * If the node is untagged and not a member of any other way it will be deleted. If the way is closed and the end
     * node is being removed it will try to re-close.
     * 
     * @param way the Way
     * @param node the Node
     */
Remove node from specified way

If the node is untagged and not a member of any other way it will be deleted. If the way is closed and the end
node is being removed it will try to re-close.

@param way the Way
@param node the Node
Remove node from specified way If the node is untagged and not a member of any other way it will be deleted . If the way is closed and the end node is being removed it will try to re - close . @param way the Way @param node the Node
public void removeNodeFromWay(@NonNull Way way, @NonNull Node node) {
        boolean closed = way.isClosed();
        int size = way.getNodes().size();
        int occurences = way.count(node);
        int targetSize = size - occurences;
        if (targetSize < Way.MINIMUM_NODES_IN_WAY || (closed && targetSize < Way.MINIMUM_NODES_IN_CLOSED_WAY)) {
            throw new OsmIllegalOperationException("No Nodes can be removed from this Way. This is a bug.");
        }
        dirty = true;
        undo.save(way);
        if (closed && way.isEndNode(node)) {
            way.removeNode(node);
            way.addNode(way.getFirstNode());
        } else {
            way.removeNode(node);
        }
        way.updateState(OsmElement.STATE_MODIFIED);
        apiStorage.insertElementSafe(way);
        onElementChanged(null, way);
        if (!node.hasTags() && getCurrentStorage().getWays(node).isEmpty()) {
            removeNode(node);
        }
    }
public void removeNodeFromWay ( @ NonNull Way way , @ NonNull Node node ) { boolean closed = way . isClosed ( ) ; int size = way . getNodes ( ) . size ( ) ; int occurences = way . count ( node ) ; int targetSize = size - occurences ; if ( targetSize < Way . MINIMUM_NODES_IN_WAY || ( closed && targetSize < Way . MINIMUM_NODES_IN_CLOSED_WAY ) ) { throw new OsmIllegalOperationException ( "No Nodes can be removed from this Way. This is a bug." ) ; } dirty = true ; undo . save ( way ) ; if ( closed && way . isEndNode ( node ) ) { way . removeNode ( node ) ; way . addNode ( way . getFirstNode ( ) ) ; } else { way . removeNode ( node ) ; } way . updateState ( OsmElement . STATE_MODIFIED ) ; apiStorage . insertElementSafe ( way ) ; onElementChanged ( null , way ) ; if ( ! node . hasTags ( ) && getCurrentStorage ( ) . getWays ( node ) . isEmpty ( ) ) { removeNode ( node ) ; } }
Remove node from specified way
Remove node from specified way
// re-close