Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1065 miovision stop aggregating bikes in crosswalk #1068

Merged
merged 5 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
intersections integer [] DEFAULT ARRAY[]::integer []
)
RETURNS void
LANGUAGE 'plpgsql'

Check failure on line 7 in volumes/miovision/sql/function/function-aggregate_volumes_daily.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

RF06: Unnecessary quoted identifier 'plpgsql'.

COST 100
VOLATILE
Expand Down Expand Up @@ -84,6 +84,13 @@
v.datetime_bin >= start_date
AND v.datetime_bin < end_date
AND v.intersection_uid = ANY(target_intersections)
--exclude bike exits
AND NOT (
classification_uid = 10
AND movement_uid = 8
)
--exclude bikes in crosswalk
AND NOT (classification_uid = 7)
GROUP BY
v.intersection_uid,
v.classification_uid,
Expand Down
4 changes: 2 additions & 2 deletions volumes/miovision/sql/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ Note that bicycles are available at both a turning movement level and at an appr
| 4 | SingleUnitTruck | false | "Vehicles" | A truck that has a non-detachable cab and trailer system |
| 5 | ArticulatedTruck | false | "Vehicles" | A truck that has a detachable cab and trailer system |
| 6 | Pedestrian | true | "Pedestrians" | A walker. May or may not include zombies... |
| 7 | Bicycle | true | "Cyclists" | Bicycle in crosswalk. Same movement_uids as 6, Pedestrian. Unclear if it is necessarily being walked or ridden. do not use aggregate volumes will be removed from tables |
| 7 | Bicycle | true | "Cyclists" | Bicycle in crosswalk. Same movement_uids as 6, Pedestrian. Unclear if it is necessarily being walked or ridden. This movement is exlcuded from aggregate tables. |
| 8 | WorkVan | | | A van used for commercial purposes Workvan classification was folded in to "Light" vehicles in the API. |
| 9 | MotorizedVehicle | false | "Vehicles" | Miscellaneous vehicles. Prior to 2019-08-22 this included streetcars. |
| 10 | Bicycle | false | "Cyclists" | Tracks bicycle entrances and exits. There are currently no exits in the aggregated tables. This classification is only available from 2021-07-11 on. Bicycle data is not great - stay tuned. |
| 10 | Bicycle | false | "Cyclists" | The preferred bike classification. Tracks bicycle entrances and exits passing through manually drawn zones on the SmartSense overlay. Exits are exlcuded from aggregate tables. This classification is only available from 2021-07-11 on. Bicycle data is not great - stay tuned. |

### `movements`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ CREATE OR REPLACE TRIGGER intersection_movements_denylist_exclusion
BEFORE INSERT ON miovision_api.intersection_movements
FOR EACH ROW
EXECUTE FUNCTION miovision_api.intersection_movements_exclude();

ALTER TABLE IF EXISTS miovision_api.intersection_movements
ADD CONSTRAINT intersecton_movements_exclude_bike_exits
CHECK (NOT (classification_uid = 10 AND movement_uid = 8));

ALTER TABLE IF EXISTS miovision_api.intersection_movements
ADD CONSTRAINT intersecton_movements_exclude_xwalk_bikes
CHECK (NOT (classification_uid = 7));
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ CREATE OR REPLACE VIEW miovision_api.monitor_intersection_movements AS (
v.volume_15min_mvt_uid IS NULL --not aggregated
AND v.datetime_bin >= CURRENT_DATE - 100
AND NOT (v.classification_uid = 10 AND movement_uid = 8) --bike exit
AND NOT (v.classification_uid = 7) --bikes in crosswalk
AND im_dl.intersection_uid IS NULL
GROUP BY
v.intersection_uid,
Expand Down
Loading