Help:Geocoding/0.5

From Mapping on MediaWiki
Jump to: navigation, search

Since people work with addresses instead of coordinates, geocoding functionality is included in Maps. This means Maps will convert a human readable address to a set of coordinates. This functionality is based on the Google Geocoder extension, which, if installed, you will need to un-install before using Maps.

You can geocode an address with the #geocode parser function. The underneath code will return the coordinates of Moscow.

{{#geocode:Moscow, Russia}}

Result:

55.7557860, 37.6176330

For more examples, see here.

In most cases, you will want to do something like displaying a map of New York, or indicating a couple of streets somewhere. Maps has build in support for those, and will automatically recognize addresses from coordinates, allowing automatic geocoding, without the need for the #geocode parser function. This behaviour is explained further in the relevant sections of the documentation.

Geocoding service

Maps allows you to use multiple geocoding services. Both the available geocoding services as the default geocoding service are settings, and can be modified. If you don't want to use the default service, you can specify it in the parser function.

The #geocode parser function accepts a second argument, like shown below:

{{#geocode:Moscow, Russia|yahoo}}

In some cases, the default geocoding service will be overridden with another value.

  • In a display_map/display_point(s) Google Maps map: google will be used as the default
  • In a display_map/display_point(s) Yahoo! Maps map: yahoo will be used as the default

This only overrides the default geocoding service that's used when no service is provided in the parser function.

Legal warning

Both the Google and Yahoo! geocoding services have a licence that prohibits their use for anything that is not directly related to their associated mapping services, unless you have written permission. You are encouraged to read the service's licences (Google, Yahoo!) before using them.

The underneath examples are in violation of the relevant licences in most cases:

{{
#display_point:
Moscow, Russia
|service=google
|geoservice=yahoo
}}
{{
#display_point:
{{geocode:Moscow, Russia|google}}
|service=yahoo
}}
Personal tools
Namespaces
Variants
Actions
Navigation
Manuals
Useful lists
More awesomeness
Tools