OSTN02 for PHP is a software library for doing the OSTN02 conversion. This is useful for accurately converting UK map references to WGS84/ETRS89 latitudes and longitudes. It is a partial port of the Perl library Geo-Coordinates-OSGB.
OSTN02 uses a large look up table. This can be handled in three ways (see ostn02config.php for details):
A port of this software is available in Python.
This software is released under the Simplified BSD license. Comments to TimSC, please.
The script can be called from the command line and a web interface:
http://localhost/ostn02php/ConvToOsbg36.php?lat=51.29831006&lon=1.07337394&h=44.621 http://localhost/ostn02php/ConvToWgs84.php?e=614350&n=159950&h=0
or
php ConvToOsbg36.php 51.29831006 1.07337394 44.621 php ConvToWgs84.php 614350 159950 0
The result is XML formatted. You can check the accuracy on the OS website.