|
|
@@ -767,6 +767,20 @@ class Route_ViewTableAjax extends RouteBase {
|
|
|
$_points[] = ['point' => $line->b, 'type' => ['p']];
|
|
|
}
|
|
|
|
|
|
+ // Scalenie pobliskich kolizji występujących na różnych liniach
|
|
|
+ $starts = array_filter($_points, function($point) { return in_array('iistart', $point['type']); }, ARRAY_FILTER_USE_BOTH);
|
|
|
+ $stops = array_filter($_points, function($point) { return in_array('iistop', $point['type']); }, ARRAY_FILTER_USE_BOTH);
|
|
|
+ $points = array_filter($_points, function($point) { return in_array('p', $point['type']); }, ARRAY_FILTER_USE_BOTH);
|
|
|
+ foreach ($stops as $i => $stopPoint) {
|
|
|
+ if (isset($points[$i + 1]) && isset($starts[$i + 2])) {
|
|
|
+ if (Geometry::distance($stopPoint['point'], $points[$i + 1]['point']) + Geometry::distance($points[$i + 1]['point'], $starts[$i + 2]['point']) < 1) {
|
|
|
+ unset($_points[$i]);
|
|
|
+ unset($_points[$i + 2]);
|
|
|
+ $_points[$i + 1]['type'][] = 'ii';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// Połączenie kilku takich samych punktów w jeden punkt (np. punkt początku linii oraz punkt początku kolizji - gdy wypadają w tym samym miejscu)
|
|
|
$points = [];
|
|
|
$lastPoint = null;
|