Skip Menu |

This queue is for tickets about the Geography-NationalGrid CPAN distribution.

Report information
The Basics
Id: 11168
Status: new
Priority: 0/
Queue: Geography-NationalGrid

Owner: Nobody in particular
Requestors: cpan [...]

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)

Subject: fudge factor not really required
Download (untitled) / with headers
text/plain 913b
the script introduces a fudge, see the code below, when converting from Lat/Long to GridRef. However I dont think this sentiment is correct in the UK as National Grid References are by convention to the lower left corner. my $fudge = $self->{'DefaultResolution'} / 2; # because the point is within the _square_ based at the E,N coordinate ($self->{'Easting'}, $self->{'Northing'}) = ($E + $fudge, $N + $fudge); (line 244,245 of the Geography\ changing it to ($self->{'Easting'}, $self->{'Northing'}) = ($E + 0.5, $N + 0.5); seemed to do the trick! (0.5 is actually to account for rounding errors because the module later uses int() to round the easting/northings) The fact that it did this 'fudge' one way but not the other is slightly worrying, meaning that the coordinates by this module arent reversible. However its debateable if this 'feature' is an issue for your application.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to