1702 |
way = way->next; |
way = way->next; |
1703 |
} |
} |
1704 |
|
|
1705 |
|
/* remove that nodes map representations */ |
1706 |
|
if(node->map_item_chain) |
1707 |
|
map_item_chain_destroy(&node->map_item_chain); |
1708 |
|
|
1709 |
if(!permanently) { |
if(!permanently) { |
1710 |
printf("mark node #" ITEM_ID_FORMAT " as deleted\n", OSM_ID(node)); |
printf("mark node #" ITEM_ID_FORMAT " as deleted\n", OSM_ID(node)); |
1711 |
OSM_FLAGS(node) |= OSM_FLAG_DELETED; |
OSM_FLAGS(node) |= OSM_FLAG_DELETED; |
2020 |
/* delete all nodes that aren't in other use now */ |
/* delete all nodes that aren't in other use now */ |
2021 |
node_chain_t **chain = &way->node_chain; |
node_chain_t **chain = &way->node_chain; |
2022 |
while(*chain) { |
while(*chain) { |
|
|
|
2023 |
(*chain)->node->ways--; |
(*chain)->node->ways--; |
2024 |
printf("checking node #" ITEM_ID_FORMAT " (still used by %d)\n", |
printf("checking node #" ITEM_ID_FORMAT " (still used by %d)\n", |
2025 |
OSM_ID((*chain)->node), (*chain)->node->ways); |
OSM_ID((*chain)->node), (*chain)->node->ways); |
2027 |
/* this node must only be part of this way */ |
/* this node must only be part of this way */ |
2028 |
if(!(*chain)->node->ways) { |
if(!(*chain)->node->ways) { |
2029 |
/* delete this node, but don't let this actually affect the */ |
/* delete this node, but don't let this actually affect the */ |
2030 |
/* associated ways as the only such way is the oen we are currently */ |
/* associated ways as the only such way is the one we are currently */ |
2031 |
/* deleting */ |
/* deleting */ |
2032 |
way_chain_t *way_chain = |
way_chain_t *way_chain = |
2033 |
osm_node_delete(osm, icon, (*chain)->node, FALSE, FALSE); |
osm_node_delete(osm, icon, (*chain)->node, FALSE, FALSE); |
2044 |
*chain = cur->next; |
*chain = cur->next; |
2045 |
g_free(cur); |
g_free(cur); |
2046 |
} |
} |
2047 |
|
|
2048 |
way->node_chain = NULL; |
way->node_chain = NULL; |
2049 |
|
|
2050 |
if(!permanently) { |
if(!permanently) { |