a.binder 9 anos atrás
pai
commit
a3a5a12fc0

+ 0 - 97
SE/dev/php-cli/biale_plamy-find_ways_old.php

@@ -1,97 +0,0 @@
-<?php
-$_SERVER['SERVER_NAME'] = 'biuro.biall-net.pl';
-require("../../se-lib/bootstrap.php");
-Lib::loadClass("Vendor_Geophp");
-
-
-
-function init_sh_check() {
-    //check if run from bash
-    if(isset($_SERVER["argv"])) {
-        if(@$_SERVER["argv"][1]=='--help') {
-            echo "
-                Options are:
-                php ".$_SERVER["argv"][0]." --check   - control if we have needed tables/data
-                
-                .EOF
-            ";
-        } else if(@$_SERVER["argv"][1]=='--check') { 
-            check();
-        } else echo " bad option, try:
-            php ".$_SERVER["argv"][0]." --help
-            
-            .EOF
-            ";
-    } else {
-        echo "<br> this script could be run from bash e.g. php biale_plamy.php --help <br>" ;
-        check();
-    }
-}
-
-
-
-function check() {
-	echo "<br>\n i run check()";
-    //todo to set arguments to rebuild tables etc:
-    $check_tbls=array('Rozdzielcza_test_bzyk_drogi','Rozdzielcza_test_bzyk_joins','Rozdzielcza_test_bzyk_przylacza_HIST',
-                    'Rozdzielcza_test_bzyk_przylacza','Rozdzielcza_test_bzyk_punkty_adresowe','Rozdzielcza_test_bzyk_ways');
-
-    //$tables =  DB::getPDO()->list_tables();
-    foreach($check_tbls as $tbl) {
-        $query = "select ID from ".$tbl." limit 1 ";
-        echo "<br>\nresult chk for tbl:".$tbl." ;";
-        
-        try{
-            $result = DB::getPDO()->fetchall($query);
-        } catch(Exception $exception) {
-            // return $exception;
-            echo "<br>\n jest blad z tbl:".$tbl." i get sample table structure with data from ../sql/".$tbl.".sql  - it should be manually replaced by correct/newer!";
-            $sql = file_get_contents('../sql/'.$tbl.'.sql');
-            
-            try{
-                $result = DB::getPDO()->fetchall($sql);
-            } catch(Exception $exception2) {
-                echo "<br>\n jest blad dump dla tbl:".$tbl;
-            }
-        } 
-        //	print_r($exception);
-        print_r($result);
-    }
-}
-
-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'));
-$joins_asText = unserialize(file_get_contents('joins_asText.txt'));
-$ways_asText = unserialize(file_get_contents('ways_asText.txt'));
-$points_asText = unserialize(file_get_contents('points_asText.txt'));
-
-
-
-function findWay($joinA, $joinB, $path = array()) {
-	global $ways2joins, $joins2ways, $points2joins, $ways_asText, $points_asText, $res;
-//echo implode('->',$path)."\n\n";
-	if ($joinA == $joinB) $res[] = $path;
-	else {
-		foreach ($joins2ways[$joinA] as $way_key) {
-			if (!in_array($way_key, $path)) {
-//				$joins = $ways2joins[$way_key];
-//				$back_join_subkey = array_search($join_key, $joins);
-//				$new_join_subkey = 1 - $back_join_subkey;
-//				$new_join = $joins[$new_join_subkey];
-				$new_join = $ways2joins[$way_key][1 - array_search($joinA,  $ways2joins[$way_key])];
-				findWay($new_join, $joinB, array_merge($path,array($way_key)));
-			}
-		}
-	}
-}
-
-findWay(100,110);
-print_r($res);

+ 36 - 0
SE/dev/php-cli/biale_plamy-schema.xsd

@@ -137,4 +137,40 @@ do przeanalizowania przez biale_plamy_joins2ways_do_paths.xsl</xs:documentation>
             <xs:element name="findWay" type="bp:findWay"/>
         </xs:sequence>
     </xs:group>
+    <xs:element name="DrogiCut">
+        <xs:annotation>
+            <xs:documentation>Z Bzyk_test_drogi_
+Pociete drogi DUze przez male drogi, dowiazujace do wiekszych</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="ID_Way"/>
+                <xs:element name="ID_Way_A">
+                    <xs:annotation>
+                        <xs:documentation>Numer drogi do ktorej jest powiazane zakonczenie drogi CUT</xs:documentation>
+                    </xs:annotation>
+                    <xs:complexType>
+                        <xs:sequence>
+                            <xs:element name="Path_to_P1">
+                                <xs:complexType>
+                                    <xs:attribute name="Lenght"/>
+                                </xs:complexType>
+                            </xs:element>
+                            <xs:element name="Path_to_P2"/>
+                        </xs:sequence>
+                        <xs:attribute name="ID_Way"/>
+                    </xs:complexType>
+                </xs:element>
+                <xs:element name="ID_Way_B">
+                    <xs:complexType>
+                        <xs:sequence>
+                            <xs:element name="Path_to_P1"/>
+                            <xs:element name="Path_to_P2"/>
+                        </xs:sequence>
+                    </xs:complexType>
+                </xs:element>
+            </xs:sequence>
+            <xs:attribute name="ID_Way"/>
+        </xs:complexType>
+    </xs:element>
 </xs:schema>

+ 20 - 1
SE/dev/php-cli/build__biale_plamy.xml

@@ -13,7 +13,8 @@
         <property name="joins2ways.xml" value="joins2ways.xml"/>
         <property name="points2ID_Way.xml" value="points2ID_Way.xml"/>
         <property name="ways_2ID_Way.xml" value="ways_2ID_Way.xml"/>
-    
+            <property name="ways2joins.xml" value="ways2joins.xml"/>
+             <property name="ways_asText.xml" value="ways_asText.xml"/>
             <property name="joins2ways_z_ID_Way.xsl" value="joins2ways_z_ID_Way.xsl"/>
              <property name="joins2ways_z_ID_Way.xml" value="joins2ways_z_ID_Way.xml"/>
             <property name="biale_plamy_joins2ways_do_paths.xsl" value="biale_plamy_joins2ways_do_paths.xsl"/>
@@ -40,6 +41,7 @@
     
     <target name="biale_plamy-generate_data" >
         
+         
         
         <antcall target="biale_plamy-generate_data_sql"/>
         
@@ -62,6 +64,23 @@
         
     </target>
     
+    <target name="clean">
+        <delete file="${ways2joins.xml}"/>
+        <delete file="${ways_asText.xml}"/>
+        <delete file="${joins_asText.xml}"/>
+        <delete file="${joins2ways_z_ID_Way.xml}"/>
+        <delete file="${edge_joins.xml}"/>
+        <delete file="${joins2ways.xml}"/>
+        <delete file="${points2ID_Way.xml}"/>
+        <delete file="${ways_2ID_Way.xml}"/>
+        <delete file="${joins2ways_z_ID_Way.xml}"/>
+        <delete file="${points_asText.xml}"/>
+        <delete file="${points2joins.xml}"/>
+        <delete file="${edge_joins.xml}"/>
+        <delete file="${edge_joins_filled_paths.xml}"/>
+        <delete file="${edge_paths_with_PE.xml}"/>
+        <delete file="${cables_from_joins_to_PE.xml}"/>
+    </target>
     
     
     <target name="biale_plamy_prepare_mysql_data">