Changeset 670 for trunk


Ignore:
Timestamp:
Sep 23, 2008, 10:53:09 AM (11 years ago)
Author:
Nick Burch
Message:

Support osie too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/perllib/NPEMap/Postcodes.pm

    r645 r670  
    145145        my $postcode_text = $postcode->{outward} . ' ' .
    146146                            $postcode->{inward} || '';
    147         my ($lat,$long) = eastingNorthingToLatLong(
    148               $postcode->{easting},$postcode->{northing},$postcode->{grid});
     147
     148                my $grid = "osgb";
     149                my ($easting,$northing) = ($postcode->{easting},$postcode->{northing});
     150                unless($easting && $northing) {
     151                        $grid = "osie";
     152                        ($easting,$northing) = ($postcode->{ie_easting},$postcode->{ie_northing});
     153                }
     154        my ($lat,$long) = eastingNorthingToLatLong($easting,$northing,$grid);
    149155
    150156        $rss->add_item(
     
    160166            },
    161167            os => {
    162                 x => sprintf("%d", $postcode->{easting}),
    163                 y => $long = sprintf("%d", $postcode->{northing}),
     168                x => sprintf("%d", $easting),
     169                y => $long = sprintf("%d", $northing),
    164170            },
    165171        );
Note: See TracChangeset for help on using the changeset viewer.