src/main/java/de/blau/android/osm/StorageDelegator.java
/**
     * Delete a node
     * 
     * The operation will remove it from any ways and relations relations it is a member of, ways that contain just 1 or
     * less nodes after the deletion will be deleted too
     * 
     * @param node the node to remove
     */
Delete a node

The operation will remove it from any ways and relations relations it is a member of, ways that contain just 1 or
less nodes after the deletion will be deleted too

@param node the node to remove
Delete a node The operation will remove it from any ways and relations relations it is a member of ways that contain just 1 or less nodes after the deletion will be deleted too @param node the node to remove
public void removeNode(@NonNull final Node node) {
        dirty = true;
        if (node.state == OsmElement.STATE_DELETED) {
            Log.e(DEBUG_TAG, "removeNode: node already deleted " + node.getOsmId());
            return; 
        }
        undo.save(node);
        try {
            if (node.state == OsmElement.STATE_CREATED) {
                apiStorage.removeElement(node);
            } else {
                apiStorage.insertElementSafe(node);
            }
            removeWayNode(node);
            removeElementFromRelations(node);
            currentStorage.removeNode(node);
            node.updateState(OsmElement.STATE_DELETED);
            onElementChanged((List<OsmElement>) null, (List<OsmElement>) null);
        } catch (StorageException e) {
            Log.e(DEBUG_TAG, "removeNode got " + e.getMessage());
        }
    }
public void removeNode ( @ NonNull final Node node ) { dirty = true ; if ( node . state == OsmElement . STATE_DELETED ) { Log . e ( DEBUG_TAG , "removeNode: node already deleted " + node . getOsmId ( ) ) ; return ; } undo . save ( node ) ; try { if ( node . state == OsmElement . STATE_CREATED ) { apiStorage . removeElement ( node ) ; } else { apiStorage . insertElementSafe ( node ) ; } removeWayNode ( node ) ; removeElementFromRelations ( node ) ; currentStorage . removeNode ( node ) ; node . updateState ( OsmElement . STATE_DELETED ) ; onElementChanged ( ( List < OsmElement > ) null , ( List < OsmElement > ) null ) ; } catch ( StorageException e ) { Log . e ( DEBUG_TAG , "removeNode got " + e . getMessage ( ) ) ; } }
Delete a node
Delete a node
// undo - node saved here, affected ways saved in removeWayNodes // node was already deleted // TODO handle OOM