Ignore:
Timestamp:
Oct 7, 2007, 11:44:47 AM (12 years ago)
Author:
Nick Burch
Message:

Tweak outer1 export

File:
1 edited

Legend:

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

    r553 r587  
    1414#   -outer1
    1515#       Only export the outer part + 1st inner digit, averaged over all
     16#       (Excludes entries where we only have an outward, but no inward)
    1617#   -npeonly
    1718#       Only export NPE sourced postcodes, averaged if several for a postcode
     
    123124                return $sth;
    124125        } elsif($mode eq "-outer1") {
     126                # Not - will exclude data where we only have an outward, and no inward
    125127                my $sql =
    126128                        "SELECT outward, substr(inward,1,1) || '##' AS inward, AVG(easting) AS avg_easting, AVG(northing) AS avg_northing, AVG(ie_easting) AS avg_easting_ie, AVG(ie_northing) AS avg_northing_ie ".
    127                         "FROM postcodes WHERE NOT deleted ".
     129                        "FROM postcodes ".
     130                        "WHERE NOT deleted AND length(inward) > 0 ".
    128131                        "GROUP BY outward, substr(inward,1,1) ".
    129132                        "ORDER BY outward, inward";
Note: See TracChangeset for help on using the changeset viewer.