Extracting street names for verification

Hello!

I would like to share a small XSLT transform used to extract list of street names from a particular OSM file. Browsing such lists appear to be very useful for tracking typos or comparing with official geodetic databases. Any comments will be appreciated. Generated lists are sorted and with duplicates removed. Tested on xsltproc.

If you want to show duplicate names (and boost speed of transform), remove

and not(./tag[@k='name']/@v=following::tag[@k='name']/@v

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" indent="no"/>
<xsl:strip-space elements="*"/>

  <xsl:template match="/">
    
     <xsl:for-each select="/osm/way">
      <xsl:sort select="./tag[@k='name']/@v" />
        <xsl:if test="./tag[@k='highway'] and ./tag[@k='name'] and not(./tag[@k='name']/@v=following::tag[@k='name']/@v)">
          <xsl:value-of select="./tag[@k='name']/@v"/>
          <xsl:text>
</xsl:text>    
        </xsl:if>
     </xsl:for-each>
    
  </xsl:template>
</xsl:stylesheet>

When you are aware of the German language you can start investigating at http://wiki.openstreetmap.org/wiki/Stra%C3%9Fenverzeichnis

This page contains links to the online services from Sven Anders and Florian Lohoff who already have programmed automatic scripts to compare an official list of streetnames with all streets in OSM data described with a boundary relation or a bounding box.

Maybe there you can find more information. Ask here if you cannot read German or you need help to get contact to the two guys.