CharlotteJackson / DC_Crash_Bot

10 stars 7 forks source link

Determine existing traffic calming features given an address #83

Closed banjtheman closed 3 years ago

banjtheman commented 3 years ago

What is the Task

What do we want to accomplish?

Why do we want to do this

Step 4 in the TSA is are there existing traffic calming features on the block?

How can I get started?

This dataset has good details https://docs.google.com/spreadsheets/d/18OQh78KhlL65JHM2DyQKVEdYUY8zXjHzTfYbdsd-Kes/edit#gid=2064723036

Sample of data is here https://github.com/CharlotteJackson/DC_Crash_Bot/blob/master/data/analysis_data_roadway_blocks.csv

Definition of Done

Given an address, return a list of all traffic calming features

banjtheman commented 3 years ago

For those interested will fill out the code in this file https://github.com/CharlotteJackson/DC_Crash_Bot/blob/ddtsa/ddtsa/data_collectors/traffic_calming.py

banjtheman commented 3 years ago

The blocks don't have a latitude, longitude matching, we will need to augment this data with it.

can look at this https://postgis.net/docs/ST_Centroid.html

banjtheman commented 3 years ago

Will want to pull in some other data like speed cameras https://opendata.dc.gov/datasets/speed-detector/explore?location=38.908650%2C-77.017700%2C12.86&showTable=true

And speed humps https://opendata.dc.gov/datasets/speed-humps/explore?location=38.906750%2C-77.009000%2C12.35

banjtheman commented 3 years ago

Here is the current output

Getting traffic calming features for 1400 Spring Rd NW
There are 0 bike lanes  
There are 0 raised buffers  
There are 2 parking lanes  
The speed limit is 20.0 MPH  
There are TODO speed cameras 
There are TODO speed humps 
banjtheman commented 3 years ago

Notes

eichler4dc commented 3 years ago

This is working for me in the database: select st_astext(st_centroid(geography)) from analysis_data.roadway_blocks limit 100 ;

ST_X() isn't working for me for some reason right now.

banjtheman commented 3 years ago

Was able to get speed_humps and speed camera data (thanks @Aisling-C) the db query also helped thanks @eichler4dc

Speed hump example output

There are 2 speed humps at 600 Farragut St. NW

Other Traffic Calming Measures:

Brightwood Park, Crestwood, Petworth - 7fd24fc74b00ee318e7c82c20c394250
There are 0.0 bike lanes
There are 0.0 raised buffers
There are 2.0 parking lanes
The speed limit is 25.0 MPH 
...

Speed camera example

There is a SPEED camera at 3900 BLK SOUTH DAKOTA AVE NE SE/B
There is a SPEED camera at 3900 BLK SOUTH DAKOTA AVE NE NW/B

Other Traffic Calming Measures:

Brookland, Brentwood, Langdon - d31b590922f3ff63067215c99a59f853
There are 0.0 bike lanes
There are 0.0 raised buffers
There are 0.0 parking lanes
The speed limit is 20.0 MPH 
...