472,956 Members | 2,649 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,956 software developers and data experts.

National grid to lat long conversion

Hi,

I have a load of British National Grid references that I want to
convert to decimal degrees so I can create a google KML file. Does
anyone know of a module to do this?

I've looked at http://pygps.org/#LatLongUTMconversion but am not
really up to speed with projections and all this other mapping stuff.

I want to take something like

x = 417512 y = 315098 (SK 17570 15100)

and convert it to a google compatible decimal degrees

lat: 52.733255N Long: -1.741239

Any help would be great

Aug 28 '07 #1
3 8568
I have a load of British National Grid references that I want to
convert to decimal degrees so I can create a google KML file. Does
anyone know of a module to do this?
I should probably have added that you can get a number of the
variables you start off with from :

http://www.ordnancesurvey.co.uk/oswe...s/information/
coordinatesystemsinfo/guidecontents/guidea.html

and

http://www.ordnancesurvey.co.uk/oswe...s/information/
coordinatesystemsinfo/guidecontents/index.html

might be useful to read around the subject. It might look complex,
but don't let it put you off. Also, you can get JavaScript code to
do just this from the URL below, which would be a good starting point.

http://www.movable-type.co.uk/script...g-gridref.html

Regards,
Carl.

Aug 28 '07 #2
I have a load of British National Grid references that I want to
convert to decimal degrees so I can create a google KML file. Does
anyone know of a module to do this?
If there isn't a module available, you could roll your own. The
equations are to be found at :

http://www.ordnancesurvey.co.uk/oswebsite/gps/docs/
convertingcoordinatesEN.pdf

They shouldn't be too hard to Pythonise.

Regards,
Carl.
Aug 28 '07 #3
Hi,

I was a bit limited with time so in the end used an online service
with an API which is great for the limited number of look-ups I
needed. It can be found at:

http://www.nearby.org.uk/

It was also very useful for site for other conversions and lookups.

I manage to find a couple of other examples in other languages which I
might have used as the basis for some pythonification.

PHP
- http://www.megalithia.com/search/llfuncshighlight.php
- http://www.jstott.me.uk/phpcoord/

Javascript
- http://www.movable-type.co.uk/script...g-gridref.html

Cheers

Neil

Sep 12 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: marchab | last post by:
Hallo! I've got a problem with INSERT statment which includes any special (national) character. It ends with SQL0104 error. It's strange because isql utility executes the same statement without...
67
by: Serve La | last post by:
I asked if MS has any plans to support C99 in the next VisualC. This is their answer. I think we should whine more :-) We feel that C++ addresses this space sufficiently. In general we have no...
17
by: Magix | last post by:
Hi, Let say I have following function: long number(void) { long sum = 421; return (sum*sum); }
117
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
3
by: pranab.salian | last post by:
I need to compile some newer code in Borland TC 3.0. Here's the snippet.. /* CODE */ /* // --------------------------------------------------------------- // Shift register implementation:...
3
by: vineetbatta | last post by:
I have Custom Data class which stores data about single customer and then i store that customer objects in arraylist as shown below. Customer custdata = null; // Custom Data class for 1 customer...
6
by: CFAN | last post by:
Here is a example of double-type-conversion char * __cdecl _itoa ( int val, char *buf, int radix ) { if (radix == 10 && val < 0) xtoa((unsigned long)val, buf, radix, 1); else
11
by: Steven Woody | last post by:
long i = nnn; long j; double d; d = i; j = ( long )d; in this case, i == j ? thanks.
8
by: d major | last post by:
I was very puzzled about the conversion between float and long, I cann't understand why a long val can convert to a float, as the below codes show: typedef unsigned long u_long; float val =...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.