|
|
@@ -61,11 +61,6 @@ function check() {
|
|
|
|
|
|
init_sh_check();
|
|
|
|
|
|
-function pointsDistance($a, $b) {
|
|
|
- $line = new LineString(array($a, $b));
|
|
|
- return $line->length();
|
|
|
-}
|
|
|
-
|
|
|
$ways2joins = unserialize(file_get_contents('ways2joins.txt'));
|
|
|
$joins2ways = unserialize(file_get_contents('joins2ways.txt'));
|
|
|
$points2joins = unserialize(file_get_contents('points2joins.txt'));
|
|
|
@@ -125,9 +120,12 @@ function findWay($joinA, $joinB, $path = array()) {
|
|
|
#echo joins2lineString($res = findWay(100,110))->asText();
|
|
|
#echo joins2lineString($res = findWay(25690,20134))->asText();
|
|
|
$timeStart = microtime();
|
|
|
-echo joins2lineString($res = findWay(25690,23039))->asText();
|
|
|
+$path = joins2lineString(findWay(25690,23039));
|
|
|
$timeEnd = microtime();
|
|
|
|
|
|
+echo $path->asText()."\n";
|
|
|
+echo "Dlugosc: ".$path->greatCircleLength()."\n";
|
|
|
+
|
|
|
list($usecStart, $secStart) = explode(" ", $timeStart);
|
|
|
list($usecEnd, $secEnd) = explode(" ", $timeEnd);
|
|
|
$diff = $secEnd - $secStart + $usecEnd - $usecStart;
|