|
Geography::NationalGrid::IE - Module to convert Irish National Grid references to/from Latitude and Longitude |
Geography::NationalGrid::IE - Module to convert Irish National Grid references to/from Latitude and Longitude
You should _create_ the object using the Geography::NationalGrid factory class, but you still need to know the object interface, given below.
my $point1 = new Geography::NationalGrid::IE(
GridReference => 'M 345132',
);
my $point2 = new Geography::NationalGrid::IE(
Latitude => 53.8,
Longitude => -7.5
);
print "Point 1 is " . $point->latitude . " degrees north\n";
Once created, the object allows you to retrieve information about the point that the object represents. For example you can create an object using a grid reference and the retrieve the latitude and longitude.
These are the options accepted in the constructor. You MUST provide either a GridReference or Latitude and Longitude, or Easting and Northing (the origin for these is the usual location of V 000000).
NOTE: if you use a projection other than the default then the results for the gridReference() method will be wrong,
so the method will return undef.
However, you can use the northing() and easting() results instead to find the location in the desired projection.
Userdata = { Name => 'Dublin Observatory' }> but add whatever you want. Access using the data() method.
Most of these methods take no arguments. Some are inherited from Geography::NationalGrid
The routines used in this code may not give you completely accurate results for various mathematical and theoretical reasons. In tests the results appeared to be correct, but it may be that under certain conditions the output could be highly inaccurate. It is likely that output accuracy decreases further from the datum, and behaviour is probably divergent outside the intended area of the grid.
This module has been coded in good faith but it may still get things wrong. Hence, it is recommended that this module is used for preliminary calculations only, and that it is NOT used under any circumstance where its lack of accuracy could cause any harm, loss or other problems of any kind. Beware!
Equations for converting co-ordinate systems appear in the guide at http://www.gps.gov.uk/guidecontents.asp - entitled ``A guide to coordinate systems in Great Britain: A primer on coordinate system concepts, including full information on GPS and Ordnance Survey coordinate systems.''
Irish National Grid letter-pairs checked at http://www.evoxfacilities.co.uk/evoxig.htm
Constants also checked at http://www.ddl.org/figtree/pub/proceedings/korea/full-papers/session8/cory-morgan-bray-greenway.htm
ISO 3166 Country codes checked against http://www.din.de/gremien/nas/nabd/iso3166ma/codlstp1/en_listp1.html
Conversions compared with software from ftp://ftp.kv.geo.uu.se/pub/ and online services
Copyright (c) 2002 P Kent. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
$Revision: 1.2 $
|
Geography::NationalGrid::IE - Module to convert Irish National Grid references to/from Latitude and Longitude |