Template:GBfromIEgrid: Difference between revisions

From Wikishire
Jump to navigation Jump to search
RB (talk | contribs)
No edit summary
RB (talk | contribs)
No edit summary
Line 1: Line 1:
{{#switch:{{uc:{{{2}}}}}
{{#vardefine:e|{{#expr:sin(atan({{IeZero|{{{1}}}|E}}/{{IeZero|{{{1}}}|N}}) + 0.0850199433782504) * (sqrt({{IeZero|{{{1}}}|E}}^2 + {{IeZero|{{{1}}}|N}}^2) + 75)+117035 round 0}}}}{{#vardefine:n|{{#expr:cos(atan({{IeZero|{{{1}}}|E}}/{{IeZero|{{{1}}}|N}}) + 0.0850199433782504) * (sqrt({{IeZero|{{{1}}}|E}}^2 + {{IeZero|{{{1}}}|N}}^2) + 75)+391948 round 0}}}}{{#switch:{{uc:{{{2}}}}}
|E={{#expr:sin(atan({{IeZero|{{{1}}}|E}}/{{IeZero|{{{1}}}|N}}) + 0.0850199433782504) * (sqrt({{IeZero|{{{1}}}|E}}^2 + {{IeZero|{{{1}}}|N}}^2) + 75)+117035 round 0}}
|E={{#ifeq:{{#len:{{#var:e}}}}|5|0}}{{#vare:e}}
|N={{#expr:cos(atan({{IeZero|{{{1}}}|E}}/{{IeZero|{{{1}}}|N}}) + 0.0850199433782504) * (sqrt({{IeZero|{{{1}}}|E}}^2 + {{IeZero|{{{1}}}|N}}^2) + 75)+391948 round 0}}
|N={{#ifeq:{{#len:{{#var:n}}}}|5|0}}{{#vare:n}}
|''default yet to be programmed''
|''default yet to be programmed''
}}<noinclude>{{documentation}}
}}<noinclude>{{documentation}}
[[Category:Great Britain map templates]]
[[Category:Great Britain map templates]]
[[Category:Irish map templates]]</noinclude>
[[Category:Irish map templates]]</noinclude>

Revision as of 22:29, 29 February 2020

default yet to be programmed

[edit] [{{#invoke:Purge|main}}] Template documentation

A series of templates can be used to convert grid references in the Great Britain grid or the Irish grid between the standard letter-and-numbers format and the all-numeric format. {{GBfromIEgrid}} converts an Irish grid reference into the eastings and northings of the GB grid reference, roughly. (It is very much a simplified formula and does not provide an exact location because the two grids use projections on different bases, but it should be good enough for the mapping used here.)

The relevant templates are:

  • {{IegridNum}}: converts and Irish grid ref into all numeric format:
    • {{IegridNum|E}} gives the easting
    • {{IegridNum|N}} gives the northing
  • {{GBfromIEgrid}}
  • {{IeZero}}: converts an Irish grid reference to an artificial numeric Easting ({{IeZero|E}}) or Northing ({{IeZero|N}}) on the Irish Grid given a nominal E-N origin (at the centre of the dome of the Customs House in Dublin). This is a halfway-point template, for the purpose only of feeding figures {{GBfromIEgrid}}.