UK Post Code Geocoding Help

Hello,

I am working on rewriting my system to use OSM instead of Bing Maps.

I need to be able to geocode a UK post code.

When I use Bing Maps I can throw the post code at the geocoding function in any format I like and it works no problem. For example, it has no problem geocoding “TW61QG” or “TW61 QG” or “TW6 1QG”

But, the OSM geocoding function appears to insist that the post code is in the exact correct format. For example…

this works:

http://nominatim.openstreetmap.org/search?q=+TW6%201QG,uk&format=xml

but this doesn’t work:

http://nominatim.openstreetmap.org/search?q=+TW61QG,uk&format=xml

Is there a way around this please?

Thanks

Trev

Apologies.

I appear to have found an answer.

Below is a link to a function which checks and cleans a post code and returns it in the correct format so I can use it with OSM.

http://www.braemoor.co.uk/software/postcodes.shtml

Hopefully this will help others…

Trev