Sunday, 6 September 2015

mysql - Convert Ordnance Survery (GB) Easting/Northing data to WGS84 lat/long


This is my first venture into GIS datasets. I've decided to start a little project which will eventually hook into the Google Maps api to overlay/plot/pin from data in my database.


I've started loading different datasets from various sources in a MySQL database. In particlar, I'm working with Ordnance Survey data which appears to be accurate enough for what I'd like to achieve. However, the X/Y co-ordinates in my dataset are Ordnance Survey (GB) Easting and Northing.


Ordnance Survey provide a very useful conversion spreadsheet (https://www.ordnancesurvey.co.uk/docs/support/projection-and-transformation-calculations.xls) to convert between different datums (is that the correct term? or it Projections?) and I've attempted to reverse engineer the formulae in the spreadsheet so I can manually do these calculations. I totally failed at this bit.


In an ideal world, I'd like a simple calculation which can be dumped straight into a (My)SQL statement which will run through the dataset held in my table, populating additionals column for both latitude and longtitude with the converted values (in WGS84) of both easting and northing co-ordinates.


Can this be achieved using pure SQL? (i.e. What is the underlying maths etc that can be transposed into a SQL statement).



Note: This question seems to have been asked a couple of times but the solution seems to be to employ the use of an external coding language such as ASP, PHP, JS etc. I don't really have much front end coding experience - I'm a database administrator so I'm more familiar with SQL. I'm also pre-empting that someone will ask what front end language I will eventually be using for my project as surely I must know at least a little bit in one or most of the web dev languages. To answer that: I'll be developing the application in "Oracle APEX" (using ODBC link from Oracle to MySQL) which is essentially pure PL/SQL, no web coding experience required.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...