Difference between revisions of "Template:GeoTemplate/doc"

From blackwiki
Jump to navigation Jump to search
imported>Dispenser
(Reverted 1 edit by Obsuser (talk): Old links work again. (TW))
imported>Pppery
(Toolserver is defunct)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Documentation subpage}}
+
{{soft redirect|mw:GeoHack}}
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
 
 
 
The [[{{FULLBASEPAGENAME}}|{{BASEPAGENAME}}]] can be invoked by using {{Tl|Coord}}. An external tool fills the template with the coordinates data as described on this page.
 
 
 
==Parameters==
 
GeoHack (the tool that fills {{BASEPAGENAME}} with working links) takes two inputs:
 
* URL parameters: Coordinates are given in one of the following formats: D_M_S_N_D_M_S_E,  D_M_N_D_M_E,  D_N_D_E, or  D;D where D is degrees, M is minutes, S is seconds, and NS/EW are the directions. They can be followed by {{anchor|type}}[[Wikipedia:WikiProject Geographical coordinates#Parameters|coordinate parameters]] such as type, scale and region, separated by underscores. On Wikipedia the URL is generated by [[Wikipedia:WikiProject Geographical coordinates#Geo tag|coordinate templates]].<br />For example, the wikitext <code><nowiki>{{coord|51|28|40|N|0|0|6|W|type:landmark_scale:2000_region:GB}}</nowiki></code> becomes <code>params=51_28_40_N_0_0_6_W_type:landmark_scale:2000_region:GB</code> in the URL.
 
* The template page (contents of {{BASEPAGENAME}}) where variables are replaced with values computed from the data given in the URL. The rest of this page documents the available variables.
 
 
 
===Position===
 
GeoHack provides the following variables based on the given coordinates (<tt>51_28_40_N_0_0_6_W</tt> in the example above).
 
 
 
*Latitude/longitude
 
** <tt>{latdegabs}, {londegabs}</tt> - [[World Geodetic System|WGS84]] Absolute integer degrees
 
** <tt>{latdegdec}, {londegdec}, {londegneg}</tt> - [[World Geodetic System|WGS84]] Total decimal degrees
 
** <tt>{latdegdecabs}, {londegdecabs}, {londegneg}</tt> - [[World Geodetic System|WGS84]] Absolute decimal degrees
 
** <tt>{latdegint}, {londegint}</tt> - [[World Geodetic System|WGS84]] Floored integer degrees
 
** <tt>{latdeground}, {londeground}</tt> - [[World Geodetic System|WGS84]] Rounded integer degrees
 
** <tt>{latmindec}, {lonmindec}</tt> - [[World Geodetic System|WGS84]] Decimal minutes
 
** <tt>{latminint}, {lonminint}</tt> - [[World Geodetic System|WGS84]] Integer minutes
 
** <tt>{latNS}, {lonEW}        </tt> - [[World Geodetic System|WGS84]] Direction of absolute integer degrees
 
** <tt>{latsecdec}, {lonsecdec}</tt> - [[World Geodetic System|WGS84]] Decimal seconds
 
** <tt>{latsecint}, {lonsecint}</tt> - [[World Geodetic System|WGS84]] Integer seconds
 
** <tt>{latantipodes},  {longantipodes}</tt> - Antipodes of <tt>{latdegdec}, {londegdec}</tt>
 
 
 
*UTM
 
** <tt>{utmnorthing} {utmeasting} {utmzone}</tt> - [[Universal Transverse Mercator coordinate system|UTM coordinate]]
 
** <tt>{utm33northing},  {utm33easting}</tt> -
 
 
 
*National grids
 
** <tt>{ch1903easting}, {ch1903northing}</tt> - [[Swiss coordinate system|CH1903+ coordinate]]
 
** <tt>{osgb36ref}</tt> - [[British national grid reference system|Ordnance Survey Grid reference]]
 
** <tt>{osgb36northing}, {osgb36easting}</tt> -
 
** <tt>{nztmeasting}, {nztmnorthing}</tt> - New Zealand Transverse Mercator coordinate (not active?)
 
 
 
Other national grids are supported through specific tools: Finland ([[tools:~para/kkj.php]]), Tokyo datum ([[tools:~para/cgi-bin/wgs2tky]])
 
 
 
===Scaling===
 
GeoHack accepts a '''scale''' parameter (<tt>scale:2000</tt> in the example above) which it uses to provide scaling or zoom values for different mapping services.
 
 
 
{| class="wikitable"
 
! name !! used by !! formula
 
|-
 
| <tt>{scale}</tt>
 
| [http://www.virtual-globe.info/ Virtual Globe]
 
| supplied in URL via '''scale''' or calculated based on '''type'''
 
|-
 
| <tt>{mmscale}</tt>
 
| [http://www.multimap.com/ Multimap]
 
| closest scale value accepted by Multimap (see [https://fisheye.toolserver.org/browse/geohack/www/mapsources.php mapsources.php])
 
|-
 
| <tt>{span}</tt>
 
| [http://maps.google.com/ Google Maps], [http://www.wikimapia.org/ WikiMapia]
 
| <tt>scale / 1000000</tt>
 
|-
 
| <tt>{altitude}</tt>
 
| [http://maps.msn.com/ MSN Maps], [http://www.fourmilab.ch/ Fourmilab], [http://swissinfo.org/ Swissinfo]
 
| <tt>integer( scale * 143 / 1000000)</tt>
 
|-
 
| <tt>{zoom}</tt>
 
| [http://www.mapquest.com/ MapQuest], [http://www.gulesider.no/ Gule Sider]
 
| <tt>integer(18.0 - log(scale))</tt>
 
|-
 
| <tt>{osmzoom}</tt>
 
| [http://www.openstreetmap.org/ OpenStreetMap], [http://maps.live.com/ Live Search Maps]
 
| <tt>18 - ( round(log( scale ,2) - log(1693,2)) )</tt>
 
|}
 
 
 
GeoHack accepts a '''type''' parameter (<tt>type:landmark</tt> in the example above) from which it will calculate a '''scale''' value when none is supplied. The following chart shows the types currently understood by GeoHack, the scale ratio associated with each, plus the additional variables calculated by GeoHack.
 
 
 
{| class="wikitable"
 
! [[#type|{type}]]
 
! ratio
 
! {scale}
 
! {mmscale}
 
! {span}
 
! {altitude}
 
! {zoom}
 
! {osmzoom}
 
|-
 
! country
 
| 1 : 10,000,000
 
| 10000000
 
| 10000000
 
| 10.0
 
| 1430
 
| 1
 
| 5
 
|-
 
! state
 
| 1 : 3,000,000
 
| 3000000
 
| 4000000
 
| 3.0
 
| 429
 
| 3
 
| 7
 
|-
 
! adm1st
 
| 1 : 1,000,000
 
| 1000000
 
| 1000000
 
| 1.0
 
| 143
 
| 4
 
| 9
 
|-
 
! adm2nd (''default'')
 
| 1 : 300,000
 
| 300000
 
| 200000
 
| 0.3
 
| 42
 
| 5
 
| 11
 
|-
 
! city, mountain, isle,<br /> river, waterbody
 
| 1 : 100,000
 
| 100000
 
| 100000
 
| 0.1
 
| 14
 
| 6
 
| 12
 
|-
 
! forest, glacier
 
| 1 : 50,000
 
| 50000
 
| 50000
 
| 0.05
 
| 7
 
| 7
 
| 13
 
|-
 
! airport
 
| 1 : 30,000
 
| 30000
 
| 25000
 
| 0.03
 
| 4
 
| 7
 
| 14
 
|-
 
! edu, pass, landmark, railwaystation
 
| 1 : 10,000
 
| 10000
 
| 10000
 
| 0.01
 
| 1
 
| 8
 
| 15
 
|}
 
 
 
The default values can for each '''type''' can be overridden by also supplying a '''scale'''. For example, <code>type:airport</code> is assigned a {scale} of 30000, while <code>type:airport_scale:10000</code> uses the supplied {scale} of 10000.
 
 
 
For detailed implementation see [httphttps://fisheye.toolserver.org/browse/geohack/www/mapsources.php mapsources.php]
 
 
 
===Miscellaneous===
 
* <tt>{region}, {globe}, {page}</tt> -  Look up page from Wikipedia.  See if we have something in [[Wikipedia:Map sources]] or equivalent. A subpage can be specified
 
* <tt>{pagename}</tt> - The value from the pagename key in the query (e.g. &pagename=Article) ([[URI scheme#Generic syntax]]) - [[Help:Variable#Depending on page|FULLPAGENAMEE]] expected.  When used with {{Tl|Coord}} this returns the containing article name with whitespace replaced by underscores.  For example: [[Bellevue Botanical Garden]] becomes Bellevue_Botanical_Garden.
 
* <tt>{title}</tt> - The value from the title key in the query (e.g. &title=Name). If not given in the query, is the same as <tt>{pagename}</tt>. 
 
[[Category:WikiProject Geographical coordinates]]
 
 
 
== Section coding ==
 
 
 
When the parameters contain a region or GeoHack finds the region with the coordinates, a matching section is moved to the location marked with the placeholder:
 
 
 
<source lang="HTML4strict"><div id="GEOTEMPLATE-LOCAL"  ></div></source>
 
 
 
The region sections are wrapped in an element where the XX of the id is the [[ISO 3166-1 alpha-2]] code:
 
 
 
<source lang="HTML4strict"><div id="GEOTEMPLATE-XX">
 
...
 
</div></source>
 

Latest revision as of 17:40, 23 February 2019

Soft redirect to:mw:GeoHack
This page is a soft redirect.