I've switched this conversation to dev, its probably a bit heavy for talk.<br><br>Looks like you've done the hard bit.  The same for nodes is easy:<br><br><xsl:choose><br>  <xsl:when test='name()="node"'>
<br>     <xsl:variable name='lat' select='@lat' /><br>     <xsl:variable name='lon' select='@lon' /><br>  </xsl:when><br>  <xsl:otherwise><br>    <!-- get lat and lon from first and last segment as ou are currently doing it -->
<br>  </xsl:otherwise><br></xsl:choose><br><br>(Written before my first cup of coffee and not tested anyway so don't expect it to work).<br>Etienne<br><br><div><span class="gmail_quote">On 9/26/06, <b class="gmail_sendername">
Robert Hart</b> <<a href="mailto:Robert.Hart@burohappold.com">Robert.Hart@burohappold.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yes, I don't have a problem with the names. Anyway, it was just a<br>suggestion. The problem I have is finding the location. For a node the<br>location is attributes of the node, but for a way, you have to dereference<br>
the segments then nodes, and find a mid point.<br><br>My current code just does ways (see below), but I'd like to include nodes as<br>way:<br><br>  <xsl:template name='keyDraw'><br>    <xsl:for-each select="$data/osm/way/tag[@k='name']">
<br>      <xsl:sort select="@v"/><br>        <xsl:variable name="col" select="floor(position() div (($height -<br>40) div 6))" /><br>        <xsl:variable name="row" select="position() - $col * floor(($height
<br>- 40) div 6)" /><br>        <text font-family='Verdana' font-size='6px' fill='black'><br>          <xsl:attribute name='x'><xsl:value-of select='10 + $width +<br>$col*80'/></xsl:attribute>
<br>          <xsl:attribute name='y'><xsl:value-of select='20 + 6 *<br>$row'/></xsl:attribute><br>          <xsl:value-of select="@v"/><br>        </text><br>        <text font-family='Verdana' font-size='6px' fill='black'>
<br>          <xsl:attribute name='x'><xsl:value-of select='80 + $width +<br>$col*80'/></xsl:attribute><br>          <xsl:attribute name='y'><xsl:value-of select='20 + 6 *<br>$row'/></xsl:attribute>
<br>          <xsl:variable name='startseg' select='../seg[1]' /><br>          <xsl:variable name='endseg' select='../seg[position()=last()]' /><br>          <xsl:variable name='start'<br>select='key("segmentById",$startseg/@id)' />
<br>          <xsl:variable name='end' select='key("segmentById",$endseg/@id)'<br>/><br>          <xsl:variable name='startNode'<br>select='key("nodeById",$start/@from)'/><br>          <xsl:variable name='endNode' select='key("nodeById",$end/@from)'/>
<br>          <xsl:variable name='lat' select='($startNode/@lat + $endNode/@lat)<br>div 2' /><br>          <xsl:variable name='lon' select='($startNode/@lon + $endNode/@lon)<br>div 2' /><br>          <xsl:value-of select="floor(($lon - $bllon) div 
0.0089928)"/><br>          <xsl:value-of<br>select="substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ',floor((($lat - $bllat) div<br>0.0089928) * $projection),1)"/><br>          <!--<xsl:value-of select="$start" />,
<br>          <xsl:value-of select="$lat" />,<br>          <xsl:value-of select="$lon" />--><br>        </text><br>     </xsl:for-each><br>  </xsl:template><br><br><br>
-----Original Message-----<br>From: Etienne<br>To: Robert Hart<br>Cc: Nick Whitelegg; <a href="mailto:talk-bounces@openstreetmap.org">talk-bounces@openstreetmap.org</a> ; <a href="mailto:talk@openstreetmap.org">talk@openstreetmap.org
</a><br>Sent: 9/26/2006 9:29 PM<br>Subject: Re: [OSM-talk] Another point in support of ways as ordered lists<br><br>Rob<br>An xpath expression like $elements[tag[@k="name"]] will select all nodes<br>and ways with a name tag.  You don't need to do anything special to
<br>combine nodes and ways, because the $elements variable is already a set<br>of nodes and ways that match the rule (assuming the rule is <rule<br>e="node|way">).<br><br>If you want all the names in alphabetical order try something like:
<br><xsl:for-each select='$elements[[tag[@k="name"]]/@name''><br>  <xsl:sort order="ascending"><br>  ...<br><br>Etienne<br><br><br><br>On 9/26/06, Robert Hart < <a href="mailto:Robert.Hart@burohappold.com">
Robert.Hart@burohappold.com</a><br><mailto:<a href="mailto:Robert.Hart@burohappold.com">Robert.Hart@burohappold.com</a>> > wrote:<br><br>I just had a brain wave. If ways are ordered lists of nodes, then POIs<br>can
<br>be ways containing only one node. This may sound odd, but I think it has<br>real advantages (well at least one advantage anyway...)<br><br>I've been playing around with creating map indices in osmarender. To do<br>this
<br>I need to know the name and approximate location of everything that<br>should<br>be included in the index. This means I have to handle nodes and<br>ways/areas<br>seperately, which is going to be painful if I want the whole index in
<br>alphabetical order (as opposed to having separate indices for ways and<br>nodes). If POIs were single-node ways, everything would just work with<br>one<br>code path.<br><br>Rob<br><br><br><br>This message has been scanned for viruses by MailControl -
<br><a href="http://www.mailcontrol.com">www.mailcontrol.com</a> <<a href="http://www.mailcontrol.com">http://www.mailcontrol.com</a>><br><br>_______________________________________________<br>talk mailing list<br> <mailto:
<a href="mailto:talk@openstreetmap.org">talk@openstreetmap.org</a>> <a href="mailto:talk@openstreetmap.org">talk@openstreetmap.org</a><br><a href="http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk">http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
</a><br><<a href="http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk">http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk</a>><br><br><br><br></blockquote></div><br>