aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdmund von der Burg <evdb@mysociety.org>2011-02-08 20:29:01 +0000
committerEdmund von der Burg <evdb@mysociety.org>2011-02-08 20:29:01 +0000
commit7f385c7c11522208bb55bdc600da8b0a6081226a (patch)
tree008940c0b1e2fd5db0f8e1af88727628c9dba149
parentf8c9895e98e00a8272fc9b74537e0449a0af79cb (diff)
converted update-areas script
-rwxr-xr-xbin/update-areas4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/update-areas b/bin/update-areas
index ed463708a..bbc933faf 100755
--- a/bin/update-areas
+++ b/bin/update-areas
@@ -33,11 +33,11 @@ BEGIN {
}
print "Fetching problems...\n";
-my $ids = select_all("select id, easting, northing from problem where areas=''");
+my $ids = select_all("select id, latitude, longitude from problem where areas=''");
print "Updating areas...\n";
my $c = 0;
foreach (@$ids) {
- my $areas = mySociety::MaPit::get_voting_areas_by_location({easting=>$_->{easting}, northing=>$_->{northing}}, 'polygon');
+ my $areas = mySociety::MaPit::get_voting_areas_by_location({latitude=>$_->{latitude}, longitude=>$_->{longitude}}, 'polygon');
$areas = ',' . join(',', sort keys %$areas) . ',';
dbh()->do('update problem set areas=? where id=?', {}, $areas, $_->{id});
dbh()->commit();