-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load ten figure UK grid refs #19
Comments
Just convert the grid ref to eastings/northing first. Then use: $OSRef = new OSRef(500000, 200000); //Easting, Northing The conversion from grid ref to easting/northing is easy enough and you can decide if you want it centred or bottom left corner. I have a function that does this - it's pretty old code but still works ok. Happy to share if it helps. Steve |
Thanks for looking into this for me Steve. I couldn't find a routine here to convert the 10 figure grid ref into an easting and northing, could you point me in the right direction? Centering the result does sound good too. Any code you can share at all would be much appreciated. Cheers, James |
Hi James, Hope it helps. It doesn't do any centering - but that would be easy to add as you have the resolution - so just add half the resolution meters to easting and northing. Steve ========================================
|
Cheers Steve. The first two letter conversions go over my head but I can confirm your code does work well. I hope to study it soon! Thanks again, |
Glad it works James. Take a look at the image at the top of this page: http://www.record-lrc.co.uk/c2.aspx?Mod=Article&ArticleID=GridRefs_Main Hopefully explains how the letters work! Steve |
Thanks for the suggestion, I've now added this and released it as a new version. The If you're using an older PHP version still and need me to backport to the v2 branch, please let me know, it would be pretty easy to do |
That's a nice added bonus, Doug - cheers! You are doing excellent work here. James |
Hi,
I'm looking to convert 10 figure grid references to latitude/longitude pairs. I've used Jonathan's getOSRefFromSixFigureReference() and then $os6x->toLatLng() for many years, but I'm now looking for more accuracy.
I noticed that you have a fromSixFigureReference(), would you consider adding one for Ten?
Best wishes,
James
The text was updated successfully, but these errors were encountered: