Template talk:Location

From Wikimedia Commons, the free media repository
Jump to: navigation, search
Info non-talk.svg Template:Location has been protected indefinitely because it is a highly-used or visible template. Use {{Edit request}} on this page to request an edit.
Please test any changes in the template's /sandbox or /testcases subpages, or in a user subpage, and consider discussing changes at the talk page before implementing them.

This Template is intended to complement Template:Information.

Example for use[edit]

See: Image:Hildesheim-Hoher.Weg.Huckup.01.JPG

Syntax {{Location|Degree|Minute|Second|Latitude|Degree|Minute|Second|Longitude|Information attributes}}
Example {{Location|52|09|03.70|N|9|57|02.79|E|type:landmark_region:DE-NI_scale:5000}}


The example is for a landmark in the region Germany (DE), Lower Saxony (Niedersachsen NI). By scale you request the mapping program to render the map in a scale of 1/5000.) Information attributes on landmark and region should always be added. Scale is an optional parameter and is not necessarily required. To find adequate parameters for other regions of the Earth, please look at the project pages in the English Wikipedia (w:en:Wikipedia:WikiProject Geographical coordinates or in the German Wikipedia (w:de:Wikipedia:WikiProjekt Georeferenzierung).


Zoom levels
OSM scale
19 unavailable
18     1000
17     3000
16     5000
15    10000
14    30000
13    50000
12   100000
11   300000
10   500000
 9  1000000
 8  2000000
 7  3000000
 6  5000000
 5 10000000
 4 30000000
 3 50000000

The explanation of dim: vs. scale: vs. prec= is rather lousy. Apparently prec=1000 suppresses the display of ss in ddd:mm:ss, good enough for my purposes. But dim:3km has no effect for the openstreetmap zoom=16. I need a list for zoom=nn use TBD:value, maybe some combo of dim/scale if that's needed for other sources.
Writing that I suddenly grok what "OSM" obviously means, after two weeks of ignoring the TLA.:tongue:Be..anyone (talk) 10:10, 9 January 2015 (UTC)

Zoom and scale are the attributes and have no effect on the display of the data on wikipedia pages, I have no idea what they are used for in the database. Parameter "prec" only affect the display. --Jarekt (talk) 22:24, 10 January 2015 (UTC)
Okay, so no visible effect for OSM-URL is as it should be. And dim: is almost clear, but I miss a clue when I'd use scale: at all. –Be..anyone (talk) 14:48, 11 January 2015 (UTC)
New test results: The type:forest etc. is displayed by GeoHack, but has no effect on the OSM zoom (via GeoHack.) The scale is used by GeoHack, and OSM via GeoHack uses zoom 13 for scale:50000, zoom 14 for scale:30000, zoom 15 for scale:10000, and zoom 16 without scale. –Be..anyone (talk) 20:32, 20 January 2015 (UTC)
The reasons why prec=1000 always suppresses the seconds are explained on Commons:Geocoding#Precision, 1000m is always more than 30sec (untested: 33m might have the same effect, if more than 1sec is enough to get rid of seconds.) –Be..anyone (talk) 20:41, 20 January 2015 (UTC)
Maybe prec=100 trims ddd:mm:ss.nnnn to ddd:mm:ss (seconds). –Be..anyone (talk) 06:40, 2 February 2015 (UTC)
I am not sure if there is a question here, but the code for this part is at Module:Coordinates (function coordinates._deg2dms). --Jarekt (talk) 14:01, 2 February 2015 (UTC)
Mostly a correction of my wild speculation.Classic smiley.svg So you mean that {{location}} invokes coordinates.LocationTemplateCore(), that calls coordinates.GeoHack_link(), that calls coordinates.lat_lon(), that calls coordinates._deg2dms() for prec/111000 and prec/lon2m, where lon2m = 6378137*math.cos(phi)*math.pi/180. Okay, at that point I should be able to figure it out—when I'll get a round tuit. –Be..anyone (talk) 16:42, 2 February 2015 (UTC)
I do not remember what calls what, but all function in Module:Coordinates are invoked by {{location}} and that one function is responsible for changing format of the number based on precision. It would be silly to have coordinates with precision +- 1 km and display them with degrees, minutes, and seconds accurate to 2nd decimal digit. However it is also part of the code that is not exercised much since very few images use precision (last time I checked). --Jarekt (talk) 17:19, 2 February 2015 (UTC)
New test results, lists of regions per country are available on enwiki. I've added a table for the initial zoom levels on OSM via GeoHack at the top of this section. –Be..anyone (talk) 23:40, 16 February 2015 (UTC)


What is this, and where is it documented? Wild guess, something like the obsolete (?) type=landmark mentioned above in an old comment. –Be..anyone (talk) 10:16, 9 January 2015 (UTC)

class:object is part of the interface between the template and the database, not between users and the template. I do not know if it is documented somewhere. --Jarekt (talk) 22:26, 10 January 2015 (UTC)
I'll test type:landmark when I stumble over one, or find the list of well-known types again. –Be..anyone (talk) 14:43, 11 January 2015 (UTC)
As I recall user:Dschwen was saying at some point that "type:landmark" was not doing anything and should be removed. I started removing some unused attributes, but had to stop due to outrage of people who felt that I was removing valuable information. --Jarekt (talk) 22:34, 11 January 2015 (UTC)
Wild guess, maps use different markers for different location types, so far it's no nonsense. But if the info is never used/verified/whatever, it's pointless. Maybe the docu should say for backwards compatibility with deprecated unused info such as type:landmark.Be..anyone (talk) 04:56, 12 January 2015 (UTC)

Too often out of service[edit]

The map tools linked by "View this and other nearby images on:" are (in last years) too often out of service (maybe, more time is out of service than in service). That causes that many of Commons users don't know what the functions should really do. I propose to add a noticeable warning about it to the text of the template. Would be possible also any detection of the tool which can e.g. red/green icon dependently signalizing that the tool is out/ready? --ŠJů (talk) 08:59, 27 January 2015 (UTC)

Wait a moment, {{editprotected}} is for precise instructions what should be done. The template only invokes Module:Coordinates, and I don't get how this module should display a warning. Or do you want a warning in {{location/doc}}? The documentation isn't protected. Collecting good coordinates for MRD certainly works, GeoHack, OSM, Google Maps, and the mini atlas also tend to work (or rather, sometimes this or that doesn't, but the rest works). –Be..anyone (talk) 10:33, 27 January 2015 (UTC)
By my rough estimate, in 7 of 10 attempts to use the function, the "other nearby images" are not displayed (although the linked maps are opened in correct place with correct coordinates). In rare lucky cases only.
The explaining warning is needed to be displayed at the image pages bellow the links in the template. It doesn't matter whether through Module:Coordinates or directly through the template. As i know, texts from the documentation page are not displayed in the template. The precise formulation of the warning depends on the fact whether is possible or not to detect readiness of the tool. --ŠJů (talk) 00:52, 28 January 2015 (UTC)
I diverted this discussion to Module talk:Coordinates. --ŠJů (talk) 00:58, 28 January 2015 (UTC)

ŠJů, I just tried it and the links to OSM, Google Earth and WikiMiniAtlas (accessed by clicking in the globe icon) worked just fine, while Google Maps send me to this page which claims that the KML approach we used to display the information in Google maps will no longer be supported, and will have to be rewritten using "Google Maps JavaScript API". At least that is my read of the page. The Google Maps support is provided by http://tools.wmflabs.org/geocommons/ maintained by user:Para. I do not know if my assessment, that it needs a rewrite, is correct and if so then if there are plans to do the rewrite. We could remove "Google Maps" from the list until it is fixed. Also pinging @Kolossos: and @Dschwen: who might know more about it. --Jarekt (talk) 03:41, 17 February 2015 (UTC)

Yes, Google Maps are taking down the feature we've been using. I looked into it a bit here. I don't know how complicated it would be to make their API work through nested kmls or view based networklinks, but it's at least not as simple as putting in the pointer kml into Google's sample Javascript (as done on JSFiddle for example with a kml that contains the placemarks directly). --Para (talk) 08:48, 17 February 2015 (UTC)
As former Google Maps APIv2 "developer" (one set of iGoogle tiny maps gadgets) I recommend to drop Google Maps support completely, and invest any free time in projects unrelated to Google. –Be..anyone (talk) 09:15, 17 February 2015 (UTC)
OK so unless there is opposition tomorrow I will remove "Google Maps" link for time being and we can add it if the issue is resolved. One could still get to Google Maps by clicking on the coordinates to go to Geohack, where there will be Google Maps link. --Jarekt (talk) 13:42, 17 February 2015 (UTC)
✓ Done--Jarekt (talk) 04:40, 1 March 2015 (UTC)
Could Bing Maps possibly replace it? I sometimes use that anyway for its sometimes superior slant views, but getting into it is cumbersome without a link. Jim.henderson (talk) 17:45, 2 March 2015 (UTC)
It could if anybody writes a tool to show images nearby current image in Bing. Otherwise click on the coordinates to get to geohack and pick your favorite map website. --Jarekt (talk) 18:27, 2 March 2015 (UTC)

Headings for objects?[edit]

The documentation for {{Object location}} discusses heading parameters, and uses them in examples. Shouldn’t these be deprecated for object locations? Even where an object has a fixed orientation (e.g. faces of mountains, doorways of buildings) it will still be possible to depict from a variety of positions, especially in a close-up. If the parameter is intended to describe an object‘s orientation, however, there should be an explanation of the appropriate conventions (e.g. along the faces or walls, or perpendicular to them? facing in or out?).—Odysseus1479 (talk) 01:27, 22 February 2015 (UTC)

Heading of a camera has exactly the same meaning in case of object or camera locations. If you imagine a vector going from camera to an central object than {{location}} describes starting point and direction, and {{Object location}} describes ending point and direction, but in both cases direction is the same. --Jarekt (talk) 02:58, 22 February 2015 (UTC)
Sure, but the bearing of the camera-to-object line is a property of that particular photo, not the object itself. In case it’s not clear, I’m thinking of locations in categories, not individual files. Anything there should be an intrinsic property, or at least one that pertains to every file underneath. Or, if a camera is presumed to be be involved in every use of this template, is there a different object-location template for application to categories?—Odysseus1479 (talk) 03:22, 22 February 2015 (UTC)
Agreeing with Odysseus1479 here. The only exception is categories containing only (different versions of the same) one image, such as this one. In general, as a coarse rule, {{camera location}} belongs in photos and {{object location}} belongs in categories. -- Tuválkin 05:37, 22 February 2015 (UTC)
I can think of another ‘edge case‘: some popular-landmark cats containing very numerous images have been broken down into “Views of X from Y“ subcats (as well as by season, year, weather, …), and for many of those—the more distant, anyway—a heading parameter could apply. But these also are fairly rare, and are arguably distinct as view-cats from their parent object-cats.
I can see a case for the use of {{Object location}} in files where the camera position is unknown, high precision is required, and there‘s no object cat suitable to tag with the geolocation. Again a rather unusual circumstance.—Odysseus1479 (talk) 05:53, 22 February 2015 (UTC)
I agree in majority of the cases heading has no meaning in case of {{Object location}} placed in categories (with a few exceptions mentioned above). If you find any than they should be deleted.--Jarekt (talk) 19:54, 22 February 2015 (UTC)

Adding a link to Google Maps[edit]

Since Google Maps is by far the most used mapping provider out there, I propose that this template be edited to provide a link to Google Maps. This could either supplement or replace the Google Earth link. The Google Earth link does not even work and instead prompts to download a "doc.kml" file. OSX (talkcontributions) 03:01, 30 March 2015 (UTC)