Difference between revisions of "Template:CoordinatesTest"
From Geohashing
imported>Ahecht |
imported>Ahecht |
||
Line 1: | Line 1: | ||
<includeonly>{{#vardefine: date|{{#time:Y-m-d|{{{1}}} }} }} {{#ifexpr: {{{30w|0}}} = 1 | <includeonly>{{#vardefine: date|{{#time:Y-m-d|{{{1}}} }} }} {{#ifexpr: {{{30w|0}}} = 1 | ||
− | | {{#expr: (({{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}} -1 day}}|{{#time: m|{{#var:date}} -1 day}}|{{#time: d|{{#var:date}} -1 day}}}} |1|1}} round 7)+{{{lat}}})*{{#ifeq: {{{latsign}}}|S|-1|1}}}}, {{#expr: (({{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}} -1 day}}|{{#time: m|{{#var:date}} -1 day}}|{{#time: d|{{#var:date}} -1 day}}}} |2|1}} round 7)+{{{long}}})*{{#ifeq: {{{longsign}}}|W|-1|1}}}} | + | | {{#expr: (({{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}} -1 day}}|{{#time: m|{{#var:date}} -1 day}}|{{#time: d|{{#var:date}} -1 day}}}} |1|1}} round 7)+{{{lat|0}}})*{{#ifeq: {{{latsign}}}|S|-1|1}}}}, {{#expr: (({{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}} -1 day}}|{{#time: m|{{#var:date}} -1 day}}|{{#time: d|{{#var:date}} -1 day}}}} |2|1}} round 7)+{{{long|0}}})*{{#ifeq: {{{longsign}}}|W|-1|1}}}} |
− | | {{#expr: (({{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}}}}|{{#time: m|{{#var:date}}}}|{{#time: d|{{#var:date}}}}}} |1|1}} round 7)+{{{lat}}})*{{#ifeq: {{{latsign}}}|S|-1|1}}}}, {{#expr: (({{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}}}}|{{#time: m|{{#var:date}}}}|{{#time: d|{{#var:date}}}}}} |2|1}} round 7)+{{{long}}})*{{#ifeq: {{{longsign}}}|W|-1|1}}}} | + | | {{#expr: (({{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}}}}|{{#time: m|{{#var:date}}}}|{{#time: d|{{#var:date}}}}}} |1|1}} round 7)+{{{lat|0}}})*{{#ifeq: {{{latsign}}}|S|-1|1}}}}, {{#expr: (({{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}}}}|{{#time: m|{{#var:date}}}}|{{#time: d|{{#var:date}}}}}} |2|1}} round 7)+{{{long|0}}})*{{#ifeq: {{{longsign}}}|W|-1|1}}}} |
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
== Usage == | == Usage == |
Revision as of 15:01, 2 July 2008
Usage
{{coordinates}}
gives coordinate fractions out to seven decimal places. Must be passed a date in YYYY-MM-DD format.
{{coordinates|2008-06-24}}
gives non-adjusted coordinates for Tuesday 24 June 2008.{{coordinates|2008-06-24|30w=1}}
gives 30W-adjusted coordinates for the same day.{{coordinates|2008-06-24|lat=42|latsign=N|long=71|longsign=W}}
gives coordinates for the 42, -71 graticule for the same day. Note that this does not automatically detect 30W conditions -- you still must use the 30w parameter.
Note: Currently applies 30W incorrectly to dates prior to 2008-05-27; fixing soon. --Tim P 02:44, 2 July 2008 (UTC)