Batch converting os...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

Batch converting os grid red to w3w.

28 Posts
12 Users
3 Reactions
500 Views
Posts: 1617
Full Member
Topic starter
 

Maybe a moon on a stick or having my cake and eating it, but is there any free means of converting a few thousand grid references into w3w addresses in one column and nearest postal town in another, ideally free as it's probably not an operation I'll repeat

It's all in a spreadsheet incorporating other data. 


 
Posted : 27/10/2025 6:28 pm
Posts: 981
Free Member
 

https://accounts.what3words.com/select-plan


 
Posted : 27/10/2025 6:57 pm
Posts: 12507
Free Member
 

You can do it in grid reference finder batch converter. I think.

Upload it and view on map and i think you can then export points and that SHOULD have w3w

 


 
Posted : 27/10/2025 7:56 pm
jamiemcf reacted
Posts: 3991
Full Member
 

Is be tempted to load it into your AI app of choice and ask it to do it. Be interesting to see how well it handled it.


 
Posted : 27/10/2025 10:31 pm
Posts: 1617
Full Member
Topic starter
 

It didn't. Co pilot gave me 

Word1.word2.word3 and nearest postal town over a few thousand lines..... 

Maybe I need to get better with my requests 


 
Posted : 27/10/2025 10:47 pm
Posts: 1617
Full Member
Topic starter
 

Josh, 

I didn't think grid reference finder converted to w3w. I'll try uploading to a map then reexporting it. 

I could pay w3w but I'm hoping it's a one time affair. 

 


 
Posted : 27/10/2025 10:50 pm
Posts: 826
Full Member
 

It's trivial to write a Python script to do this - I've just done it in 5 mins or so, buuut it needs a w3w basic API access account at £8/month https://accounts.what3words.com/select-plan . I doubt there's any way around using their API as it's their algorithm.


 
Posted : 27/10/2025 11:47 pm
kelvin and jamiemcf reacted
Posts: 12507
Free Member
 

Posted by: jamiemcf

Josh, 

I didn't think grid reference finder converted to w3w. I'll try uploading to a map then reexporting it. 

I could pay w3w but I'm hoping it's a one time affair. 

 

I am fairly sure it used to but i may have imagined that.

Option 2. (I assume its bridge inspection related) Get an apprentice to do it manually. 

 


 
Posted : 28/10/2025 8:35 am
Posts: 1617
Full Member
Topic starter
 

How long would it take me to learn enough python to be able to do the 5minute task. I was hoping there may be a free converter like there is for every other coordinate system. 

I don't see the need for w3w, it's a solution looking for a problem to my mind (I appreciate there will be cases I've not thought about). I'd rather use a grid reference phonetically than w3w. 

Grid reference finder won't output the data with it as far as I can see. Only individual entries.

I don't have any spare trainees that I hate enough to task them. I can slowly work through it as and when I get 10mins. There's no rush for it. 

 

Thanks though


 
Posted : 28/10/2025 1:24 pm
Posts: 8771
Full Member
 

Posted by: jamiemcf

How long would it take me to learn enough python to be able to do the 5minute task

Depends how familiar with coding you are already. If you're already familiar with a general purpose procedural language or two then it won't be too difficult. Just a matter of learning the subtle differences of syntax, how indentation dictates code blocks (instead of curly braces for example), and then finding out which libraries to use.

 


 
Posted : 28/10/2025 1:50 pm
Posts: 8306
Free Member
 

Posted by: jamiemcf

I don't see the need for w3w, it's a solution looking for a problem to my mind

I agree. 

You get 1 letter wrong and it could be absolutely miles out.

w3w's also change over time.

A 6 figure grid reference put's you within 100m, which is accurate enough to locate someone in an emergency.

 

Why do you want to do this?

 


 
Posted : 28/10/2025 2:41 pm
Posts: 1617
Full Member
Topic starter
 

Last time I tried to code I waited until one afternoon my mum wasn't watching telly, I dug out the magazine my grandad gave and plugged in the zx spectrum. 

It wasn't a positive experience. 🤣 🤣 

 


 
Posted : 28/10/2025 2:54 pm
Posts: 981
Free Member
 

claude or chatGPT will mostly like 1 shot a python script for you


 
Posted : 28/10/2025 3:07 pm
 Aidy
Posts: 2941
Free Member
 

Posted by: jamiemcf
I don't see the need for w3w, it's a solution looking for a problem to my mind (I appreciate there will be cases I've not thought about). I'd rather use a grid reference phonetically than w3w. 

Well .. you're the one that asked for it...

But yeah, I've never seen any value in w3w. Phonetics aren't even a problem for OS grid refs. For non-UK locations, I reckon plus codes are a much better solution than w3w.


 
Posted : 28/10/2025 3:11 pm
Posts: 12507
Free Member
 

Hang on. Of this is NR related do they not already have it?

I am right there with you on w3w what-three(misheard)-words

Compared to reeling off a number of 10 distinct and well understood digits.

You could just make some up.

S****y//s****//mel****er 


 
Posted : 28/10/2025 4:08 pm
Posts: 12507
Free Member
 

By the way. You don't need python i don't think.

Just chuck the api into qgis and calculate the field for the shapefile you have.

 


 
Posted : 28/10/2025 4:15 pm
Posts: 826
Full Member
 

Oh, you definitely don't *need* python, I just know it.

Anyway, untested as I'm not buying API access, you'll need to install OSGridConverter and what3words (typically pip install <package>).

then for a csv file that looks something like: (there are python modules that can read/write xls, but here's a csv)

one,two,TG 51408 13177,four
one,two,TG 51407 13177,four
one,two,TG 51406 13177,four
one,two,TG 51405 13177,four

and a script like my 5 min one, which I stopped when I found I had to pay (which wasn't that clear from some of their examples):

from OSGridConverter import grid2latlong
import what3words
import csv

w3w_api_key='XXXXX'
w3w = what3words.Geocoder(w3w_api_key)

with open('os.csv') as csvfile:
    osreader = csv.reader(csvfile, delimiter=',')
    for row in osreader:
      l=grid2latlong(row[2])
      res = w3w.convert_to_3wa(what3words.Coordinates(l.latitude,l.longitude))
      print(row[2],l,res)

will give you this. Which obviously needs a valid API key, when you should get something back that makes sense. If you can find anyone with the most basic python knowledge they'll be able to hack something up for you no doubt. They'll need to look at something like this to do the town part https://medium.com/@arpit23sh/discover-nearby-places-with-python-a-geolocation-adventure-770ecc78f13 f

TG 51408 13177 +52.65798:+1.72008 {'error': {'code': 'InvalidKey', 'message': 'Authentication failed; invalid API key'}}
TG 51407 13177 +52.65798:+1.72006 {'error': {'code': 'InvalidKey', 'message': 'Authentication failed; invalid API key'}}
TG 51406 13177 +52.65798:+1.72005 {'error': {'code': 'InvalidKey', 'message': 'Authentication failed; invalid API key'}}
TG 51405 13177 +52.65798:+1.72003 {'error': {'code': 'InvalidKey', 'message': 'Authentication failed; invalid API key'}}


 
Posted : 28/10/2025 4:51 pm
Posts: 1617
Full Member
Topic starter
 

It is for NR assets, but for creating our task briefs and a planning resource of points. I've already got OS, lat and long, post code and signal box and eco for the whole of Scotland so that our paperwork is easier and quicker to produce. 

I'll have a poke around a QGIS, 


 
Posted : 28/10/2025 4:55 pm
Posts: 2435
Full Member
 

Posted by: gobuchul

Posted by: jamiemcf

I don't see the need for w3w, it's a solution looking for a problem to my mind

I agree. 

You get 1 letter wrong and it could be absolutely miles out.

w3w's also change over time.

A 6 figure grid reference put's you within 100m, which is accurate enough to locate someone in an emergency.

 

 

Somehow it's been forced in as a non solution that creates problems in an emergency.  I've experienced it from both sides now - once we were calling for an ambulance and they insisted on W3W but there was no signal, someone had to walk to a better data signal, download the app, walk back to the casualty, get the W3W, get back to where there was phone signal.

The other time I found two ambulances in a car park unable to find the casualties who'd given them W3W locations because there was no data signal at the car park. We worked out where the casualty was based on descrition and sent them there.

OS grid reference is free to use and you can get a reading without data.  As does international grid ref standards

 

I did find a use for w3w at a festival to find someone's tent - where you actually did need 3m grid accuracy and a pointer in an app to take you there.  Of course it only worked on the day we arrived as the rest of the weekend wasn't enough data to use it....

 

 


 
Posted : 28/10/2025 5:09 pm
Posts: 1617
Full Member
Topic starter
 

All the examples of w3w failures are just convincing me I'm wasting my time. Unfortunately the powers above me deem it required. 


 
Posted : 28/10/2025 6:39 pm
Posts: 12507
Free Member
 

Aye

https://developer.what3words.com/tools/gis-extensions/qgis#using-the-plugin

Look for the geoprocessing toolbox. 

I'm assuming you use QGIS, you'll have the whole network in minutes.


 
Posted : 28/10/2025 8:40 pm
Posts: 10315
Full Member
 

Even with qgis you need to pay for the API as far as I can see and the 9eur/month won't cut it as that only allows 1000 conversions, I think you need the next level up for a month.  No need to program either as they also appear to offer an excel add in but I'm not sure that will convert OS references


 
Posted : 28/10/2025 9:15 pm
Posts: 12507
Free Member
 

Even with qgis you need to pay for the API

Yeah i wasn't suggesting it was free, just that as qgis is used in abundance in our industry it might be a simpler job. I did miss the limit though. Conpared to doing it manually its a tiny cost.

I can't remember who jamiemcf works for but someone will be able to do it in their sleep.


 
Posted : 29/10/2025 7:31 am
Posts: 1617
Full Member
Topic starter
 

We don't have a gis facility in house. I'll be able to figure it out though. 

I tried manual converting and frantically copying and pasting got me 2% complete in half an hour. 

I'm on leave today so this is a Thursday issue.


 
Posted : 29/10/2025 8:38 am
Posts: 822
Free Member
 

the 9eur/month won't cut it as that only allows 1000 conversions

That's not correct - it allows unlimited conversions to w3w. Limit is the other way.


 
Posted : 29/10/2025 9:20 am
Posts: 12507
Free Member
 

We don't have a gis facility in house. I'll be able to figure it out though. 

*Shocked face*

Its pretty easy. You should find a number of things useful in it for your task brief. Setting up automatic map creation for all your structures. List attach the nearest a&e, level crossings, parking locations, etc.

Not to mention mapping photos etc.


 
Posted : 29/10/2025 10:41 am
Posts: 1617
Full Member
Topic starter
 

Why do you think I'm here asking these questions. 

I have a Google my maps doc that my team uses and is a great planning aid, but I'm always keen to improve it. Maybe I need to invest in a distance learning gis course that I should have done 22 years ago. 


 
Posted : 29/10/2025 2:42 pm
Posts: 3091
Full Member
 

Yeah I'll also throw shade at w3w for all the reasons above.

Plus, it's proprietary (for them to make money obvs) which obviously puts single point of failure reliance on them / ability to access their services. Which quite frankly is ****ing ridiculous for anything safety critical like emergency services to be saying they need it. 🙄 Clearly not thought through.

 

Anyway it's a great excuse to suggest this as an alternative again 👍

https://www.fourkingmaps.co.uk/

 

Understand this isn't helping you solve the problem though...my apologies 

 

 


 
Posted : 29/10/2025 4:37 pm

6 DAYS LEFT
We are currently at 95% of our target!