Extension:MapSources

The MapSources extension gives access to several data and mapping sources.

Installation
Use the version for MW 1.25 for MW 1.23+ since older releases will not work properly.

Customization
The Map Sources special page uses project:map sources as a form of template for the Special:MapSources page output. This project page uses place holders as described below. The base name of this project page is taken from the mapsources message string (MediaWiki:Mapsources) of the content language.


 * English wikis: Project:Map sources
 * French wikis: Project:Sources de cartes
 * German wikis: Project:Karten- und Datenquellen
 * Italian wikis: Project:Fonte della mappa
 * Polish wikis: Project:Mapy
 * and in Soviet Russia, Project:Источники карт maps you.

The text language will not be changed by the user language, it depends only on the content language. Therefore, you must have only one project page per wiki. If the project page does not exist, the extension will fail with an error:

Error messages
 * No project page Источники карт available

URL and search parameters
Two different types of input parameter sets are accepted:


 * The Wikipedia Georeference code like


 * A comma- or semicolon-separated list of latitude, langitude, and parameters. Latitude and langitude can be written in decimal or sexagesimal forms, ie . The parameters must be separated by spaces or underscores. The parameter name and its value are separated by a colon “:” or an equal sign “=”. Example:

scale:N
Sets the desired map scale as 1:N. This will override the default scale 1:100.000 or the type.

type:T
Sets the type of this location, which will be used for the reverse mapping of the points. Will also set the default map scale. Types are:

dim:D
Specifies the size of a location by meters. Not yet supported.

region:R
Sets the preferred map region of coverage, used in selecting appropriate map resources for the area. The region should be supplied as either a two character ISO 3166-1 alpha-2 country code, or an ISO 3166-2 region code. Examples:


 * US
 * DE
 * DE-BB (Brandenburg state in Germany)

globe:G
Specifies other worlds than earth. Such as Moon or other planets.

precision:P
Specifies the number of valid decimal places of the coordinate. Default value is 6.

Approximation of the Universal Transverse Mercator conversion
This program uses Redfearn’s formulae to convert a given latitude and longitude into the equivalent Transverse Mercator (TM) coordinates.

Meridian Distance
The Meridian Distance m from the equator is given approximately by:

$$\begin{align} m &= r \left( \left( 1 - \frac{e^2}{4} - \frac{3}{64}e^4 - \frac{5}{256}e^6 \right) \varphi - \left( \frac{3}{8}e^2 + \frac{3}{32}e^4 + \frac{45}{1024}e^6 \right) \sin(2 \varphi) \right. \\ &+ \left. \left( \frac{15}{256}e^4  + \frac{45}{1024}e^6 \right) \sin(4 \varphi) - \left( \frac{35}{3072}e^6 \right) \sin(6 \varphi) \right) \end{align} $$

where are
 * r the size of the major semi axis
 * e the eccentricity of the reference ellipsoid
 * φ the latitude in radian

dd2dms

 * dd2dms converts degrees to degree-minute-second format. It uses the required coordinate and the optional plus, minus and precision values.
 * Application:
 * Example:  gives
 * Example:  gives

Degree values can be both sexagesimal and decimal.

Strings for the cardial directions will be added to the dms value. They can be empty, single letters or strings and will be added at the end of the conversion result. If the original value is graeter or equal zero, the plus string is added, otherwise the minus string is used.

deg2dd

 * deg2dd converts degrees to decimal-degree format.
 * Application:
 * Example:  gives

geoLink
The third function, geoLink, can be used to convert a complete geographic coordinate without reapplying the dd2dms function:


 * geoLink replaces a string pattern with coordinates.
 * Application:

The following example shows how to write a template showing a text link to a Map Sources special page:

The pattern string can obtain upto four different place holders $1 ... $6.


 * $1 means the latitude in Wikipedia syntax including the direction letter like 51.2323_N.
 * $2 means the longitude in Wikipedia syntax including the direction letter like 51.2323_E.
 * $3 means the latitude in degree, minute and second format considering the strings for the cardinal directions and the precision, see also dd2dms.
 * $4 means the longitude in degree, minute and second format considering the strings for the cardinal directions and the precision, see also dd2dms.
 * $5 means the latitude.
 * $6 means the longitude.

Sexagesimal coordinate format
You can enter coordinates in the sexagesimal system in the following way:

deg[°] [min['] [sec[ '' ]]] [N|S|E|W]

deg, min, sec mean the degree, minute and second values, respectively. The designations can be omitted, but the succession must be kept.

There are alternative characters for the designations in the following way:

Weblinks

 * Swiss CH1903 projection (in German)
 * New Zealand Geodetic Datum 2000 (NZGD2000)
 * OSM zoom levels