Skip to content

Commit

Permalink
#57 update cleaning int node sql
Browse files Browse the repository at this point in the history
  • Loading branch information
chmnata committed Aug 3, 2022
1 parent 62a827a commit 21c34b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions congestion_network_creation/cleaning_int_node.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- update int_id <-> node_id layer with node geom

update congestion.network_int_px_21_1_updated
update congestion.network_int_px_21_1
set node_geom = geom
from congestion.network_nodes a
where network_int_px_21_1_updated.node_id = a.node_id
Expand All @@ -11,7 +11,7 @@ where network_int_px_21_1_updated.node_id = a.node_id
-- manually fixed them till no node_ids are being tagged
-- to more than 1 int_id/px
select node_id from
congestion.network_int_px_21_1_updated
congestion.network_int_px_21_1
group by node_id
having count(1) >1

Expand All @@ -21,17 +21,17 @@ having count(1) >1
-- manually fixed them, and deleted ones that were the start and end vid of
-- retired segments
select * from congestion.network_nodes
left join congestion.network_int_px_21_1_updated a using (node_id)
left join congestion.network_int_px_21_1 a using (node_id)
where a.node_id is null


-- Check if there are int_id with px
-- and those int_id have entries without px
-- returned 8, updated table manually
with temp as (
select distinct int_id, px from congestion.network_int_px_21_1_updated
select distinct int_id, px from congestion.network_int_px_21_1
where int_id is not null and px is not null )
select * from temp
inner join congestion.network_int_px_21_1_updated a using (int_id)
inner join congestion.network_int_px_21_1 a using (int_id)
where a.px is null

0 comments on commit 21c34b8

Please sign in to comment.