Content deleted Content added
brief usage, license |
→Usage: swap |
||
(15 intermediate revisions by 3 users not shown) | |||
Line 1:
{{high use}}
{{
{{Lua|Module:Arguments|Module:Yesno|Module:If preview}}
== Usage ==
Converts a OS grid ref to a lat/long hyperlink to geohack.
:<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|main|SK135733<nowiki>}}</nowiki></code> ← Two-letter code interpreted as OS grid ref in Great Britain
:<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|main|O169318<nowiki>}}</nowiki></code> ← One-letter code interpreted as Irish OS grid ref
:<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|main|439668_1175316<nowiki>}}</nowiki></code> ← Two digit strings interpreted as easting/northing in meters in Great Britain
:<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|main|i88888_99999<nowiki>}}</nowiki></code> ← String starting with i is easting/northing in meters in Ireland
:<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|main|SK135733|Miller's Dale<nowiki>}}</nowiki></code> ← Second argument is used as link text
:<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|main|SK135733_scale:25000_region:GB-DBY<nowiki>}}</nowiki></code> ← extra underscored parameters passed to geohack
* The <code>oscoord</code> function returns the link wrapped in a span.
* The {{para|rawurl}} returns the simple URL, not a link.
* Template that wraps main is available at {{tl|Ordnance Survey url}}.
* For other template wrapping, see [[Template:Gbmapping/doc]]
Also converts from lat/long back to OS grid ref:
:<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|WGS2OSGB|53.256538|-1.799102<nowiki>}}</nowiki></code> → SK1350073300
:<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|LL2OS|53.256538|-1.799102<nowiki>}}</nowiki></code> → {{OS coord|SK1350073300}}
:<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|LL2OS|53.256538|-1.799102|scale:25000<nowiki>}}</nowiki></code> → {{OS coord|SK1350073300_scale:25000}}
== License ==
{{GPL-2}}
== Tracking categories ==
*{{clc|Pages with malformed OS coordinates}}
*{{clc|Articles with OS grid coordinates}}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
|