From ac489bbbd562810150a317887e2ff839245171a3 Mon Sep 17 00:00:00 2001 From: happyman Date: Mon, 2 Oct 2023 09:37:16 +0800 Subject: [PATCH] #76 minor fix --- twmap_gen/api/made.php | 2 +- twmap_gen/lib/twmapdb.inc.php | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/twmap_gen/api/made.php b/twmap_gen/api/made.php index 66697f4..bb94dd4 100644 --- a/twmap_gen/api/made.php +++ b/twmap_gen/api/made.php @@ -68,7 +68,7 @@ function finish_task($param) { msglog("notify web $log_channel with $mid"); notify_web($log_channel,array("finished!$mid")); - printf("

$okmsg

"); + printf("

%s

",$okmsg[0]); } diff --git a/twmap_gen/lib/twmapdb.inc.php b/twmap_gen/lib/twmapdb.inc.php index bcab8ad..fafdf16 100644 --- a/twmap_gen/lib/twmapdb.inc.php +++ b/twmap_gen/lib/twmapdb.inc.php @@ -398,7 +398,7 @@ function map_migrate($root,$uid,$mid) { foreach($files as $f) { $cmd = "/bin/mv $f $dir"; exec($cmd); - error_log("migrate $mid:$cmd"); + //error_log("migrate $mid:$cmd"); } //$newfilename = sprintf("%s/%s",$dir, basename($row['filename'])); // 3. 更新資料庫 @@ -1262,6 +1262,7 @@ function get_distance2($wkt_str, $twDEM_path){ if ($elev_data[0] > $maxele) $maxele = $elev_data[0]; if ($elev_data[0] < $minele) $minele = $elev_data[0]; $sumele = $elev_data[0]; + $dist[0]=0; $dist2[0]=0; for($i=1;$i%d %s %d h=%.02f d=%.02f d1=%.02f \n",$i,$points[$i],$elev_data[$i],$elediff[$i],$dist[$i],$dist2[$i]); - //if ($i>0) { - $slope_y = $a*$sum+$b; - if ($elev_data[$i] > $slope_y) $cross = 1; - $charts[] =sprintf("[%.02f,%.02f,%.02f]",$sum,$elev_data[$i], $slope_y); - - //} + $slope_y = $a*$sum+$b; + if ($elev_data[$i] > $slope_y) + $cross = 1; + $charts[] =sprintf("[%.02f,%.02f,%.02f]",$sum,$elev_data[$i], $slope_y); } return array(true,array("step"=>20, "d"=>$sum, "d1"=>$sum2, "avgele" => $sumele / count($points), "ascent"=>$ascent, "descent"=>$descent, "outofrange" => $outofrange, "maxele"=> $maxele, "minele" => $minele, "chart"=>implode(",",$charts), "azimuth"=>$azi_result['azimuth'], "cross"=>$cross));