bdit_data-sources
                                
                                 bdit_data-sources copied to clipboard
                                
                                    bdit_data-sources copied to clipboard
                            
                            
                            
                        Re-draw Bluetooth Highway Segments
We're not entirely sure how these segments were drawn, but they didn't come from the centreline layer. Create a table like {analysis_id, centreline_id} for the DVP, Gardiner, and Lakeshore Bluetooth routes and then we'll merge those lines together and replace the geometries in bluetooth.segments
natalie.bt_highway_ref is the reference table with {analysis_id, geo_id, bt_direction, centreline_geom}
natalie.bt_highway_geom contains merged lines
So what is outstanding is to split the centrelines where there are detectors on the highways so that the merged bluetooth.segments will be from detector to detector.
detectors can be found at cnangini.detectors
I need some clarifications on which detector to use:
- 
DVP (analysis_id: 116812)  This bluetooth segment from This bluetooth segment frombluetooth.segmentsspans through detector 1, 2 ,and 3. Should I still cut that segment into two with detector 2? This one too and this one and this one 
- 
Gardiner (analysis_id: 378651) 

Confusing detector placement when comparing with bluetooth.segments. Should segment 1 end at detector B ?
- Gardiner (analysis_id : 1388022)
 There aren't any detectors near the start point/end point of this segment.
There aren't any detectors near the start point/end point of this segment.
| Analysis ID | Segment | Action | 
|---|---|---|
| 116812 | DVP - Don Mills to Wynford | Keep as single segment from detector at Don Mills to detector at Wynford | 
| 116828 | DVP - Lawrence to York Mills | Keep as single segment from detector at Lawrence to detector at York Mills | 
| 116804 | DVP - Bayview to Don Mills | Keep as single segment from detector at Bayview to detector at Don Mills | 
| 378651 | Gardiner - Grand to Roncesvalles | This looks fine - the reader in detectorsappears to have the wrong latitude/longitude. There is a reader at Gardiner / Roncesvalles. | 
| 1388022 | Gardiner - Roncesvalles to Dufferin | The start point actually has a detector but isn't reflected in the detectorstable. The end point likely needs to be moved to terminate at where the Dufferin detector is actually located. This may also affect the start point of the segment for `analysis_id = "analysis_id" | 
| 130557` | 
@KatiRG can you fix the latitude for the reader at Roncesvalles and Gardiner? I believe the latitude is erroneously negative.
@aharpalaniTO Roncesvalles and Gardiner latitude fixed
Found another weird bluetooth segments (analysis_id = analysis_id = 1391870) that was not getting matched with sharedstreets. Will fix with the self intersecting trick.

Found another weird bluetooth segments (analysis_id = analysis_id = 1391870) that was not getting matched with sharedstreets. Will fix with the self intersecting trick.
Apparently this was the one I fixed before, but I didn't made change the geom in natalie.bluetooth_fixthat2 :P.  The change has now been made, @aharpalaniTO can you update bluetooth.segment with natalie.bluetooth_fixthat2 (analysis_id =1391870) ?