1

How do I convert UK OS NGR coordinates to lat/long using ogr2ogr?

I've read through the ogr2ogr page, but I can't see anything obvious on how to do it

I've used the FME trial and it was as simple as setting the target to WSG84

I've read Convert UK OS grid coordinates to decimal degree WGS84? but this uses a 3rd party tool, NGConv.exe

3

Something like:

ogr2ogr -f XXX -s_srs epsg:27700 -t_srs epsg:4326 out.xxx in.shp

The ogr2ogr manual page explains all the options.

3
  • ERROR 1: Unable to find driver `XXX'. that manual isnt clear at all. Nowhere does it mention grids – Luffydude Jan 9 '20 at 12:03
  • XXX is a placeholder for you to fill in with the format of your input file – Ian Turton Jan 9 '20 at 12:07
  • Alright now it did something, it created a new file on the directory xxx. Problem is that the file is now 20mb bigger but otherwise has no differences from the previous file. The expected outcome would be to have the new lat lon columns but the table structure is exactly the same? I dont know what this did – Luffydude Jan 9 '20 at 12:21
1

If you have National Grid coordinates with trailing letters, you can not use these in ogr2ogr. The ngconverter linked in the other answer will be the best solution. It will output coordinates in EPSG:27700.

If you have numerical coordinates, EPSG:27700 will work in ogr2ogr, as pointed out by @iant.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.