Training, Open Source computer languages

PerlPHPPythonMySQLhttpd / TomcatTclRubyJavaC and C++LinuxCSS

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Ordnance Survey Grid Reference to Latitude / Longitude
I've already written about conversion of postal addresses to latitude and longitude using Google's interface - but what is I want to convert the Ordinance Survey's grid references into latitude and longitude? Google's interface doesn't support the OS units - and in any case it's "just" a a calculation. I have put quotes around the word "just" because it's actually a complex calculation that I had no desire to re-code from learned papers.

Of course ... it's been done already. Perl's Geography::NationalGrid module which you can download from the CPAN. Now I wanted to use that in a PHP page to demonstrate to you, so I've written a quick Perl command line program that my PHP calls up when it needs to and .... bob's your uncle.

Try it out here (examples ST906637 is in Melksham ... SJ347904 is in Liverpool) :
Enter a grid reference:


The source code is also available for you:
The Perl command line program
The PHP which calls up that Perl

External links -
Descritpion of coordinate system and conversion algorithms (.pdf)
Perl Cpan module
(written 2007-10-14 07:39:28)

 
Associated topics are indexed under
H999 - Additional PHP Material
H309 - PHP - Maps, Graphics and Geographics
P219 - Perl - Libraries and Resources
H115 - Designing PHP-Based Solutions: Best Practice

Back to
Converting from postal address to latitude / longitude
Previous and next
or
Horse's mouth home
Forward to
Autumnal lighting on a London trip

Some other Articles
Dont just convert to Perl - re-engineer!
Business to Business Networking - North and West Wilts / Melksham
First Alternative / what has happened there?
Autumnal lighting on a London trip
Ordnance Survey Grid Reference to Latitude / Longitude
Converting from postal address to latitude / longitude
Controlling and labelling Google maps via PHP
Well House Manor - a year on
Error logging to file not browser in PHP
New software product for warmblooded programmers
1690 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

© WELL HOUSE CONSULTANTS LTD., 2008: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho