James Hollingworth’s Adventures in Code

Icon

C# PostCode GeoCoding

Part of my project needs me to get the coordinates for a given post code. I found FreeThePost.org which allow you to perform geocoding querys pretty easily by doing something like http://www.freethepostcode.org/geocode?postcode=rg20eu. Decided to whip up a quick C# object to do it. Its all pretty simple, do something like:

PostCodeGeoEncoder encoder = new PostCodeGeoEncoder( postCode );
Coordinates coords = encoder.GetLocation();

The assembly for it is here, i hope this saves someone a couple of minutes of hassle!

Filed under: .net, c#, geocoding, postcode

my bookmarks