Skip to content

Instantly share code, notes, and snippets.

@ktopping
Created June 24, 2010 09:55
Show Gist options
  • Select an option

  • Save ktopping/451254 to your computer and use it in GitHub Desktop.

Select an option

Save ktopping/451254 to your computer and use it in GitHub Desktop.
use strict;
use mySociety::GeoUtil qw/national_grid_to_wgs84/;
while (<>) {
my @x=split(/,/); # split csv
my ($pc, $east, $north) = ($x[0], $x[10], $x[11]);
$pc=~s/\"//g; # remove quotes around postcode
my ($lat, $lng) = national_grid_to_wgs84($east, $north, "G"); # "G" means Great Britain
print "$pc,$lat,$lng\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment