Hi Aidan<div><br></div><div>If you were to do this then two things you should consider:</div><div><br></div><div>1. only tag closed ways  where tag is building=xxxxxx AFAIK water and woods and gardendens etxc don't have postcodes</div>
<div>2.  how to treat buildings where there is already a postcode and if correct/incorrect</div><div><br></div><div>Regards</div><div><br></div><div>Brian</div><div><br><div class="gmail_quote">On 13 January 2013 15:21, Aidan McGinley <span dir="ltr"><<a href="mailto:aidmcgin+openstreetmap@gmail.com" target="_blank">aidmcgin+openstreetmap@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Been toying with some ideas for how to use the ONS Postcode data[1].  One idea that I have been exploring is to check if the value for the centre of the postcode is inside a closed way, and if so then tag that way with the appropriate addr:postcode.  I mocked up a script to check this using the overpass API.  Some sample output is in the attached link [2].  Essentially the output shows the postcode and the associated way or ways that enclose it if more than one.  I've excluded ways tagged landuse=*.  The script is pretty inefficient at the moment, and needs to be optimised, but before I do that I wanted to check with the wider community that this is a viable approach, and if so the best way to do the import.</div>

<div><br></div><div>Worth noting that if the data were imported, then ways that map to multiple postcodes would need to be excluded, as discussed previously on the mailing list[3]</div><div><br></div><div>[1] <a href="http://www.ons.gov.uk/ons/guide-method/geography/products/postcode-directories/-nspp-/index.html" target="_blank">http://www.ons.gov.uk/ons/guide-method/geography/products/postcode-directories/-nspp-/index.html</a></div>

<div>[2] <a href="http://paste.ubuntu.com/1527642/" target="_blank">http://paste.ubuntu.com/1527642/</a></div><div>[3] <a href="http://lists.openstreetmap.org/pipermail/talk-gb/2013-January/014336.html" target="_blank">http://lists.openstreetmap.org/pipermail/talk-gb/2013-January/014336.html</a></div>

<br>_______________________________________________<br>
Talk-GB mailing list<br>
<a href="mailto:Talk-GB@openstreetmap.org">Talk-GB@openstreetmap.org</a><br>
<a href="http://lists.openstreetmap.org/listinfo/talk-gb" target="_blank">http://lists.openstreetmap.org/listinfo/talk-gb</a><br>
<br></blockquote></div><br></div>