Difference between revisions of "Template:GBfromIEgrid"

From Wikishire
Jump to: navigation, search
 
Line 1: Line 1:
 
{{#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}}}}}
 
{{#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={{#ifeq:{{#len:{{#var:e}}}}|5|0}}{{#vare:e}}
+
|E={{#ifeq:{{#len:{{#var:e}}}}|5|0}}{{#var:e}}
|N={{#ifeq:{{#len:{{#var:n}}}}|5|0}}{{#vare:n}}
+
|N={{#ifeq:{{#len:{{#var:n}}}}|5|0}}{{#var: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>

Latest revision as of 22:30, 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}}.