Kake L Pugh wrote:
[0] http://gps.ordnancesurvey.co.uk/etrs89geo_natgrid.asp
So - if a Guide accepts data as X/Y coords, then when I put in the OSGB data generated by my GPS unit, the Guide will inaccurately convert those coords to lat/long, and spit out inaccurate lat/long when someone asks for the data. If it accepts data as lat/long coords, then it will spit out inaccurate X/Y when someone asks for the data.
I'm not sure what the answer to this is. There was a discussion on the london.pm mailing list recently, in which people spoke lots about releasing code, but nobody actually did.
I started that thread. I'll happily mail you the code that I used for this if you want it, but it's just a very ploddy implementation of the textual algorithm from the the ordnance survey site pdf you have, which assumes the lookup tables have been uploaded to mysql before querying them.
I've only done it in one direction (northing/easting-> lat/long) but there is also a description of the reverse algorithm in the same document. About 30 lines of code or so.
The problems wouldn't be code, they would be in distributing the lookup tables. Maybe it would be enough just to point people to the os site for the data. But Dirk on london.pm kind of implied he had a way to get the same level of accuracy without the tables, it might be worth asking him.
Graham
I'm vaguely wondering if the OS would be happy with a module that let people query their webservice automatically, and if so, if it would be easy to make the internal coord conversion of OpenGuides more "pluggable", so people could choose to use the webservice module instead, if they cared more about accuracy than about being able to keep going in the face of the OS website not responding.
Another possibility would be to let people have the option of entering _both_ lat/long and X/Y, and treating them as effectively independent sets of data. If someone chose not to enter both, the internal conversion could still take place, but the data would be flagged (in the database and the output) as auto-converted.
What do people think?
Kake