CityofToronto / bdit_congestion

Determining most congested streets and days in Toronto
https://github.com/orgs/CityofToronto/teams/bigdatainnovationteam
GNU General Public License v3.0
0 stars 0 forks source link

Congestion Network 2.0: Conflate map version 22_2 #63

Closed chmnata closed 1 year ago

chmnata commented 2 years ago

Only 2 nodes changed in this new map version

-- Find out how many nodes changed in the new map version (22_2)

-- returned 2 rows
-- meaning only 2 node_id changed! 
select node_id from congestion.network_nodes
except 
select node_id from here.routing_nodes_22_2 

Need to update 174 segment_ids

-- Find out how many link_dir changed in the new map version (22_2)

-- returned 288 rows
-- 288 link_dir needs to be retired 
select link_dir from congestion.network_links_21_1
except 
select link_dir from here.routing_streets_22_2 

-- Find out how many segment_id needs to be updated

-- returned 174 rows
-- 174 segment_ids needs be to retired and route
with changed_links AS (
    select link_dir from congestion.network_links_21_1
    except 
    select link_dir from here.routing_streets_22_2)

select distinct segment_id from  congestion.network_links_21_1 
inner join changed_links using (link_dir)
chmnata commented 2 years ago

The above 2 nodes are actually not being used in the previous version (21_1) cause those are the gardiner expressway that we excluded before.

chmnata commented 2 years ago

Changed segments have been re-routed with 22_2 routing streets, a new network_22_2 has been created. There are no segments that needs to be retired as node_id and geometry remain unchanged. There are a couple segments that we need to add, 1) Gardiner Expressway 2) The Pond Road (probs can backfill)