a.binder 9 лет назад
Родитель
Сommit
46b3c8d128
1 измененных файлов с 31 добавлено и 24 удалено
  1. 31 24
      SE/dev/php-cli/biale_plamy_class_findWay.php

+ 31 - 24
SE/dev/php-cli/biale_plamy_class_findWay.php

@@ -99,33 +99,40 @@ foreach($edge_joins_path as $ID_Way=>$Joins_arr) {
 		unset($res);unset($path);
 		
 		
-		{
+		
 	
 			$res = $test->findWay($pkt_A, $pkt_B);
 			$lineStringObj = $test->joins2lineString($res);
-			$path = $lineStringObj->asText();
-		
-		}
-		
-		//$res = findWay($pkt_A,$pkt_B);
-		//$path = joins2lineString($res)->asText();
-		//   joins2lineString(findWay(389,404));
-		settype($path, "string");
-		$edge_joins_filled_paths[$ID_Way]['asText'] = $path;
-			$distance = 0;
-				foreach ($res as $way_key) {
-					if(isset($ways_asText[$way_key]))
-					$distance += Vendor_Geophp::load($ways_asText[$way_key], 'wkt')->greatCircleLength();
-				}
-		$edge_joins_filled_paths[$ID_Way]['distance'] = $distance;
-		//joins2lineString(findWay($Joins_arr[1],$Joins_arr[2]));
-		//joins2lineString($res = findWay($joinAB['A'],$joinAB['B']))->asText();
-		$sql_insert_path="insert into Rozdzielcza_test_bzyk_paths (the_geom,ID_Way, A_RECORD_CREATE_DATE )
-		     values (ST_GeomFromText('".$edge_joins_filled_paths[$ID_Way]['asText']."'),'".$ID_Way."' , now()   )   ";
-		    echo "#216Query path ins:: ".$sql_insert_path." , distance:".$distance." ";
-		    if(strlen($edge_joins_filled_paths[$ID_Way]['asText'])>2)
-		      DB::getPDO()->query($sql_insert_path);
-		    else echo "#296 path nie wygenerowalo sie !! dla ".$ID_Way." i pkt ".$pkt_A." , ".$pkt_B." \n";
+			if($lineStringObj) {
+						$path = $lineStringObj->asText();
+					
+					
+					
+					//$res = findWay($pkt_A,$pkt_B);
+					//$path = joins2lineString($res)->asText();
+					//   joins2lineString(findWay(389,404));
+					settype($path, "string");
+					$edge_joins_filled_paths[$ID_Way]['asText'] = $path;
+						$distance = 0;
+							foreach ($res as $way_key) {
+								if(isset($ways_asText[$way_key]))
+								$distance += Vendor_Geophp::load($ways_asText[$way_key], 'wkt')->greatCircleLength();
+							}
+					$edge_joins_filled_paths[$ID_Way]['distance'] = $distance;
+					//joins2lineString(findWay($Joins_arr[1],$Joins_arr[2]));
+					//joins2lineString($res = findWay($joinAB['A'],$joinAB['B']))->asText();
+					$sql_insert_path="insert into Rozdzielcza_test_bzyk_paths (the_geom,ID_Way, A_RECORD_CREATE_DATE )
+					     values (ST_GeomFromText('".$edge_joins_filled_paths[$ID_Way]['asText']."'),'".$ID_Way."' , now()   )   ";
+					    echo "#216Query path ins:: ".$sql_insert_path." , distance:".$distance." ";
+					    if(strlen($edge_joins_filled_paths[$ID_Way]['asText'])>2)
+					      DB::getPDO()->query($sql_insert_path);
+					    else echo "#296 path nie wygenerowalo sie !! dla ".$ID_Way." i pkt ".$pkt_A." , ".$pkt_B." \n";
+
+			} else { 
+				echo "ERROR 131 dla pkt: ID_WAY:".$ID_Way;
+				print_r($Joins_arr)
+			}
+
 
 	} else echo "\n#220 droga nie ma koncow ID_Way::".$ID_Way;
 }