|
|
@@ -11,6 +11,13 @@
|
|
|
<xsl:param name="joins_asText_xml.xml" select="'joins_asText_xml.xml'"/>
|
|
|
<xsl:variable name="joins_asText_xml" select="doc($joins_asText_xml.xml)"/>
|
|
|
|
|
|
+
|
|
|
+ <xsl:param name="ways2joins.xml" select="'ways2joins.xml'"/>
|
|
|
+ <xsl:variable name="ways2joins" select="doc($ways2joins.xml)"/>
|
|
|
+
|
|
|
+ <xsl:param name="joins2ways_z_ID_Way.xml" select="'joins2ways_z_ID_Way.xml'"/>
|
|
|
+ <xsl:variable name="joins2ways_z_ID_Way" select="doc($joins2ways_z_ID_Way.xml)"/>
|
|
|
+
|
|
|
|
|
|
<xsl:output indent="yes"/>
|
|
|
<xsl:strip-space elements="*"/>
|
|
|
@@ -47,9 +54,8 @@
|
|
|
<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>
|
|
|
+ <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"/>
|
|
|
@@ -58,6 +64,7 @@
|
|
|
<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>
|
|
|
@@ -78,7 +85,6 @@
|
|
|
</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]">
|
|
|
@@ -143,32 +149,38 @@
|
|
|
<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:call-template name="AsText_XML">
|
|
|
- <xsl:with-param name="LineString" select="$LineString"/>
|
|
|
- </xsl:call-template>
|
|
|
+ <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: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>
|
|
|
|
|
|
|
|
|
-
|
|
|
- <xsl:template name="AsText_XML">
|
|
|
- <xsl:param name="LineString" required="yes"/>
|
|
|
- <xsl:value-of select="'LINESTRING ('"/>
|
|
|
- <xsl:for-each select="$LineString/LineString">
|
|
|
- <xsl:value-of select="concat(@X,' ',@Y)"/>
|
|
|
- <xsl:if test="not(position()= last())">
|
|
|
- <xsl:value-of select="', '"/>
|
|
|
- </xsl:if>
|
|
|
- </xsl:for-each>
|
|
|
- <xsl:value-of select="')'"/>
|
|
|
- </xsl:template>
|
|
|
-
|
|
|
-
|
|
|
<xsl:template name="PlaceWay">
|
|
|
<xsl:param name="Ways" required="yes"/>
|
|
|
<xsl:param name="Cur_X1" required="yes"/>
|
|
|
@@ -178,6 +190,7 @@
|
|
|
<xsl:param name="Last_Y2" required="yes"/>
|
|
|
<xsl:param name="loop" select="1"/>
|
|
|
<xsl:param name="not_id" required="no"/>
|
|
|
+ <xsl:param name="ID_Way" required="yes"/>
|
|
|
<!--<LineString>
|
|
|
<xsl:attribute name="X1" select="$Cur_X1"/>
|
|
|
<xsl:attribute name="Y1" select="$Cur_Y1"/>
|
|
|
@@ -191,20 +204,58 @@
|
|
|
<xsl:attribute name="not_id" select="$not_id"/>
|
|
|
</debug>-->
|
|
|
<xsl:variable name="Linestring">
|
|
|
- <xsl:for-each select="$Ways/Ways/Way[@Way_X1=$Cur_X1 and @Way_Y1=$Cur_Y1 and ( not($not_id) or not(@id=$not_id)) ]">
|
|
|
- <LineString>
|
|
|
- <xsl:attribute name="X" select="@Way_X2"/>
|
|
|
- <xsl:attribute name="Y" select="@Way_Y2"/>
|
|
|
- <xsl:attribute name="not_id" select="@id"/>
|
|
|
- </LineString>
|
|
|
- </xsl:for-each>
|
|
|
+ <xsl:for-each select="$Ways/Ways/Way[@Way_X1=$Cur_X1 and @Way_Y1=$Cur_Y1 and ( not($not_id) or not(@id=$not_id)) ]">
|
|
|
+ <LineString>
|
|
|
+ <xsl:attribute name="X" select="@Way_X2"/>
|
|
|
+ <xsl:attribute name="Y" select="@Way_Y2"/>
|
|
|
+ <xsl:attribute name="not_id" select="@id"/>
|
|
|
+ <xsl:attribute name="len" select="@len"/>
|
|
|
+ <xsl:variable name="X" select="@Way_X2"/>
|
|
|
+ <xsl:variable name="Y" select="@Way_Y2"/>
|
|
|
+ <xsl:for-each select="$ways2joins/ways2joins/item[@id= current()/@id]/item">
|
|
|
+ <xsl:for-each select="$joins_asText_xml/joins_asText_xml/item[@id= current()/text()]/bp:Path_Point">
|
|
|
+ <xsl:if test="@X=$X and @Y=$Y">
|
|
|
+ <xsl:variable name="ID_Join" select="parent::node()/@id"/>
|
|
|
+ <!-- punkty podpiete -->
|
|
|
+ <xsl:copy-of select="$joins2ways_z_ID_Way/joins2ways_z_ID_Way/item[@id=$ID_Join]/Points"/>
|
|
|
+ <!-- wyszukanie drog wychodzacych innych niz nasza z punktu -->
|
|
|
+ <xsl:for-each select="$joins2ways_z_ID_Way/joins2ways_z_ID_Way/item[@id=$ID_Join]/item[not(@ID_WAY=$ID_Way)]">
|
|
|
+ <Ways>
|
|
|
+ <xsl:attribute name="ID_WAY" select="@ID_WAY"/>
|
|
|
+ <xsl:attribute name="ways_id" select="text()"/>
|
|
|
+ </Ways>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:for-each>
|
|
|
+ </LineString>
|
|
|
+ </xsl:for-each>
|
|
|
<xsl:for-each select="$Ways/Ways/Way[@Way_X2=$Cur_X1 and @Way_Y2=$Cur_Y1 and ( not($not_id) or not(@id=$not_id)) ]">
|
|
|
- <LineString>
|
|
|
- <xsl:attribute name="X" select="@Way_X1"/>
|
|
|
- <xsl:attribute name="Y" select="@Way_Y1"/>
|
|
|
- <xsl:attribute name="not_id" select="@id"/>
|
|
|
- </LineString>
|
|
|
- </xsl:for-each>
|
|
|
+ <LineString>
|
|
|
+ <xsl:attribute name="X" select="@Way_X1"/>
|
|
|
+ <xsl:attribute name="Y" select="@Way_Y1"/>
|
|
|
+ <xsl:attribute name="not_id" select="@id"/>
|
|
|
+ <xsl:attribute name="len" select="@len"/>
|
|
|
+ <xsl:variable name="X" select="@Way_X1"/>
|
|
|
+ <xsl:variable name="Y" select="@Way_Y1"/>
|
|
|
+ <xsl:for-each select="$ways2joins/ways2joins/item[@id= current()/@id]/item">
|
|
|
+ <xsl:for-each select="$joins_asText_xml/joins_asText_xml/item[@id= current()/text()]/bp:Path_Point">
|
|
|
+ <xsl:if test="@X=$X and @Y=$Y">
|
|
|
+ <xsl:variable name="ID_Join" select="parent::node()/@id"/>
|
|
|
+ <!-- punkty podpiete -->
|
|
|
+ <xsl:copy-of select="$joins2ways_z_ID_Way/joins2ways_z_ID_Way/item[@id=$ID_Join]/Points"/>
|
|
|
+ <!-- wyszukanie drog wychodzacych innych niz nasza z punktu -->
|
|
|
+ <xsl:for-each select="$joins2ways_z_ID_Way/joins2ways_z_ID_Way/item[@id=$ID_Join]/item[not(@ID_WAY=$ID_Way)]">
|
|
|
+ <Ways>
|
|
|
+ <xsl:attribute name="ID_WAY" select="@ID_WAY"/>
|
|
|
+ <xsl:attribute name="ways_id" select="text()"/>
|
|
|
+ </Ways>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:for-each>
|
|
|
+ </LineString>
|
|
|
+ </xsl:for-each>
|
|
|
</xsl:variable>
|
|
|
<xsl:copy-of select="$Linestring"/>
|
|
|
<xsl:choose>
|
|
|
@@ -223,6 +274,7 @@
|
|
|
<xsl:with-param name="Last_Y2" select="$Last_Y2"/>
|
|
|
<xsl:with-param name="not_id" select="$Linestring/LineString/@not_id"/>
|
|
|
<xsl:with-param name="loop" select="$loop+1"/>
|
|
|
+ <xsl:with-param name="ID_Way" select="$ID_Way"/>
|
|
|
</xsl:call-template>
|
|
|
</xsl:otherwise>
|
|
|
</xsl:choose>
|
|
|
@@ -230,5 +282,30 @@
|
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
+
|
|
|
+ <!--<xsl:template name="AsText_XML">
|
|
|
+ <xsl:param name="LineString" required="yes"/>
|
|
|
+ <xsl:for-each select="$LineString/LineString">
|
|
|
+ <PathPoint>
|
|
|
+ <xsl:copy-of select="@*"/>
|
|
|
+ </PathPoint>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:template>-->
|
|
|
+
|
|
|
+ <xsl:template name="AsText">
|
|
|
+ <xsl:param name="LineString" required="yes"/>
|
|
|
+ <xsl:value-of select="'LINESTRING ('"/>
|
|
|
+ <xsl:for-each select="$LineString/LineString">
|
|
|
+ <xsl:value-of select="concat(@X,' ',@Y)"/>
|
|
|
+ <xsl:if test="not(position()= last())">
|
|
|
+ <xsl:value-of select="', '"/>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
+ <xsl:value-of select="')'"/>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
</xsl:stylesheet>
|