Changeset 391


Ignore:
Timestamp:
Nov 22, 2006, 9:42:19 AM (13 years ago)
Author:
David Sheldon
Message:

Fix problem with CH3 4 and CH34 the same.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/scripts/exporter/updatePostcodeine.pl

    r278 r391  
    4444# Process the query
    4545$query->execute;
    46 while(my ($outer,$inner,$e,$n) = $query->fetchrow_array) {
     46while(my ($outer,$e,$n) = $query->fetchrow_array) {
    4747    $e =~ s/^(\d+)\.\d+$/$1/;
    4848    $n =~ s/^(\d+)\.\d+$/$1/;
    49     my $pcode = "$outer$inner";
     49    my $pcode = $outer;
    5050    if (length($pcode) > 2) {
    5151            print OUT "\"$pcode\",$e,$n\n";
     
    6565
    6666# Get a query returning
    67 #               outer, inner, easting, northing
     67#               outer . inner, easting, northing
    6868sub getQuery {
    6969        my ($conn) = @_;
    7070
    7171    my $sql =
    72         "SELECT outward, inward, AVG(easting) AS avg_easting, AVG(northing) AS avg_northing ".
     72        "SELECT outward || inward, AVG(easting) AS avg_easting, AVG(northing) AS avg_northing ".
    7373        "FROM postcodes  ".
    7474        "WHERE NOT deleted ".
    75         "GROUP BY outward, inward ".
     75        "GROUP BY outward || inward ".
    7676        "ORDER BY outward || inward ";
    7777
Note: See TracChangeset for help on using the changeset viewer.