Difference between revisions of "Template:GNIS/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
(update documentation and examples)
imported>Zyxw
(Make documentation for this template only (other templates now have their own documentation), include TemplateData)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
 
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
These templates generate external links to the [[Geographic Names Information System]] (GNIS) published by the [[United States Geological Survey]] (USGS).
 
  
==Template:GNIS==
+
[[Template:GNIS]] generates an external link to a Feature Detail Report from the [[Geographic Names Information System]] (GNIS), published by the [[United States Geological Survey]] (USGS). The link is displayed as "U.S. Geological Survey Geographic Names Information System: ''Name''", where ''Name'' is either the Wikipedia article name (<code><nowiki>{{</nowiki>PAGENAME}}</code>) or an optionally specified name.
[[Template:GNIS]] generates an external link to a GNIS page. The only required parameter is the GNIS Feature ID number (optionally, this parameter can be named <code>id</code>) and the template then uses the article title as the [[anchor text]]:
+
 
 +
== Usage ==
 +
 
 +
The only required parameter is the GNIS Feature ID number (optionally, this parameter can be named <code>id</code>). The template then uses the Wikipedia article name as part of the [[anchor text]].
  
 
  <nowiki>{{</nowiki>GNIS|''ID''}}
 
  <nowiki>{{</nowiki>GNIS|''ID''}}
 
  <nowiki>{{</nowiki>GNIS|id=''ID''}}
 
  <nowiki>{{</nowiki>GNIS|id=''ID''}}
  
To have the link text be other than the article name, use a second parameter (optionally, this can be named <code>name</code>):
+
If desired, a feature name other than the article name can be specified in a second unnamed parameter (optionally, this can be named <code>name</code>). This can be used if the article name contains disambiguation or when the GNIS feature name is different than the article name.
  
 
  <nowiki>{{</nowiki>GNIS|''ID''|''Name''}}
 
  <nowiki>{{</nowiki>GNIS|''ID''|''Name''}}
 
  <nowiki>{{</nowiki>GNIS|id=''ID''|name=''Name''}}
 
  <nowiki>{{</nowiki>GNIS|id=''ID''|name=''Name''}}
  
This can be used when the Wikipedia page name contains disambiguation brackets; for example, at the page: [[Mount Washington (New Hampshire)]], use {{nowrap| <nowiki>{{</nowiki><code>GNIS{{!}}871352{{!}}Mount Washington}}</code>}} to have "{{GNIS|871352| Mount Washington}}" rather than "{{GNIS|871352| Mount Washington (New Hampshire)}}". This is also necessary should you need to add a link to an article about somebody or something other than the linked feature.
+
For GNIS features in Antarctica, add <code>|type=antarid</code>.
 
 
Examples:
 
<nowiki>{{</nowiki>GNIS | 871352 | Mount Washington }}
 
<nowiki>{{</nowiki>GNIS |id= 871352 |name= Mount Washington }}
 
  
Results:
+
<nowiki>{{</nowiki>GNIS|''ID''|type=antarid}}
<br/>{{GNIS | 871352 | Mount Washington }}
+
<nowiki>{{</nowiki>GNIS|id=''ID''|type=antarid}}
<br/>{{GNIS |id= 871352 |name= Mount Washington }}
 
 
 
===Antarctica===
 
For GNIS pages in Antarctica, use the <code>type=antarid</code> parameter and the corresponding Antarctic GNIS Feature ID number:
 
  
 
  <nowiki>{{</nowiki>GNIS|''ID''|''Name''|type=antarid}}
 
  <nowiki>{{</nowiki>GNIS|''ID''|''Name''|type=antarid}}
 
  <nowiki>{{</nowiki>GNIS|id=''ID''|name=''Name''|type=antarid}}
 
  <nowiki>{{</nowiki>GNIS|id=''ID''|name=''Name''|type=antarid}}
  
Examples:
+
== TemplateData ==
<nowiki>{{</nowiki>GNIS | 2828 | Clarke Glacier |type= antarid }}
 
<nowiki>{{</nowiki>GNIS |id=2828 |name= Clarke Glacier |type= antarid }}
 
 
 
Results:
 
<br/>{{GNIS | 2828 | Clarke Glacier |type= antarid }}
 
<br/>{{GNIS |id= 2828 |name= Clarke Glacier |type= antarid }}
 
 
 
==Template:GNIS 2==
 
{{tlx|GNIS 2}} generates a footnote-type link. The only required parameter is the GNIS Feature ID number (optionally, this parameter can be named <code>id</code>):
 
 
 
<nowiki>{{</nowiki>GNIS 2|''ID''}}
 
<nowiki>{{</nowiki>GNIS 2|id=''ID''}}
 
 
 
Examples:
 
<nowiki>{{</nowiki>GNIS 2 | 871352 }}
 
<nowiki>{{</nowiki>GNIS 2 |id= 871352 }}
 
 
 
Results:
 
<br/>{{GNIS 2 | 871352 }}
 
<br/>{{GNIS 2 |id= 871352 }}
 
 
 
If desired, the template can display the feature name as the [[anchor text]], which can be specified in a second unnamed parameter (optionally, this can be named <code>name</code>):
 
 
 
<nowiki>{{</nowiki>GNIS 2|''ID''|''Name''}}
 
<nowiki>{{</nowiki>GNIS 2|id=''ID''|name=''Name''}}
 
 
 
Examples:
 
<nowiki>{{</nowiki>GNIS 2 | 871352 | Mount Washington }}
 
<nowiki>{{</nowiki>GNIS 2 |id= 871352 |name= Mount Washington }}
 
 
 
Results:
 
<br/>{{GNIS 2 | 871352 | Mount Washington }}
 
<br/>{{GNIS 2 |id= 871352 |name= Mount Washington }}
 
 
 
===Antarctica===
 
For GNIS pages in Antarctica, use the <code>type=antarid</code> parameter and the corresponding Antarctic GNIS Feature ID number.
 
 
 
Examples:
 
<nowiki>{{</nowiki>GNIS 2 | 2828 |type= antarid }}
 
<nowiki>{{</nowiki>GNIS 2 |id= 2828 |name= Clarke Glacier |type= antarid }}
 
 
 
Results:
 
<br/>{{GNIS 2 | 2828 |type= antarid }}
 
<br/>{{GNIS 2 |id= 2828 |name= Clarke Glacier |type= antarid }}
 
  
==Template:GNIS 3==
+
{{TemplateDataHeader}}
{{tlx|GNIS 3}} generates a bare [[URL]]. The only required parameter is the GNIS Feature ID number (optionally, this parameter can be named <code>id</code>):
+
<templatedata>{
 +
"description": "This template generates an external link to a Feature Detail Report from the Geographic Names Information System (GNIS), published by the United States Geological Survey (USGS). The link is displayed as 'U.S. Geological Survey Geographic Names Information System: Name', where Name is either the Wikipedia article name ({{PAGENAME}}) or an optionally specified name.",
 +
"params": {
 +
  "1": {
 +
    "label": "ID",
 +
    "aliases": ["id"],
 +
    "description": "GNIS Feature ID, a number without leading zeros.",
 +
    "type": "number",
 +
    "default": "",
 +
    "required": true
 +
  },
 +
  "2": {
 +
    "label": "Name",
 +
    "aliases": ["name"],
 +
    "description": "GNIS Feature Name or other descriptive text. If not given it defaults to the Wikipedia article name",
 +
    "type": "number",
 +
    "default": "{{PAGENAME}}",
 +
    "required": false
 +
  },
 +
  "type": {
 +
    "label": "Type",
 +
    "description": "Use the value 'antarid' (type=antarid) for features in Antarctica.",
 +
    "type": "string",
 +
    "default": "",
 +
    "required": false
 +
  }
 +
}}</templatedata>
  
<nowiki>{{</nowiki>GNIS 3|''ID''}}
+
== Instructions ==
<nowiki>{{</nowiki>GNIS 3|id=''ID''}}
 
  
Examples:
+
# Go to the [http://geonames.usgs.gov/apex/f?p=gnispq GNIS Feature Search] page.
<nowiki>{{</nowiki>GNIS 3 | 871352 }}
+
# Search for the name, location, and/or class of the feature desired, e.g., to find a mountain called 'Mt. Foo', type '<code>mount foo</code>' in the Feature Name box and select 'Summit' from the Feature Class list.
<nowiki>{{</nowiki>GNIS 3 |id= 871352 }}
+
# Copy the 'ID' number for the desired feature and insert it into the <code><nowiki>{{</nowiki>GNIS|...}}</code> template.
 +
# The latitude and longitude can also be copied and used in the {{tlx|coord}} template, inserting the '{{para}}' vertical bar between degrees, minutes, seconds, and direction, e.g.: 441613N&nbsp;&nbsp;0711812W → <code><nowiki>{{</nowiki>coord|44|16|13|N|071|18|12|W|region:US}}</code>
  
Results:
+
== Examples ==
<br/>{{GNIS 3 | 871352 }}
 
<br/>{{GNIS 3 |id= 871352 }}
 
  
===Antarctica===
+
URL: http://geonames.usgs.gov/apex/f?p=gnispq:3:::NO::P3_FID:871352
For GNIS pages in Antarctica, use the <code>type=antarid</code> parameter and the corresponding Antarctic GNIS Feature ID number.
+
* ''Usage:'' <code><nowiki>{{</nowiki>GNIS | 871352 | Mount Washington }}</code>
 +
** ''Result:'' {{GNIS | 871352 | Mount Washington }}
 +
* ''Usage:'' <code><nowiki>{{</nowiki>GNIS |id= 871352 |name= Mount Washington }}</code>
 +
** ''Result:'' {{GNIS |id= 871352 |name= Mount Washington }}
  
Examples:
+
URL: http://geonames.usgs.gov/apex/f?p=gnispq:5:::NO::P5_ANTAR_ID:2828
<nowiki>{{</nowiki>GNIS 3 |type= antarid | 9763 }}
+
* ''Usage:'' <code><nowiki>{{</nowiki>GNIS | 2828 | Clarke Glacier |type= antarid }}</code>
<nowiki>{{</nowiki>GNIS 3 |type= antarid |id= 9763 }}
+
** ''Result:'' {{GNIS | 2828 | Clarke Glacier |type= antarid }}
 +
* ''Usage:'' <code><nowiki>{{</nowiki>GNIS |id= 2828 |name= Clarke Glacier |type= antarid }}</code>
 +
** ''Result:'' {{GNIS |id= 2828 |name= Clarke Glacier |type= antarid }}
  
Results:
+
== See also ==
<br/>{{GNIS 3 |type= antarid | 9763 }}
 
<br/>{{GNIS 3 |type= antarid | id= 9763 }}
 
  
===Use in a template===
+
Other GNIS templates:
<pre>
+
* [[Template:GNIS 2]] – link with anchor text "[1]" or "''Name''"
{{Cite web
+
* [[Template:GNIS 3]] – link as bare [[URL]] only, without anchor text
| url = {{GNIS 3 | 112837 }}
+
* [[Template:GNIS 4]] – link with GNIS Feature ID number as the anchor text
| title = Wheeler Lake
+
* [[Template:Cite GNIS]] – link using the {{tl|Cite web}} template, for use as a reference
| work = [[Geographic Names Information System]]
 
| publisher = [[United States Geological Survey]]
 
| accessdate = 2009-07-05
 
}}
 
</pre>
 
  
Result:
+
List of pages linking to [[Special:Linksearch/geonames.usgs.gov|geonames.usgs.gov]]:
<br/>{{Cite web
+
* [[Special:Linksearch/geonames.usgs.gov/apex/f?p=gnispq]] (current format)
| url = {{GNIS 3 | 112837 }}
+
* [[Special:Linksearch/geonames.usgs.gov/pls/gnispublic/f?p=gnispq]] (old format)
| title = Wheeler Lake
 
| work = [[Geographic Names Information System]]
 
| publisher = [[United States Geological Survey]]
 
| accessdate = 2009-07-05
 
}}
 
  
==Template:GNIS 4==
+
Similar templates:
{{tlx|GNIS 4}} generates an external link which displays the GNIS Feature ID number. The only required parameter is the GNIS Feature ID number (optionally, this parameter can be named <code>id</code>):
 
 
 
<nowiki>{{</nowiki>GNIS 4|''ID''}}
 
<nowiki>{{</nowiki>GNIS 4|id=''ID''}}
 
 
 
Examples:
 
<nowiki>{{</nowiki>GNIS 4 | 871352 }}
 
<nowiki>{{</nowiki>GNIS 4 | id= 871352 }}
 
 
 
Results:
 
<br/>{{GNIS 4 | 871352 }}
 
<br/>{{GNIS 4 |id= 871352 }}
 
 
 
===Antarctica===
 
For GNIS pages in Antarctica, use the <code>type=antarid</code> parameter and the corresponding Antarctic GNIS Feature ID number.
 
 
 
Examples:
 
<nowiki>{{</nowiki>GNIS 4 | 2828 |type= antarid }}
 
<nowiki>{{</nowiki>GNIS 4 |id= 2828 |type= antarid }}
 
 
 
Results:
 
<br/>{{GNIS 4 | 2828 |type= antarid }}
 
<br/>{{GNIS 4 |id= 2828 |type= antarid }}
 
 
 
==Instructions==
 
# Go to http://geonames.usgs.gov/apex/f?p=gnispq
 
# Search for the name, location, and / or type of the feature desired, e.g., to find a mountain called 'Mt. Foo', put '<code>mount foo</code>' in the Feature Name and select 'Summit' for the Feature Class.
 
# Copy the 'ID' and insert it into <nowiki>{{</nowiki><code>GNIS|...}}</code>, <nowiki>{{</nowiki><code>GNIS 2|...}}</code>, <nowiki>{{</nowiki><code>GNIS 3|...}}</code>, or <nowiki>{{</nowiki><code>GNIS 4|...}}</code>
 
# You can also copy the latitude and longitude and use them in the {{tlx|coord}} template, inserting the '{{para}}' vertical bar in-between, e.g.: 44_16_13_N&nbsp;&nbsp;071_18_12_W → <code><nowiki>{{</nowiki>coord|44|16|13|N|071|18|12|W|region:US}}</code>
 
 
 
==Parameters==
 
{| class="wikitable"
 
! Parameter
 
! Required or Optional
 
! Description
 
|-
 
! {1} {{nobold|or}} id=
 
| Required
 
| GNIS Feature ID, a number without leading zeros
 
|-
 
! {2} {{nobold|or}} name=
 
| Optional
 
| GNIS Feature Name: only in [[Template:GNIS]] (defaults to <nowiki>{{PAGENAME}}</nowiki>) and [[Template:GNIS2]] (no default)
 
|-
 
! type=
 
| Optional
 
| ''antarid'' (for locations in Antarctica)
 
|}
 
 
 
==See also==
 
* [[Special:Linksearch/geonames.usgs.gov]]
 
** [[Special:Linksearch/geonames.usgs.gov/apex/f?p=gnispq]] (current format)
 
** [[Special:Linksearch/geonames.usgs.gov/pls/gnispublic/f?p=gnispq]] (old format)
 
* [[Template:Cite gnis]]
 
 
* [[Template:Mountain index row]]
 
* [[Template:Mountain index row]]
 
* [[Template:Cite cgndb]] (Canada)
 
* [[Template:Cite cgndb]] (Canada)
 
** [[Template:Cite bcgnis]] (British Columbia)
 
** [[Template:Cite bcgnis]] (British Columbia)
 
* [[Template:GPN]] (Gazetteer of Planetary Nomenclature)
 
* [[Template:GPN]] (Gazetteer of Planetary Nomenclature)
 +
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
 
<!-- Categories go here, and interwikis go in Wikidata -->
 
<!-- Categories go here, and interwikis go in Wikidata -->
 
[[Category:U.S. Government external link templates]]
 
[[Category:U.S. Government external link templates]]
 
}}</includeonly>
 
}}</includeonly>

Revision as of 21:33, 9 May 2014

Template:GNIS generates an external link to a Feature Detail Report from the Geographic Names Information System (GNIS), published by the United States Geological Survey (USGS). The link is displayed as "U.S. Geological Survey Geographic Names Information System: Name", where Name is either the Wikipedia article name ({{PAGENAME}}) or an optionally specified name.

Usage

The only required parameter is the GNIS Feature ID number (optionally, this parameter can be named id). The template then uses the Wikipedia article name as part of the anchor text.

{{GNIS|ID}}
{{GNIS|id=ID}}

If desired, a feature name other than the article name can be specified in a second unnamed parameter (optionally, this can be named name). This can be used if the article name contains disambiguation or when the GNIS feature name is different than the article name.

{{GNIS|ID|Name}}
{{GNIS|id=ID|name=Name}}

For GNIS features in Antarctica, add |type=antarid.

{{GNIS|ID|type=antarid}}
{{GNIS|id=ID|type=antarid}}
{{GNIS|ID|Name|type=antarid}}
{{GNIS|id=ID|name=Name|type=antarid}}

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for GNIS

This template generates an external link to a Feature Detail Report from the Geographic Names Information System (GNIS), published by the United States Geological Survey (USGS). The link is displayed as 'U.S. Geological Survey Geographic Names Information System: Name', where Name is either the Wikipedia article name ({{PAGENAME}}) or an optionally specified name.

Template parameters

ParameterDescriptionTypeStatus
ID1 id

GNIS Feature ID, a number without leading zeros.

Default
Numberrequired
Name2 name

GNIS Feature Name or other descriptive text. If not given it defaults to the Wikipedia article name

Default
{{PAGENAME}}
Numberoptional
Typetype

Use the value 'antarid' (type=antarid) for features in Antarctica.

Default
Stringoptional

Instructions

  1. Go to the GNIS Feature Search page.
  2. Search for the name, location, and/or class of the feature desired, e.g., to find a mountain called 'Mt. Foo', type 'mount foo' in the Feature Name box and select 'Summit' from the Feature Class list.
  3. Copy the 'ID' number for the desired feature and insert it into the {{GNIS|...}} template.
  4. The latitude and longitude can also be copied and used in the {{coord}} template, inserting the '|' vertical bar between degrees, minutes, seconds, and direction, e.g.: 441613N  0711812W → {{coord|44|16|13|N|071|18|12|W|region:US}}

Examples

URL: http://geonames.usgs.gov/apex/f?p=gnispq:3:::NO::P3_FID:871352

URL: http://geonames.usgs.gov/apex/f?p=gnispq:5:::NO::P5_ANTAR_ID:2828

See also

Other GNIS templates:

List of pages linking to geonames.usgs.gov:

Similar templates: