You are not logged in.

Announcement

*** NOTICE: forum.openstreetmap.org is being retired. Please request a category for your community in the new ones as soon as possible using this process, which will allow you to propose your community moderators.
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***

#1 2011-01-05 02:58:56

rogal
Member
Registered: 2010-11-09
Posts: 694

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>&#xa;</xsl:text>    
        </xsl:if>
     </xsl:for-each>
    
  </xsl:template>
</xsl:stylesheet>

Last edited by rogal (2011-01-05 03:01:16)


http://navidata.pl  - geokodowanie oparte o OSM
http://garmin.osmapa.pl - mapy Polski na urządzenia Garmin

Offline

#2 2011-01-05 17:23:01

stephan75
Member
Registered: 2008-05-28
Posts: 2,918

Re: Extracting street names for verification

When you are aware of the German language you can start investigating at http://wiki.openstreetmap.org/wiki/Stra … erzeichnis

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.

Offline

Board footer

Powered by FluxBB