Comments (3)
A follow up to this, when I run
new OSRef(533498, 181201))->toLatLng()
Results: 51.51346, -0.07592,
This is close but not accurate when checking with Google Maps. When I use this form http://www.bgs.ac.uk/data/webservices/convertForm.cfm
Results: 51.5139688159, -0.0775306313912
The results from the form are different and accurate, do I need to change the way i load the class to get accurate results?
Thanks Again!
from phpcoord.
Hi
So there are a few issues at play here - in the below I'm going to assume you're not familiar with any of the intricacies of geographic co-ordinates and I'll dumb it down a bit in the interests of brevity. A fuller explanation of everything can be found in https://www.ordnancesurvey.co.uk/docs/support/guide-coordinate-systems-great-britain.pdf
Basically:
- 5dp latitude/longitude represents an accuracy of about 1m. 6 dp would be an accuracy of about 10cm, and 13dp would claim to represent sub-millimetre accuracy
- the Earth is not perfect sphere or ellipsoid - it's bumpy and lumpy
- as such, when doing the maths an approximation is used to try and use an ellipsoid shape that "best fits" the planet
- there is no single correct best fit - in the UK, Ordnance survey modelling uses an ellipsoid that best fits the way the UK is placed on the planet
- when the GPS people did their modelling they used a different ellipsoid that better fits most of the planet, but doesn't fit the UK quite as well
- as such, depending on which model you use the same set of lat/long numbers actually represent a different spot on the ground
- there are ways to convert between the various models (UK to GPS), but without huge databases of surveying data to back them up they're not perfect - purely algorithmic conversion results in small errors of up to 5m (which is good enough for most purposes)
Conclusions:
- since the output of any modelling conversion is going to have an error of up to 5m, the choice to round to 5dp (1m) is on purpose - otherwise the results will be off when compared to e.g. a direct GPS reading.
- when you convert from northing/easting to lat/long you're still in the UK model of the world as used by OS. However Google maps is almost certainly using the GPS model. If you do
->toLatLng()->toWGS84()
you'll get the set of co-ordinates that I think you're expecting.
Hope that helps?
Doug
from phpcoord.
Assuming this helped you out - if not, please do reopen :)
from phpcoord.
Related Issues (20)
- Possibility to map UTM coordinates to a different zone? HOT 13
- ITM to WGS84 error
- Irish Grid to WGS84 problems HOT 6
- Library upgrade assistance HOT 3
- Uncaught Error: Class 'PHPCoord\CoordinateReferenceSystem\Projected' not found HOT 4
- Lat/long from eastings & northings v4 HOT 6
- License requirments of the EPSG dataset HOT 4
- I experience a memory leak HOT 2
- Accuracy of EPSG_AMERSFOORT_RD_NEW ⇒ EPSG_WGS_84 conversion HOT 23
- Division by zero HOT 2
- EPSG_AMERSFOORT_RD_NEW ⇒ EPSG_WGS_84 conversion no longer working HOT 6
- Can not convert from epsg:7415 to epsg:4979 HOT 2
- Retrieving Coordinate Systems to Display HOT 1
- deprecation warning php 8: Optional parameter ... declared before required parameter HOT 4
- Determine Point Type from CRS HOT 1
- Convert WGS 84 Coordinates to DHDN / 3-degree Gauss-Kruger zone 4 HOT 2
- Unable to perform conversion HOT 2
- Irish Grid error with valid coordinates HOT 3
- UnknownConversionException with ETRS89_TM35FIN_N_E HOT 5
- Failure to calculate long distances with vicenty HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpcoord.