|
|
@@ -40,6 +40,25 @@
|
|
|
</xsl:otherwise>
|
|
|
</xsl:choose>-->
|
|
|
<!--<xsl:copy-of select="$EdgeWayJoinsPair_cand/no_EdgeWayJoinsPair"></xsl:copy-of>-->
|
|
|
+ <xsl:variable name="guess_edges">
|
|
|
+
|
|
|
+ <xsl:for-each select="item">
|
|
|
+ <guess_join>
|
|
|
+ <xsl:attribute name="ID_Way" select="@ID_Way"/>
|
|
|
+ <xsl:variable name="ID_Way">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@ID_Way"><xsl:value-of select="@ID_Way"/></xsl:when>
|
|
|
+ <xsl:otherwise><xsl:value-of select="0"/></xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:apply-templates select="." mode="joins_not_way">
|
|
|
+ <xsl:with-param name="ID_Way" select="$ID_Way"/>
|
|
|
+ </xsl:apply-templates>
|
|
|
+ </guess_join>
|
|
|
+ </xsl:for-each>
|
|
|
+
|
|
|
+
|
|
|
+ </xsl:variable>
|
|
|
|
|
|
<EdgeWayJoins>
|
|
|
<!--<xsl:for-each-group select="$EdgeWayJoinsPair_cand/no_EdgeWayJoinsPair" group-by="@ID_Way">
|
|
|
@@ -87,11 +106,14 @@
|
|
|
</EdgeWayJoinsPair>
|
|
|
</xsl:for-each-group>-->
|
|
|
<xsl:for-each-group select="item" group-by="@ID_Way">
|
|
|
+ <xsl:variable name="ID_Way" select="@ID_Way"/>
|
|
|
+
|
|
|
<EdgeWayJoinsPair>
|
|
|
<xsl:attribute name="ID_Way" select="@ID_Way"/>
|
|
|
- <xsl:variable name="ID_Way" select="@ID_Way"/>
|
|
|
+ <!--<xsl:copy-of select="$guess_edges/guess_join[@ID_Way=$ID_Way]"></xsl:copy-of>-->
|
|
|
<xsl:for-each select="current-group()">
|
|
|
- <xsl:choose>
|
|
|
+ <!--<GROUP><xsl:copy-of select="item("></xsl:copy-of></GROUP>-->
|
|
|
+ <xsl:choose>
|
|
|
<xsl:when test=" position()=1 or position()=last()">
|
|
|
<bp:Joins>
|
|
|
<xsl:attribute name="Joins" select="@id"/>
|
|
|
@@ -163,6 +185,71 @@
|
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
+ <xsl:template match="item" mode="joins_not_way">
|
|
|
+ <xsl:param name="ID_Way" required="yes"/>
|
|
|
+ <!--<xsl:variable name="count_our_way">
|
|
|
+ <xsl:for-each select="item">
|
|
|
+ <xsl:element name="count_our_way">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="@ID_WAY=$ID_Way">1</xsl:when>
|
|
|
+ <xsl:otherwise>0</xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>-->
|
|
|
+ <!--<see>
|
|
|
+ <xsl:copy-of select="."/>
|
|
|
+ <inside>
|
|
|
+ <xsl:attribute name="count_our" select="count(item[@ID_WAY=$ID_Way])"/>
|
|
|
+ <count_our_way_val>
|
|
|
+ <xsl:copy-of select="$count_our_way"/>
|
|
|
+ </count_our_way_val>
|
|
|
+ <xsl:for-each select="item[@ID_WAY!=$ID_Way]">
|
|
|
+ <xsl:element name="EdgeWayJoinsPair_cand">
|
|
|
+ <xsl:attribute name="joins" select="../@id"/>
|
|
|
+ <xsl:attribute name="ID_Way" select="../@ID_Way"/>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:for-each>
|
|
|
+ </inside>
|
|
|
+ </see>-->
|
|
|
+ <xsl:variable name="if_item_not_in_way">
|
|
|
+ <xsl:for-each select="item">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="not(@ID_WAY=$ID_Way)">
|
|
|
+ <xsl:element name="EdgeWayJoinsPair_cand">
|
|
|
+ <xsl:attribute name="joins" select="../@id"/>
|
|
|
+ <xsl:attribute name="ID_Way" select="../@ID_Way"/>
|
|
|
+ </xsl:element></xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+
|
|
|
+
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:variable>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="count(item)=1">
|
|
|
+ <xsl:element name="EdgeWayJoinsPair_cand">
|
|
|
+ <xsl:attribute name="pos" select="position()"/>
|
|
|
+ <xsl:attribute name="joins" select="@id"/>
|
|
|
+ <xsl:attribute name="ID_Way" select="@ID_Way"/>
|
|
|
+ <xsl:attribute name="ways" select="item/text()"/>
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="$if_item_not_in_way/EdgeWayJoinsPair_cand and count(item[@ID_WAY=$ID_Way])<2">
|
|
|
+ <xsl:element name="EdgeWayJoinsPair_cand">
|
|
|
+ <xsl:attribute name="debug" select="'has other way'"/>
|
|
|
+ <xsl:attribute name="joins" select="@id"/>
|
|
|
+ <xsl:attribute name="ID_Way" select="@ID_Way"/>
|
|
|
+ <xsl:attribute name="ways">
|
|
|
+ <xsl:for-each select="item/text()">
|
|
|
+ <xsl:value-of select=" concat(.,' ')"/>
|
|
|
+ </xsl:for-each>
|
|
|
+ </xsl:attribute>
|
|
|
+ <!--<xsl:attribute name="ways" select="item/text()" separator="', '" />-->
|
|
|
+ </xsl:element>
|
|
|
+ </xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
<xsl:template match="item" mode="joins">
|
|
|
<!--<xsl:param name="second_turn" />-->
|
|
|
<xsl:choose>
|