aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdmund von der Burg <evdb@mysociety.org>2011-02-07 21:28:50 +0000
committerEdmund von der Burg <evdb@mysociety.org>2011-02-07 21:28:50 +0000
commita1ecf764785a6884380da1ed4b3470a6ea76751c (patch)
treeda23e7b089357d62082d56839fc77759ad46c0a3
parent375d2faf7150d5d201eaf77408bf0fdbaa7e534b (diff)
convert e,n to lat,lon for flickr importer
-rwxr-xr-xbin/import-flickr14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/import-flickr b/bin/import-flickr
index 992a6ac8e..21ea5822a 100755
--- a/bin/import-flickr
+++ b/bin/import-flickr
@@ -72,19 +72,19 @@ while ($result =~ /<photo id="([^"]*)" owner="([^"]*)" secret="([^"]*)" server="
sub problem_create {
my ($photo_id, $owner, $title, $lat, $lon, $image) = @_;
my ($name, $email) = dbh()->selectrow_array("select name, email from partial_user where service='flickr' and nsid=?", {}, $owner);
- my ($easting, $northing) = (0,0);
+
+ # set some defaults
$name ||= '';
- if ($lat && $lon) {
- # XXX This appears to be going wrong :(
- ($easting, $northing) = mySociety::GeoUtil::wgs84_to_national_grid($lat, $lon, 'G');
- }
+ $lat ||= 0;
+ $lon ||= 0;
+
my $id = dbh()->selectrow_array("select nextval('problem_id_seq')");
Utils::workaround_pg_bytea("insert into problem
- (id, postcode, easting, northing, title, detail, name,
+ (id, postcode, latitude, longitude, title, detail, name,
email, phone, photo, state, used_map, anonymous, category, areas)
values
(?, '', ?, ?, ?, '', ?, ?, '', ?, 'partial', 't', 'f', '', '')", 7,
- $id, $easting, $northing, $title, $name, $email, $image
+ $id, $latitude, $longitude, $title, $name, $email, $image
);
dbh()->do('insert into flickr_imported (id, problem_id) values (?, ?)', {}, $photo_id, $id);