And those coordinates are clearly wrong for Belfast if you check against Ordnance Survey National Grid - Wikipedia . It may be as simple as a typo in the first digit for easting.
I’m talking about the OS coordinates from the site linked by @jling.
Both you and and the OP show, easting is too far east for Belfast. From the grid squares on the wiki page, you can see that Belfast is not near as far east as 335812, and 135812 would appear closer to its location. But the poster above did the calculation to show that 148375 is the correct value, so the my simple typo hypothesis is incorrect.
It seems my original question is based on a mistaken assumption.
The coordinates I obtained from Google are correct, but they are not on the British National Grid.
It seems that the ONS publishes data for the whole of the UK (including Northern Ireland) using British National Grid coordinates. On the other hand, NIRSA, the devolved statistics agency for Northern Ireland, uses the Irish grid, which covers the whole of Ireland. The two grids are different.
If I make a map of NI administrative boundaries using data from NISRA (e.g. this one), I can plot a point representing these coordinates:
OS Eastings: 335812
OS Northings: 375965
However, if I use a map of UK administrative boundaries using data from ONS (e.g. this one), I must use the coordinates given by the BritishNationalGrid conversion from Google’s Lat, Lon:
As you discovered, @TimG, Google was giving you the Irish Grid coordinates. BritishNationalGrid.jl only does OSGB NG coordinates (and does them correctly), which explains the apparent discrepancy.
The Irish Grid is described by code EPSG:29901, so if you wanted to convert from BNG to ING with Proj.jl (which BritishNationalGrid.jl uses anyway), you could do this:
To do the transformation the other way, just reverse the EPSG codes.
Note, however, that this will not be accurate to more than a few m because the high-accuracy grid of corrections used in transforming to/from BNG is only valid over part of the island of Ireland.
As an adjunct, I recently upgraded BritishNationalGrid.jl as it is something of a septuagenarian of a package that used to rely on Proj4.jl. I took the opportunity to use a recent Proj.jl (and therefore proj), and now transforming to/from BNG coordinates is much easier.
However, BritishNationalGrid.jl does do one thing for you—it bundles an artifact containing the grid file used in the BNG ↔︎ ETRS (European) ↔︎ WGS84 conversion which is not included in a normal Proj install. This makes transformations quicker and does not require an internet connection, which otherwise is necessary. (I found this out from this issue.)
To note, the BGS converter does a simpler conversion which will differ from the latest conversion (as done by Proj with the correct EPSG codes) by up to a few m. BritishNationalGrid.jl used also to use this method, but no longer does and now BritishNationalGrid.jl will agree with the OSGB’s webapps as mentioned above.
I’m curious with this. Does it mean that it (downloads?) uses a grid shift for this operation?
The GMT.jl functions also use proj (the wrap GDAL funs that wrap PROJ) and I get a slight different result, whose difference could be explained by that (I’m not using grid shifts for this).
I should say that I’m not a geodesy expert, and so at this point my knowledge stops. As far as I know, yes, EPSG:29903 is for all Ireland using the Irish Grid.
Some information about how the calculations are done now versus pre-2016 is in this is in this article and the OSGB’s developer notes which accompanied the release of the new grids in 2016.
The article I linked to above shows the region where the OSTN15 grid which does the transformation is valid; it basically stops at the western tip of Northern Ireland. Away from that, (i.e., in Ireland), a polynomial mapping is done instead. This really is at the limit of my understanding, but I believe that if that is done, then you are back to the ~3 m accuracy of the old approach. So I think the answer is ‘yes and no’.
I will finish off by saying that there are other members of the community who are far more knowledgable about this topic, so I invite them to chime in if need be.
Yes—as a non-expert I only realised that newer versions of Proj (and indeed the OSGB) were using a grid-based approach when my conversions stopped working with the error hgridshift: could not find required grid(s), and I found this Proj.jl issue. It could well be the cause of the difference you see.