Template:Canada NTS Map Sheet/doc

This template creates a link to the Canadian Government Geospatial Data Extraction web page to plot a National Topographic System (NTS) map sheet bounding box when the template is given an NTS identifier or latitude and longitude. The bounding box may represent a 1:50,000 scale map sheet or a 1:250,000 scale map sheet. This template will also give the name of the specified NTS map sheet linked to an appropriate Wikipedia article.

This template has a database of maps.

The linking schema this template uses is meant to be provisional, contingent on a solution implemented into WikiMiniAtlas to visualize bounding boxes from lists of coordinates.

Usage
[[File:NTS Zones and Map Series Numbers.png|right|thumb|400px|NTS zones and map series.

Legend: {{legend|#00F|High Arctic zone}} {{legend|#00C0FF|Arctic zone}} {{legend|#FFC000|Southern zone}}]] The most basic use of this template is without parameters. In that case, the template will attempt to fetch latitude and longitude from the article's Wikidata entry:

The template supports a variety of parameters to taylor its output to a specific need. The map's bounding box can be specified using an NTS identifier or an explicit latitude/longitude pair.

Using an NTS identifier
Where:
 * is the first part of the ID string, which is a one-to-three digit number indicated on the map at right; leading zeros ignored
 * is the second part of the ID string, which is a letter from A to P if  is found in the Southern zone, or A to H if   is found in the Arctic or High Arctic zone; must be uppercase
 * is the third part of the ID string. If  is a number from 1 to 16 (leading zeros ignored), the template returns a bounding box for a 1:50,000 scale map. If   is omitted, the template returns a bounding box for a 1:250,000 scale map

Using latitude and longitude


Where:
 * is the north latitude of a given location in decimal notation
 * is the west longitude in decimal notation

The parameters  and   can be omitted. If they are, the coordinates will be obtained from the Wikidata entry for the current article.

and  are normalized so that they are north latitude and west longitude. For example, when given the coordinates of Novosibirsk (55.05°N, 82.95°W), the template will provide a link to an untitled map in Ontario at the south shore of Hudson Bay:

Optional parameters
The template supports three optional parameters:
 * area – when set to, creates a link to a 1:250,000 scale map sheet; defaults to   so the template creates a link to a 1:50,000 scale map sheet
 * link – when set to  (the default), creates a link according to the setting of area
 * name – when set to  (the default), displays Natural Resources Canada's name for the map sheet, wikilinked to the corresponding Wikipedia article

Using an NTS identifier
For the 1:50,000 scale map that encompasses Nanaimo, British Columbia:

For the 1:250,000 scale map that encompasses Nanaimo:

For the 1:50,000 scale map that encompasses Nanaimo without a link:

For the 1:50,000 scale map that encompasses Nanaimo without a wikilink:

leading zeros ignored:

Using latitude and longitude
For the 1:50,000 scale map that encompasses Nanaimo, British Columbia:

For the 1:250,000 scale map that encompasses Nanaimo:

When given both an NTS identifier and latitude and longitude, the template will use the NTS identifier and ignore the latitude and longitude. For example, this template has the NTS identifier for Nanaimo and latitude and longitude for Toronto (43.6426°N, -79.3871°W):

Error messages
This template has crude error reporting:

Location

 * lat/long input fail – This error is returned for these two cases:
 * The normalized coordinates specify a location that lies outside of the NTS's coverage area (see the map). For example, the template returns an error when given the coordinates of Helena, Montana:
 * One or both of lat and lon are missing and Wikidata does not have coordinates for the article in which this template is used. For example, this template returns an error here because this template's documentation page does not have coordinates at Wikidata:
 * One or both of lat and lon are missing and Wikidata does not have coordinates for the article in which this template is used. For example, this template returns an error here because this template's documentation page does not have coordinates at Wikidata:

Syntax

 * invalid NTS series input – This error is returned when the first positional parameter is not a map series number found in File:NTS Zones and Map Series Numbers.png.
 * invalid NTS area input – This error is returned when the second positional parameter is not in the range of A–P ( {{legend|#FFC000|Southern zone}} ) or A–H ( {{legend|#00C0FF|Arctic}} and {{legend|#00F|High Arctic zones}} ).
 * invalid NTS sheet input – This error is returned when the third positional parameter is not a number in the range of 1–16.