a.binder 9 anni fa
parent
commit
c40eee7861

+ 7 - 3
SE/dev/php-cli/cables_from_joins_to_PE.xsl

@@ -35,13 +35,15 @@
                lub probujemy rysowac zawsze od konca drogi-->
             
             
-        <xsl:for-each select="item">
+          <xsl:for-each select="item">
             <xsl:variable name="ID_Way" select="@ID_Way"/>
             <xsl:variable name="Joins" select="@id"/>
+            <xsl:variable name="ID_Point" select="@ID_Point"/>
             <xsl:choose> 
                 <!-- trzeba sprawdzic czy join jest klientem - czy tylko PE! -->
-                <xsl:when test="not($points2joins/points2joins/item/text()=$Joins)">
-                    <not_candidate><xsl:attribute name="descr" select="'this is probably join from way'"/></not_candidate>
+                <xsl:when test="not(@ID_Point)">
+                    <not_candidate><xsl:attribute name="descr" select="'this is probably join from way'"/>
+                        <xsl:attribute name="Joins" select="@ID_Point"/></not_candidate>
                 </xsl:when>
                 <xsl:when test="$PE_candidates_dump/PE_candidates_dump/LINESTRING[@ID_Way=current()/@ID_Way]">
                     <cable_to_PE_to_be_calculated>
@@ -67,6 +69,7 @@
                                             <xsl:with-param name="ID_Way" select="$ID_Way"/>
                                             <xsl:with-param name="Pos_found" select="position()"/>
                                             <xsl:with-param name="edge_joins_filled_paths" select="$edge_joins_filled_paths"/>
+                                            <xsl:with-param name="ID_Point" select="$ID_Point"/>
                                         </xsl:call-template>
                                     </found_in_path_in_edge_joins_filled_path>
                                 </xsl:when>
@@ -93,6 +96,7 @@
            <xsl:param name="Pos_found" required="yes"/>
            <xsl:param name="ID_Way" required="yes"/>
            <xsl:param name="edge_joins_filled_paths" required="yes"/>
+           <xsl:param name="ID_Point" required="yes"/>
            <!--<w_gore><xsl:attribute name="Pos_found" select="$Pos_found"/>
                <xsl:for-each select="$edge_joins_filled_paths/edge_joins_filled_paths/item[@id=$ID_Way]/bp:Path_Point">
                     

+ 10 - 6
SE/dev/php-cli/edge_joins_filled_paths.xsl

@@ -8,7 +8,7 @@
     <xsl:output indent="yes"/>
     <xsl:strip-space elements="*"/>
     
-    <xsl:variable name="test"/>
+    <xsl:variable name="joins2ways_z_ID_Way" select="doc('joins2ways_z_ID_Way.xml')"/>
     
     <!--//match edge_joins_filled_paths-->
     
@@ -53,7 +53,11 @@
     <xsl:template name="dumb_frequency">
         <xsl:param name="Count"/>
         <xsl:param name="distance"/>
+        <xsl:param name="ID_Point_count"/>
         <xsl:choose>
+            <xsl:when test="$ID_Point_count=0">
+                <xsl:value-of select="0"/>
+            </xsl:when>
             <!--<xsl:when test="$Count&lt;2">
                 <xsl:value-of select="2"/>
             </xsl:when>
@@ -76,34 +80,33 @@
                 <xsl:value-of select="20"/>
             </xsl:otherwise>
         </xsl:choose>        
-        
-        
     </xsl:template>
     
     <xsl:template name="PE_candidates_dump">
         <xsl:param name="edge_paths_with_PE" required="yes"/>
         <xsl:param name="dumb_frequency" select="20"/>
+        <xsl:param name="clients_xpoint_count"/> <!--Ile jest na trasie punktow klienckich  -->
         <!--<PE_candidates_dump>-->
             <xsl:attribute name="desc" select="'brakuje ominiecia punktow ways tylko do przylaczy i analizy dlugosci'"/>
             <xsl:for-each select="$edge_paths_with_PE/LINESTRING">
                 <LINESTRING>
                 <xsl:variable name="Count" select="@Count"/>
+                <xsl:variable name="ID_Point_count" select="@ID_Point_count"/>
                 <xsl:variable name="ID_Way" select="@ID_Way"/>
                 <xsl:variable name="distance" select="@distance"/>
                 <xsl:variable name="dumb_frequency">
                     <xsl:call-template name="dumb_frequency">
                         <xsl:with-param name="Count" select="$Count"/>
+                        <xsl:with-param name="ID_Point_count" select="$ID_Point_count"/>
                         <xsl:with-param name="distance" select="$distance"/>
                     </xsl:call-template>
                 </xsl:variable>
                 <xsl:attribute name="ID_Way" select="$ID_Way"/>
                 <xsl:copy-of select="@*"/>
-                 
                  <xsl:attribute name="dumb_frequency" select="$dumb_frequency"/>
-                    
                     <xsl:for-each select="bp:Path_Point">
                         <xsl:choose>
-                            <xsl:when test="@Pos mod $dumb_frequency = 0">
+                            <xsl:when test="(@Pos mod $dumb_frequency = 0 ) and $dumb_frequency &gt;0">
                                 <xsl:copy-of select="."/>
                             </xsl:when>
                         </xsl:choose>
@@ -119,6 +122,7 @@
             <xsl:when test="asText">
                 <LINESTRING>
                     <xsl:attribute name="ID_Way" select="@id"/>
+                    <xsl:attribute name="ID_Point_count" select="count($joins2ways_z_ID_Way/joins2ways_z_ID_Way/item[@ID_Way=current()/@id and @ID_Point])"/>
                     <xsl:attribute name="distance" select="distance/text()"/>
                       <xsl:apply-templates/>
                 </LINESTRING>

+ 5 - 3
SE/dev/php-cli/joins2ways_z_ID_Way.xsl

@@ -8,12 +8,12 @@
     <xsl:strip-space elements="*"/>
     <xsl:param name="ways_2ID_Way.xml"  select="'ways_2ID_Way.xml'"/>
     <xsl:variable name="ways_2ID_Way" select="doc($ways_2ID_Way.xml)"/>
+    <xsl:variable name="points2joins" select="doc('points2joins.xml')"/>
     
     <xsl:template match="joins2ways">
         <joins2ways_z_ID_Way>
             <xsl:variable name="joins2ways">
-                <xsl:apply-templates>
-                </xsl:apply-templates>
+                <xsl:apply-templates/>
             </xsl:variable>
             <xsl:for-each select="$joins2ways/item">
                 <xsl:sort select="number(@ID_Way)"/>
@@ -27,7 +27,9 @@
             <xsl:if test="$ways_2ID_Way/ways_2ID_Way/item[@id=current()/item[1]/text()]/text()">
                 <xsl:attribute name="ID_Way" select="$ways_2ID_Way/ways_2ID_Way/item[@id=current()/item[1]/text()]/text()"/>
             </xsl:if>
-            
+            <xsl:if test="$points2joins/points2joins/item[text()= current()/@id]">
+                <xsl:attribute name="ID_Point" select="$points2joins/points2joins/item[text()= current()/@id]/text()"/>
+            </xsl:if>
             <xsl:for-each select="item">
                 <xsl:element name="item">
                     <xsl:attribute name="id" select="@id"/>