Coordinate conversion.

Im looking to convert GPS to OS coordinates. I have a copy of the required transformation but its too complex to post here. I was wondering if someone has done this already.

Sort of thing a radio ham may have done.

GPS gives longitude and lattitude

What are OS coordinates?

Why can't you post that code? or a link?

Ordanance survey used on uk maps.

No link, its a printed ordinance survey document which i paid for and is copyright.

I did this before on a pc using basic.

Not a simple formula either , its an iterative process involving a lot of hyperbolic functions.

Elswhere i posted asking about some way of posting math formulae.

I did it a long time back so that I could overlay old maps of london with current day ones to see how the layout has changed over the years) As you say it was complicated.

This was a project that never got completed but I had licked the conversion I'll see if I can dig out the details.

First link from a Google search:
http://www.movable-type.co.uk/scripts/latlong-gridref.html
There’s Javascript code on that page to do the conversion. Looks nasty :wink:

Pete

KenF: I did it a long time back so that I could overlay old maps of london with current day ones to see how the layout has changed over the years) As you say it was complicated.

This was a project that never got completed but I had licked the conversion I'll see if I can dig out the details.

Amazing , this is exactly what i am doing. I would like to use my arduino to find the locations of old landmarks etc. Im in london although the project will not be limited there.

Its online now .

http://www.ordnancesurvey.co.uk/docs/support/guide-coordinate-systems-great-britain.pdf#page40

Annex c near the bottom

Anothe question though, can someon say what the precicion of the arduinos maths library is please.

I think the due may do it but have doubts about the atmega chips.

Arduinos only do single precision floats so 6 or 7 digits of precision. I think the Due can do double precision.

[+edit] you could try the example in the link you gave and compare the results.

Pete

I have an old handheld GPS. As far as I recall it can show positions in different coordinate systems. Maybe yours can give you the data in the format you need?

...R

Thanks guys i really need 10 dp for the precision for the maths.

Hand held gps , yes they can but arduino is needed for other stuff as well such as reading rfid tags and barcodes etc.

Due may make things a bit to expensive.

If the Due is too expensive, look at a Teensy 3 or 3.1 https://www.pjrc.com/teensy/index.html - some soldering may be required.

Pete

you can use the bignumber class to get higher precision with the Arduino.

Can you expand on that please. Ive not hard of thet before. Im on c not c++ atm.

I'm not sure exactly what your system requirements are, but I have done successful GPS projects using just the 4-byte Arduino float by collecting my GPS coordinates from a GPS, then throwing away the degrees portion. If you are reading a GPS at 1 Hz. , a change of 0.1 degree latitude would be 600 feet (more for longitude)) . So unless you're really moving very fast, your degree reading won't change from fix to fix. That means a float can be used to represent minutes only, out to 4 decimal places, an precision of about ten feet.

Of course, if your system does cross a degree boundary, you suddenly get an apparent change, say from 59.8924 min. to 00.0024 minutes. Since your system can't actually be moving that fast, you realize that you've bumped up into the next degree, and adjust accordingly.

Im trying to convert between gps and os coordinates to use old maps. The maths for that require 10 dp precision. Although over hundreds of miles one of the conversion terms needs one of the ellipsoid axis to be to nanometre precision. The maths are nuts.

I've found a php library online and downloaded it to a server I have running on my laptop. I plugged in my own latitude and longitude and let it calculate my OS co-ordinates. Using this I then did a search on streetmap.co.uk and got it to search for that OS co-ordinate. it comes back with an arrow directly at my front door..

So it seems to work. It's just a matter of converting the code to run on an arduino. It would be interesting to see how far out it is just using the native float types.

Right now I have to get some sleep but I'll work on it later, unless anyone else wants to volunteer to get this done sooner. If so the source I'm speaking of can be found here. http://www.jstott.me.uk/phpcoord/#examples

Php, java and python, sorry not got that far yet. Doubt i will anyway.

OK I've got to construct a brooder today (for some chickens and quail that are outgrowing their box, so no programming for me today :(

It would be nice if, upon my return, I find that someone else has stepped up to the plate and done the required translation. It's going to be a tedious job but I think it'll be a worthwhile exercise. In the meantime, I wonder if you could just confirm something for me.

I don't have access to a GPS module but I'm assuming that it provides you with conventional longitude and latitude data. Is this correct? I also assume that it is THIS that you want to be able to convert, in real time, to OS Eastings/Northings and Grid Reference. I assume you also want to be able to do the reverse translation?

Hi
Im actually thinking that the helmert datum transform is the one to use as it gives the best accuracy with os to gps.

I did not use that one last time.

Only needs to be one way really from os to gps.

Unless you feel like a winter challenge i wouldnt bother as it looks as though arduino cannot do the required precision math.

I found my origional and using gps it appears tob 200 + m in error although my mapreading might be rusty, possibly the map im using though.