|
|
@@ -142,7 +142,9 @@ function findWay($joinA, $joinB, $path = array()) {
|
|
|
foreach ($subPaths as $key => $subPath) {
|
|
|
$distance_cur = 0;
|
|
|
foreach ($subPath as $way_key) {
|
|
|
- $distance_cur += Vendor_Geophp::load($ways_asText[$way_key], 'wkt')->length();
|
|
|
+ $way = Vendor_Geophp::load($ways_asText[$way_key], 'wkt');
|
|
|
+ if ($way) $distance_cur += Vendor_Geophp::load($ways_asText[$way_key], 'wkt')->length();
|
|
|
+ else $distance_cur += 999;
|
|
|
}
|
|
|
if (!$shortestKey || ($shortestKey && $distance_cur < $distance)) {
|
|
|
$shortestKey = $key;
|