Skip to content

Commit

Permalink
Update addresses.sql
Browse files Browse the repository at this point in the history
Corrected 4be88de
  • Loading branch information
Davis-Klavins committed Apr 16, 2023
1 parent 4be88de commit e9eb953
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions addresses.sql
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,10 @@ UPDATE nodes_addr_add_5
SET tags = tags - 'old_addr:street'::TEXT
WHERE tags -> 'addr:street' = tags -> 'old_addr:street';

--Delete tags of nodes that have become a part of ways or relations by manual user edits.
UPDATE nodes_addr_add_5
SET tags = ''
----Tags of nodes that have become a part of ways or relations by manual user edits.
CREATE TEMPORARY TABLE nodes_altered AS
SELECT id
FROM nodes_addr_add_5
WHERE id IN (
SELECT node_id
FROM way_nodes
Expand Down Expand Up @@ -906,6 +907,14 @@ WHERE id IN (
FROM nodes_del
);

--Delete tags of nodes that have become a part of ways or relations by manual user edits.
UPDATE nodes
SET tags = ''
WHERE id IN (
SELECT id
FROM nodes_altered
);

--Insert missing addresses.
CREATE TEMPORARY TABLE nodes_addr_add_6 AS
SELECT - ROW_NUMBER() OVER() id
Expand Down

0 comments on commit e9eb953

Please sign in to comment.