MapSources extension

This extension shall give access to several data and mapping sources.

License
GPL.

Test Examples

 * London
 * Zürich
 * Wellington

Installing MapSources
Download the MapSources extension from the SVN repository. It contains and requires the GeoMath extension.

Copy GeoMath.php, GeoMath.i18n.php (decimal and sexagesimal input and conversion), GeoTransform.php (conversion from decimal to the Universal Transverse Mercator projection), MapSources.php, MapSources.class.php and MapSources.i18n.php (Map Sources special page) into the GeoMath folder in the extensions folder of your MediaWiki installation. Then add the following line to your LocalSettings.php file (near the end):

Customization
Map Sources special page uses the Project:Map Sources as a master copy. It uses place holders as described below. The name of this project page is taken from the mapsources message string 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

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.

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.

Used messages
Message strings ― noted in Mapsources.i18n.php ― are available now for two languages (de and en).

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

Weblinks

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