Using Our Tile Server's Irish Tiles

The Three Grid Systems

Our tile server at tiles.the-hug.net serves you tiles for your mapping application in the Ordnance Survey's OSGB 1936 British National Grid projection, otherwise know as EPSG:27700. This projection uses eastings and northings rather than longitude and latitude on a rectangular grid with the 0,0 point, the "origin", lying off the Scilly Isles. For display purposes grid references are expressed as two letters followed by 4-10 digits.

This grid is used for Great Britain and the Isle of Man. Ireland, both north and south, also use a grid system, which is very similar to EPSG:27000 but has an origin more suited for the country.

Historically they used the Irish grid reference system or EPSG:29902 which uses a similar scheme to OSGB but with a single letter for each 100km square rather than two however at the start of this millennium they started to move over to the Irish Transverse Mercator (ITM) or EPSG:2157 which uses yet another origin and purely numeric grid reference for display purposes.

How our Irish Tiles are Projected

When we came to add map tiles for Ireland to our map server then given this issue of three grid projections we were presented with a problem: what projection did we use? In the end we decided to simply extend the Ordnance Survey grid westward, so that most parts of Ireland have a negative easting.

What This Means for You

In practice this is less of a problem that you might think at first glance. Your back end mapping software, be in OpenLayers or Leaflet, really doesn't know or care so long as you tell it that the bounds covers Ireland it will show tiles from there.

If you use OpenLayers then we have updated our the JavaScript file https://tiles.the-hug.net/OSLayer.js to support this extended grid bounds.

For Leaflet then nothing has changed so just proceed as before.

What may need to do, if your application displays positions or moves location depending on position, is to translate to and from EPSG:29902 or EPSG:2157 to EPSG:27000. So if, for example, you solicit an Irish location in ITM from a user you would translate that from EPSG:2157 to EPSG:27000 before asking your back end mapping software to display the location.

The JavaScript library Proj4js makes this translation very easy to do.

When going the other way, where you are displaying a position and want to display it using the correct grid then you first need to decide whether it's in Ireland or Great Britain. Here's the code fragment we use:

if ( ( easting < 100000 && northing < 640000 && northing > 230000 ) || ( easting < 150000 && northing < 630000 && northing > 460000 ) || ( easting < 180000 && northing < 580000 && northing > 480000 ) || ( easting < 140000 && northing < 460000 && northing > 190000 ) )

If that evaluates to true then you're in Ireland so then you just need to decide what Irish grid you want to display the position in and translate as appropriate using Proj4js.