|
|
@@ -34,149 +34,154 @@
|
|
|
<item>
|
|
|
<xsl:attribute name="id" select="@ID_Way"/>
|
|
|
<xsl:variable name="ID_Way" select="@ID_Way"/>
|
|
|
- <asText>
|
|
|
- <xsl:variable name="bp:Joins">
|
|
|
- <xsl:for-each select="bp:Joins">
|
|
|
- <bp:Joins>
|
|
|
- <xsl:copy-of select="@*"/>
|
|
|
- <xsl:copy-of select="$joins_asText_xml/joins_asText_xml/item[@id= current()/@Joins]/bp:Path_Point/@X"/>
|
|
|
- <xsl:copy-of select="$joins_asText_xml/joins_asText_xml/item[@id= current()/@Joins]/bp:Path_Point/@Y"/>
|
|
|
- <xsl:attribute name="position" select="position()"/>
|
|
|
- <!--<xsl:copy-of select="$joins_asText_xml/joins_asText_xml/item[@id= current()/@id]/"/>-->
|
|
|
- </bp:Joins>
|
|
|
- </xsl:for-each>
|
|
|
- </xsl:variable>
|
|
|
- <!--<Joins>
|
|
|
- <xsl:copy-of select="$bp:Joins"/>
|
|
|
- </Joins>-->
|
|
|
- <xsl:variable name="Join_X1" select="$bp:Joins/bp:Joins[@position=1]/@X"/>
|
|
|
- <xsl:variable name="Join_Y1" select="$bp:Joins/bp:Joins[@position=1]/@Y"/>
|
|
|
- <xsl:variable name="Join_X2" select="$bp:Joins/bp:Joins[@position=2]/@X"/>
|
|
|
- <xsl:variable name="Join_Y2" select="$bp:Joins/bp:Joins[@position=2]/@Y"/>
|
|
|
- <!-- na podstawie joina ustalamy jego wspolrzedne -->
|
|
|
- <xsl:variable name="Ways">
|
|
|
- <Ways>
|
|
|
- <xsl:attribute name="Join_X1" select="$Join_X1"/>
|
|
|
- <xsl:attribute name="Join_Y1" select="$Join_Y1"/>
|
|
|
- <xsl:attribute name="Join_X2" select="$Join_X2"/>
|
|
|
- <xsl:attribute name="Join_Y2" select="$Join_Y2"/>
|
|
|
- <xsl:variable name="Ways">
|
|
|
- <xsl:for-each select="$ways_asText_z_ID_xml/ways_asText_z_ID_xml/item[@ID_Way=$ID_Way]">
|
|
|
- <Way>
|
|
|
- <xsl:attribute name="id" select="@id"/>
|
|
|
- <xsl:attribute name="len" select="@len"/>
|
|
|
- <xsl:variable name="bp:Path_Point">
|
|
|
- <xsl:for-each select="bp:Path_Point">
|
|
|
- <bp:Path_Point>
|
|
|
- <xsl:copy-of select="@*"/>
|
|
|
- <xsl:attribute name="position" select="position()"/>
|
|
|
- </bp:Path_Point>
|
|
|
- </xsl:for-each>
|
|
|
- </xsl:variable>
|
|
|
- <!-- <xsl:variable name="Way_X1" select="$bp:Path_Point/bp:Path_Point[@position=1]/@X"/>
|
|
|
- <xsl:variable name="Way_Y1" select="$bp:Path_Point/bp:Path_Point[@position=1]/@Y"/>
|
|
|
- <xsl:variable name="Way_X2" select="$bp:Path_Point/bp:Path_Point[@position=2]/@X"/>
|
|
|
- <xsl:variable name="Way_Y2" select="$bp:Path_Point/bp:Path_Point[@position=2]/@Y"/>-->
|
|
|
- <xsl:attribute name="Way_X1" select="$bp:Path_Point/bp:Path_Point[@position=1]/@X"/>
|
|
|
- <xsl:attribute name="Way_Y1" select="$bp:Path_Point/bp:Path_Point[@position=1]/@Y"/>
|
|
|
- <xsl:attribute name="Way_X2" select="$bp:Path_Point/bp:Path_Point[@position=2]/@X"/>
|
|
|
- <xsl:attribute name="Way_Y2" select="$bp:Path_Point/bp:Path_Point[@position=2]/@Y"/>
|
|
|
- </Way>
|
|
|
- </xsl:for-each>
|
|
|
- </xsl:variable>
|
|
|
- <xsl:copy-of select="$Ways"/>
|
|
|
- <!-- teraz trzeba wiedziec ktory punkt wziac z drogi - czy pierwszy czy drugi jaki pasuje do pary -->
|
|
|
- <xsl:variable name="Ways_J1_W1">
|
|
|
- <xsl:for-each select="$Ways/Way[@Way_X1=$Join_X1 and @Way_Y1=$Join_Y1]">
|
|
|
- <Way_next_cand>
|
|
|
- <xsl:copy-of select="@id"/>
|
|
|
- <xsl:copy-of select="@Way_X2"/>
|
|
|
- <xsl:copy-of select="@Way_Y2"/>
|
|
|
- </Way_next_cand>
|
|
|
- </xsl:for-each>
|
|
|
- </xsl:variable>
|
|
|
- <xsl:copy-of select="$Ways_J1_W1"/>
|
|
|
-
|
|
|
- <xsl:variable name="Ways_J2_W1">
|
|
|
- <xsl:for-each select="$Ways/Way[@Way_X1=$Join_X2 and @Way_Y1=$Join_Y2]">
|
|
|
- <Way_next_cand>
|
|
|
- <xsl:copy-of select="@id"/>
|
|
|
- <xsl:copy-of select="@Way_X2"/>
|
|
|
- <xsl:copy-of select="@Way_Y2"/>
|
|
|
- </Way_next_cand>
|
|
|
+ <!--<xsl:attribute name="Count" select="$asText/asText/@Count"/>-->
|
|
|
+ <asText>
|
|
|
+ <xsl:variable name="bp:Joins">
|
|
|
+ <xsl:for-each select="bp:Joins">
|
|
|
+ <bp:Joins>
|
|
|
+ <xsl:copy-of select="@*"/>
|
|
|
+ <xsl:copy-of select="$joins_asText_xml/joins_asText_xml/item[@id= current()/@Joins]/bp:Path_Point/@X"/>
|
|
|
+ <xsl:copy-of select="$joins_asText_xml/joins_asText_xml/item[@id= current()/@Joins]/bp:Path_Point/@Y"/>
|
|
|
+ <xsl:attribute name="position" select="position()"/>
|
|
|
+ <!--<xsl:copy-of select="$joins_asText_xml/joins_asText_xml/item[@id= current()/@id]/"/>-->
|
|
|
+ </bp:Joins>
|
|
|
</xsl:for-each>
|
|
|
</xsl:variable>
|
|
|
- <xsl:copy-of select="$Ways_J2_W1"/>
|
|
|
-
|
|
|
- <xsl:variable name="Ways_J1_W2">
|
|
|
- <xsl:for-each select="$Ways/Way[@Way_X2=$Join_X1 and @Way_Y2=$Join_Y1]">
|
|
|
- <Way_next_cand>
|
|
|
- <xsl:copy-of select="@id"/>
|
|
|
- <xsl:copy-of select="@Way_X1"/>
|
|
|
- <xsl:copy-of select="@Way_Y1"/>
|
|
|
- </Way_next_cand>
|
|
|
- </xsl:for-each>
|
|
|
+ <!--<Joins>
|
|
|
+ <xsl:copy-of select="$bp:Joins"/>
|
|
|
+ </Joins>-->
|
|
|
+ <xsl:variable name="Join_X1" select="$bp:Joins/bp:Joins[@position=1]/@X"/>
|
|
|
+ <xsl:variable name="Join_Y1" select="$bp:Joins/bp:Joins[@position=1]/@Y"/>
|
|
|
+ <xsl:variable name="Join_X2" select="$bp:Joins/bp:Joins[@position=2]/@X"/>
|
|
|
+ <xsl:variable name="Join_Y2" select="$bp:Joins/bp:Joins[@position=2]/@Y"/>
|
|
|
+ <!-- na podstawie joina ustalamy jego wspolrzedne -->
|
|
|
+ <xsl:variable name="Ways">
|
|
|
+ <Ways>
|
|
|
+ <xsl:attribute name="Join_X1" select="$Join_X1"/>
|
|
|
+ <xsl:attribute name="Join_Y1" select="$Join_Y1"/>
|
|
|
+ <xsl:attribute name="Join_X2" select="$Join_X2"/>
|
|
|
+ <xsl:attribute name="Join_Y2" select="$Join_Y2"/>
|
|
|
+ <xsl:variable name="Ways">
|
|
|
+ <xsl:for-each select="$ways_asText_z_ID_xml/ways_asText_z_ID_xml/item[@ID_Way=$ID_Way]">
|
|
|
+ <Way>
|
|
|
+ <xsl:attribute name="id" select="@id"/>
|
|
|
+ <xsl:attribute name="len" select="@len"/>
|
|
|
+ <xsl:variable name="bp:Path_Point">
|
|
|
+ <xsl:for-each select="bp:Path_Point">
|
|
|
+ <bp:Path_Point>
|
|
|
+ <xsl:copy-of select="@*"/>
|
|
|
+ <xsl:attribute name="position" select="position()"/>
|
|
|
+ </bp:Path_Point>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+ <!-- <xsl:variable name="Way_X1" select="$bp:Path_Point/bp:Path_Point[@position=1]/@X"/>
|
|
|
+ <xsl:variable name="Way_Y1" select="$bp:Path_Point/bp:Path_Point[@position=1]/@Y"/>
|
|
|
+ <xsl:variable name="Way_X2" select="$bp:Path_Point/bp:Path_Point[@position=2]/@X"/>
|
|
|
+ <xsl:variable name="Way_Y2" select="$bp:Path_Point/bp:Path_Point[@position=2]/@Y"/>-->
|
|
|
+ <xsl:attribute name="Way_X1" select="$bp:Path_Point/bp:Path_Point[@position=1]/@X"/>
|
|
|
+ <xsl:attribute name="Way_Y1" select="$bp:Path_Point/bp:Path_Point[@position=1]/@Y"/>
|
|
|
+ <xsl:attribute name="Way_X2" select="$bp:Path_Point/bp:Path_Point[@position=2]/@X"/>
|
|
|
+ <xsl:attribute name="Way_Y2" select="$bp:Path_Point/bp:Path_Point[@position=2]/@Y"/>
|
|
|
+ </Way>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:copy-of select="$Ways"/>
|
|
|
+ <!-- teraz trzeba wiedziec ktory punkt wziac z drogi - czy pierwszy czy drugi jaki pasuje do pary -->
|
|
|
+ <xsl:variable name="Ways_J1_W1">
|
|
|
+ <xsl:for-each select="$Ways/Way[@Way_X1=$Join_X1 and @Way_Y1=$Join_Y1]">
|
|
|
+ <Way_next_cand>
|
|
|
+ <xsl:copy-of select="@id"/>
|
|
|
+ <xsl:copy-of select="@Way_X2"/>
|
|
|
+ <xsl:copy-of select="@Way_Y2"/>
|
|
|
+ </Way_next_cand>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:copy-of select="$Ways_J1_W1"/>
|
|
|
+
|
|
|
+ <xsl:variable name="Ways_J2_W1">
|
|
|
+ <xsl:for-each select="$Ways/Way[@Way_X1=$Join_X2 and @Way_Y1=$Join_Y2]">
|
|
|
+ <Way_next_cand>
|
|
|
+ <xsl:copy-of select="@id"/>
|
|
|
+ <xsl:copy-of select="@Way_X2"/>
|
|
|
+ <xsl:copy-of select="@Way_Y2"/>
|
|
|
+ </Way_next_cand>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:copy-of select="$Ways_J2_W1"/>
|
|
|
+
|
|
|
+ <xsl:variable name="Ways_J1_W2">
|
|
|
+ <xsl:for-each select="$Ways/Way[@Way_X2=$Join_X1 and @Way_Y2=$Join_Y1]">
|
|
|
+ <Way_next_cand>
|
|
|
+ <xsl:copy-of select="@id"/>
|
|
|
+ <xsl:copy-of select="@Way_X1"/>
|
|
|
+ <xsl:copy-of select="@Way_Y1"/>
|
|
|
+ </Way_next_cand>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:copy-of select="$Ways_J1_W2"/>
|
|
|
+
|
|
|
+ <xsl:variable name="Ways_J2_W2">
|
|
|
+ <xsl:for-each select="$Ways/Way[@Way_X2=$Join_X2 and @Way_Y2=$Join_Y2]">
|
|
|
+ <Way_next_cand>
|
|
|
+ <xsl:copy-of select="@id"/>
|
|
|
+ <xsl:copy-of select="@Way_X1"/>
|
|
|
+ <xsl:copy-of select="@Way_Y1"/>
|
|
|
+ </Way_next_cand>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:copy-of select="$Ways_J2_W2"/>
|
|
|
+ <!-- poszukamy czy Way_X2 wystepuje -->
|
|
|
+ </Ways>
|
|
|
</xsl:variable>
|
|
|
- <xsl:copy-of select="$Ways_J1_W2"/>
|
|
|
-
|
|
|
- <xsl:variable name="Ways_J2_W2">
|
|
|
- <xsl:for-each select="$Ways/Way[@Way_X2=$Join_X2 and @Way_Y2=$Join_Y2]">
|
|
|
- <Way_next_cand>
|
|
|
- <xsl:copy-of select="@id"/>
|
|
|
- <xsl:copy-of select="@Way_X1"/>
|
|
|
- <xsl:copy-of select="@Way_Y1"/>
|
|
|
- </Way_next_cand>
|
|
|
- </xsl:for-each>
|
|
|
+ <!--<xsl:copy-of select="$Ways"/>-->
|
|
|
+ <!--<xsl:variable name="Way_1_or_2">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$Ways/Ways/Way_next_cand[1]/@Way_X2">
|
|
|
+ <xsl:value-of select="1"/>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise><xsl:value-of select="2"/></xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:variable>-->
|
|
|
+ <!--<Way_1_or_2><xsl:value-of select="$Way_1_or_2"/></Way_1_or_2>-->
|
|
|
+ <xsl:variable name="LineString">
|
|
|
+ <xsl:call-template name="PlaceWay">
|
|
|
+ <xsl:with-param name="Ways" select="$Ways"/>
|
|
|
+ <xsl:with-param name="Cur_X1" select="$Ways/Ways/@Join_X1"/>
|
|
|
+ <xsl:with-param name="Cur_Y1" select="$Ways/Ways/@Join_Y1"/>
|
|
|
+ <xsl:with-param name="Last_X2" select="$Ways/Ways/@Join_X2"/>
|
|
|
+ <xsl:with-param name="Last_Y2" select="$Ways/Ways/@Join_Y2"/>
|
|
|
+ <xsl:with-param name="ID_Way" select="$ID_Way"/>
|
|
|
+ <!--<xsl:with-param name="Way_1_or_2" select="$Way_1_or_2"/>-->
|
|
|
+ <!--<xsl:with-param name="not_id" select="$Ways/Ways/Way_next_cand/@id"/>-->
|
|
|
+ </xsl:call-template>
|
|
|
</xsl:variable>
|
|
|
- <xsl:copy-of select="$Ways_J2_W2"/>
|
|
|
- <!-- poszukamy czy Way_X2 wystepuje -->
|
|
|
- </Ways>
|
|
|
- </xsl:variable>
|
|
|
- <!--<xsl:copy-of select="$Ways"/>-->
|
|
|
- <!--<xsl:variable name="Way_1_or_2">
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$Ways/Ways/Way_next_cand[1]/@Way_X2">
|
|
|
- <xsl:value-of select="1"/>
|
|
|
- </xsl:when>
|
|
|
- <xsl:otherwise><xsl:value-of select="2"/></xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:variable>-->
|
|
|
- <!--<Way_1_or_2><xsl:value-of select="$Way_1_or_2"/></Way_1_or_2>-->
|
|
|
- <xsl:variable name="LineString">
|
|
|
- <xsl:call-template name="PlaceWay">
|
|
|
- <xsl:with-param name="Ways" select="$Ways"/>
|
|
|
- <xsl:with-param name="Cur_X1" select="$Ways/Ways/@Join_X1"/>
|
|
|
- <xsl:with-param name="Cur_Y1" select="$Ways/Ways/@Join_Y1"/>
|
|
|
- <xsl:with-param name="Last_X2" select="$Ways/Ways/@Join_X2"/>
|
|
|
- <xsl:with-param name="Last_Y2" select="$Ways/Ways/@Join_Y2"/>
|
|
|
- <xsl:with-param name="ID_Way" select="$ID_Way"/>
|
|
|
- <!--<xsl:with-param name="Way_1_or_2" select="$Way_1_or_2"/>-->
|
|
|
- <!--<xsl:with-param name="not_id" select="$Ways/Ways/Way_next_cand/@id"/>-->
|
|
|
- </xsl:call-template>
|
|
|
- </xsl:variable>
|
|
|
- <xsl:variable name="len" select="sum($LineString/LineString/@len)"/>
|
|
|
- <xsl:attribute name="len" select="$len"/>
|
|
|
- <xsl:attribute name="Points_cnt" select="count($LineString/LineString/Points)"/>
|
|
|
- <!-- dodatkowo w xmlu aby bylo prosciej do przetwarzania -->
|
|
|
- <!--<asText_XMl>
|
|
|
- <xsl:copy-of select="$LineString"/>
|
|
|
- </asText_XMl>-->
|
|
|
- <xsl:result-document href="edge_joins_filled_paths/edge_joins_filled_paths.{$ID_Way}.xml">
|
|
|
- <edge_joins_filled_paths_xml>
|
|
|
- <xsl:attribute name="id" select="$ID_Way"/>
|
|
|
- <xsl:attribute name="Points_cnt" select="count($LineString/LineString/Points)"/>
|
|
|
- <asText_XMl>
|
|
|
- <xsl:attribute name="len" select="$len"/>
|
|
|
+ <xsl:variable name="len" select="sum($LineString/LineString/@len)"/>
|
|
|
+ <xsl:attribute name="len" select="$len"/>
|
|
|
+ <xsl:attribute name="Points_cnt" select="count($LineString/LineString/Points)"/>
|
|
|
+ <xsl:attribute name="Count" select=" count($LineString/LineString)"/>
|
|
|
+ <!-- dodatkowo w xmlu aby bylo prosciej do przetwarzania -->
|
|
|
+ <!--<asText_XMl>
|
|
|
+ <xsl:copy-of select="$LineString"/>
|
|
|
+ </asText_XMl>-->
|
|
|
+ <xsl:result-document href="edge_joins_filled_paths/edge_joins_filled_paths.{$ID_Way}.xml">
|
|
|
+ <edge_joins_filled_paths_xml>
|
|
|
<xsl:attribute name="id" select="$ID_Way"/>
|
|
|
<xsl:attribute name="Points_cnt" select="count($LineString/LineString/Points)"/>
|
|
|
- <xsl:copy-of select="$LineString"/>
|
|
|
- </asText_XMl>
|
|
|
- </edge_joins_filled_paths_xml>
|
|
|
- </xsl:result-document>
|
|
|
- <xsl:call-template name="AsText">
|
|
|
- <xsl:with-param name="LineString" select="$LineString"/>
|
|
|
- </xsl:call-template>
|
|
|
- </asText>
|
|
|
+ <asText_XMl>
|
|
|
+ <xsl:attribute name="len" select="$len"/>
|
|
|
+ <xsl:attribute name="id" select="$ID_Way"/>
|
|
|
+ <xsl:attribute name="Points_cnt" select="count($LineString/LineString/Points)"/>
|
|
|
+ <xsl:copy-of select="$LineString"/>
|
|
|
+ </asText_XMl>
|
|
|
+ </edge_joins_filled_paths_xml>
|
|
|
+ </xsl:result-document>
|
|
|
+ <xsl:call-template name="AsText">
|
|
|
+ <xsl:with-param name="LineString" select="$LineString"/>
|
|
|
+ </xsl:call-template>
|
|
|
+ </asText>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</item>
|
|
|
</xsl:template>
|
|
|
|