I adapted the Python code a bit, so several .osm files are created, one for each country:<br><br>A source tag is also added. I also added some invalid data, so it shouldn't be possible to upload these files to the server directly. As they are now, it is possible to cherry pick addresses on one OSM layer and copy/paste them to another (new) layer.<br>
<br>The 2 adresses I already processed where both companies, so it's probably worth it to look them up on the internet to find out what is located at these adresses.<br><br>Enjoy!<br><br>Jo<br><br>PS: it's trivial to adapt this code so it creates a separate file per state/city for use in the US.<br>
<br><span style="background-color: rgb(102, 255, 153);">#!/usr/bin/python</span><br style="background-color: rgb(102, 255, 153);"><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">from xml.sax.saxutils import escape</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">import sys</span><br style="background-color: rgb(102, 255, 153);"><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">countriesFH={}</span><br style="background-color: rgb(102, 255, 153);">
<br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">def writeNode(node,countryISOcode):</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">    if not(countryISOcode in countriesFH):</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        countriesFH[countryISOcode] = open('mapquest ' + countryISOcode + '.osm', 'w')</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">        countriesFH[countryISOcode].write("<osm version=\"0.6\" generator=\"anothercaf2osm v0.1\">\n")</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        # Adding a node with coordinates outside the world, so osm.-file cannot be uploaded directly without processing</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        # The API will reject it</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">        countriesFH[countryISOcode].write('<node id="-999996" lat="90.1" lon="0.1">\n  <tag k="name" v="Do not upload this layer directly"/>\n </node>\n')</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        # And a second one at the same position so a validation error is presented to the user before attempting the upload</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        countriesFH[countryISOcode].write('<node id="-999997" lat="90.1" lon="0.1"/>\n')</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        countriesFH[countryISOcode].write('<node id="-999998" lat="90.1" lon="0.2">\n  <tag k="name" v="Instead copy/paste the nodes one by one to a new layer"/>\n </node>\n')</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        countriesFH[countryISOcode].write('<node id="-999999" lat="90.1" lon="0.2"/>\n')</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">    countriesFH[countryISOcode].write('<node id="%d" lat="%f" lon="%f">\n' % (node['id'], node['lat'], node['lon']))</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">    for (key, value) in node['tags'].items():</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">        countriesFH[countryISOcode].write(' <tag k="%s" v="%s" />\n' % (key, value))</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">    countriesFH[countryISOcode].write('</node>\n')</span><br style="background-color: rgb(102, 255, 153);"><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">id = -1</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">with open(sys.argv[1], 'r') as input_file:</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">    for a_line in input_file:</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">        line=a_line.split(',')</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        #print(id, line)</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">        if id == -1:</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">            id = id - 1</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">            continue</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        tags = {}</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">        if line[1]: tags['addr:country'] = escape(line[1])</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        if line[2]: tags['addr:state'] = escape(line[2])</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">        if line[4]: tags['addr:postcode'] = escape(line[4])</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        if line[3]: tags['addr:city'] = escape(line[3])</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">        if line[0]: tags['addr:street'] = escape(line[0])</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        if line[5]: tags['addr:housenumber'] = escape(line[5])</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">        tags['source'] = 'mapquest_critical_addresses'</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        lat = float(line[7]) / 1000000</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">        lon = float(line[8]) / 1000000</span><br style="background-color: rgb(102, 255, 153);">
<br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">        node = {'tags': tags,</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">                'lat': lat,</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">                'lon': lon,</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">                'id': id}</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        writeNode(node,line[1])</span><br style="background-color: rgb(102, 255, 153);"><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">        id = id - 1</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">        #raw_input()</span><br style="background-color: rgb(102, 255, 153);"><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">for country in countriesFH:</span><br style="background-color: rgb(102, 255, 153);">
<span style="background-color: rgb(102, 255, 153);">    countriesFH[country].write('</osm>\n')</span><br style="background-color: rgb(102, 255, 153);"><span style="background-color: rgb(102, 255, 153);">    countriesFH[country].close()</span><br>
<br>2011/3/3 Pieren <<a href="mailto:pieren3@gmail.com">pieren3@gmail.com</a>>:<br>> On Thu, Mar 3, 2011 at 1:13 AM, Anthony <<a href="mailto:osm@inbox.org">osm@inbox.org</a>> wrote:<br>>><br>>> The Europe file has 707 addresses.<br>
>><br>><br>> And after a quick check on the FR addresses, I've seen that about 10% of the<br>> post codes are wrong.<br>><br>> Pieren<br>><br>> _______________________________________________<br>
> talk mailing list<br>> <a href="mailto:talk@openstreetmap.org">talk@openstreetmap.org</a><br>> <a href="http://lists.openstreetmap.org/listinfo/talk">http://lists.openstreetmap.org/listinfo/talk</a><br>><br>
><br><br>