Skip to content

Commit

Permalink
Merge pull request #1031 from cityofaustin/11403-jc-new-subcomponents
Browse files Browse the repository at this point in the history
Adds new subcomponents and updates component <> subcomponent lookup
  • Loading branch information
johnclary authored Aug 3, 2023
2 parents f7dfe8b + 54f3b3a commit 3f77db7
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
DELETE FROM moped_subcomponents where subcomponent_name = 'Continuous flow intersection';
DELETE FROM moped_subcomponents where subcomponent_name = 'Curb extension';
DELETE FROM moped_subcomponents where subcomponent_name = 'Detection - Bicycle';
DELETE FROM moped_subcomponents where subcomponent_name = 'Vehicle lane reconfiguration';
DELETE FROM moped_subcomponents where subcomponent_name = 'Protected intersection - Full';
DELETE FROM moped_subcomponents where subcomponent_name = 'Protected intersection - Full - Shared use';
DELETE FROM moped_subcomponents where subcomponent_name = 'Protected intersection - partial';
DELETE FROM moped_subcomponents where subcomponent_name = 'Radius tightening';
DELETE FROM moped_subcomponents where subcomponent_name = 'Slip lane removal';
DELETE FROM moped_subcomponents where subcomponent_name = 'Smart right';
DELETE FROM moped_subcomponents where subcomponent_name = 'Intersection square-up';
DELETE FROM moped_subcomponents where subcomponent_name = 'Transit corner modification';
DELETE FROM moped_subcomponents where subcomponent_name = 'Bicycle accommodations at PHB';
DELETE FROM moped_subcomponents where subcomponent_name = 'Bicycle signal (standard signal + bicycle signal sign)';
DELETE FROM moped_subcomponents where subcomponent_name = 'Bicycle signal face (experiment)';
DELETE FROM moped_subcomponents where subcomponent_name = 'Bicycle signal face (interim approval)';
DELETE FROM moped_subcomponents where subcomponent_name = 'Detection - vehicle';
DELETE FROM moped_subcomponents where subcomponent_name = 'Leading bicycle interval';
DELETE FROM moped_subcomponents where subcomponent_name = 'Pedestrian signal head and pushbuttons';
DELETE FROM moped_subcomponents where subcomponent_name = 'Protected left turn phase';
DELETE FROM moped_subcomponents where subcomponent_name = 'Timing adjustment';
DELETE FROM moped_subcomponents where subcomponent_name = 'Bikeway direction - Two-way';
DELETE FROM moped_subcomponents where subcomponent_name = 'Station design - Curbside with Bike Lane Bypass';
DELETE FROM moped_subcomponents where subcomponent_name = 'Station design - Floating with Bike Lane';
DELETE FROM moped_subcomponents where subcomponent_name = 'Station design - Island with Bike Lane Behind';
DELETE FROM moped_subcomponents where subcomponent_name = 'Station design - Shared with Bike Lane in Front';
DELETE FROM moped_subcomponents where subcomponent_name = 'Station design - Step-out with Shared Landing';
DELETE FROM moped_subcomponents where subcomponent_name = 'Station design - With SUP Behind';
DELETE FROM moped_subcomponents where subcomponent_name = 'Station design - With SUP in Front';
DELETE FROM moped_subcomponents where subcomponent_name = 'Bus stop consolidation';
DELETE FROM moped_subcomponents where subcomponent_name = 'Bus stop maintenance';
DELETE FROM moped_subcomponents where subcomponent_name = 'Bus stop modification';

DELETE FROM moped_components where component_name = 'Transit' and component_subtype = 'Bus Stop - Enhanced';

UPDATE moped_subcomponents set subcomponent_name = 'Audible push button' where subcomponent_name = 'Accessible pedestrian signal (APS)';
UPDATE moped_components set component_subtype = 'Bus stop' where component_subtype = 'Bus Stop';
UPDATE moped_components set component_name = 'Bike lane' where component_name = 'Bike Lane';
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
INSERT INTO moped_subcomponents (subcomponent_name) values
('Continuous flow intersection'),
('Curb extension'),
('Detection - Bicycle'),
('Vehicle lane reconfiguration'),
('Protected intersection - Full'),
('Protected intersection - Full - Shared use'),
('Protected intersection - Partial'),
('Radius tightening'),
('Slip lane removal'),
('Smart right'),
('Intersection square-up'),
('Transit corner modification'),
('Bicycle accommodations at PHB'),
('Bicycle signal (standard signal + bicycle signal sign)'),
('Bicycle signal face (experiment)'),
('Bicycle signal face (interim approval)'),
('Detection - Vehicle'),
('Leading bicycle interval'),
('Pedestrian signal head and pushbuttons'),
('Protected left turn phase'),
('Bikeway direction - Two-way'),
('Station design - Curbside with bike lane bypass'),
('Station design - Floating with bike lane'),
('Station design - Island with bike lane behind'),
('Station design - Shared with bike lane in front'),
('Station design - Step-out with shared landing'),
('Station design - With SUP behind'),
('Station design - With SUP in front'),
('Bus stop consolidation'),
('Bus stop maintenance'),
('Bus stop modification'),
('Timing adjustment');

-- add enhanced bus stop component
INSERT INTO moped_components (component_name, component_subtype, line_representation, feature_layer_id)
values('Transit', 'Bus Stop - Enhanced', FALSE, 5);

-- fix misc component capitaliation issues
UPDATE moped_components set component_subtype = 'Bus Stop' where component_subtype = 'Bus stop';
UPDATE moped_components set component_name = 'Bike Lane' where component_name = 'Bike lane';

-- rename APS subcomponent
UPDATE moped_subcomponents set subcomponent_name = 'Accessible pedestrian signal (APS)' where subcomponent_name = 'Audible push button';
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
DELETE FROM moped_components_subcomponents where 1=1;

INSERT INTO moped_components_subcomponents (component_id, subcomponent_id) VALUES
(16, 1),
(16, 2),
(16, 3),
(17, 1),
(17, 2),
(17, 3),
(18, 1),
(18, 2),
(18, 3),
(7, 4),
(8, 4),
(9, 4),
(10, 4),
(11, 4),
(12, 4),
(6, 4),
(21, 4),
(22, 4);
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
DELETE FROM moped_components_subcomponents where 1=1;

WITH inserts_todo AS (SELECT
mc.component_id component_id,
ms.subcomponent_id subcomponent_id
FROM (VALUES
('Signal', 'PHB', 'Accessible pedestrian signal (APS)'),
('Signal', 'RRFB', 'Accessible pedestrian signal (APS)'),
('Signal', 'Traffic', 'Accessible pedestrian signal (APS)'),
('Signal', 'PHB', 'Bicycle accommodations at PHB'),
('Signal', 'Traffic', 'Bicycle signal (standard signal + bicycle signal sign)'),
('Signal', 'Traffic', 'Bicycle signal face (experiment)'),
('Signal', 'Traffic', 'Bicycle signal face (interim approval)'),
('Intersection', 'Improvement', 'Continuous flow intersection'),
('Intersection', 'Improvement', 'Curb extension'),
('Crossing Island', 'Bike', 'Curb extension'),
('Crossing Island', 'Bike/Ped', 'Curb extension'),
('Crossing Island', 'Ped', 'Curb extension'),
('Signal', 'PHB', 'Detection - Bicycle'),
('Signal', 'RRFB', 'Detection - Bicycle'),
('Signal', 'Traffic', 'Detection - Bicycle'),
('Signal', 'Traffic', 'Detection - Vehicle'),
('Intersection', 'Improvement', 'Intersection square-up'),
('Signal', 'Traffic', 'Leading bicycle interval'),
('Signal', 'Traffic', 'Leading pedestrian interval'),
('Signal', 'PHB', 'Pedestrian signal head and pushbuttons'),
('Intersection', 'Improvement', 'Protected intersection - Full'),
('Intersection', 'Improvement', 'Protected intersection - Full - Shared use'),
('Intersection', 'Improvement', 'Protected intersection - Partial'),
('Signal', 'Traffic', 'Protected left turn phase'),
('Intersection', 'Improvement', 'Radius tightening'),
('Intersection', 'Improvement', 'Slip lane removal'),
('Intersection', 'Improvement', 'Smart right'),
('Signal', 'PHB', 'Timing adjustment'),
('Signal', 'RRFB', 'Timing adjustment'),
('Signal', 'Traffic', 'Timing adjustment'),
('Intersection', 'Improvement', 'Transit corner modification'),
('Intersection', 'Improvement', 'Vehicle lane reconfiguration'),
('Transit', 'Bus Stop', 'Bus stop consolidation'),
('Transit', 'Bus Stop', 'Bus stop maintenance'),
('Transit', 'Bus Stop', 'Bus stop modification'),
('Transit', 'Bus Stop - Enhanced', 'Bikeway direction - Two-way'),
('Transit', 'Bus Stop - Enhanced', 'Station design - Curbside with bike lane bypass'),
('Transit', 'Bus Stop - Enhanced', 'Station design - Floating with bike lane'),
('Transit', 'Bus Stop - Enhanced', 'Station design - Island with bike lane behind'),
('Transit', 'Bus Stop - Enhanced', 'Station design - Shared with bike lane in front'),
('Transit', 'Bus Stop - Enhanced', 'Station design - Step-out with shared landing'),
('Transit', 'Bus Stop - Enhanced', 'Station design - With SUP behind'),
('Transit', 'Bus Stop - Enhanced', 'Station design - With SUP in front')
) AS data (component_name, component_subtype, subcomponent_name)
LEFT JOIN moped_components mc ON
mc.component_name = data.component_name AND
mc.component_subtype = data.component_subtype
LEFT JOIN moped_subcomponents ms ON
ms.subcomponent_name = data.subcomponent_name)
INSERT INTO moped_components_subcomponents (component_id, subcomponent_id)
select * from inserts_todo;

0 comments on commit 3f77db7

Please sign in to comment.