473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 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 8579
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.