Open main menu

Wikimedia Commons β

Template talk:Location

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 useEdit

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).

Problem in categories?Edit

Tests seem to indicate that this template produces different OSM links depending on whether it is in a media (file) page or in a category page:

The problem is that (for my test examples) only the first kind works. The other ends up on a world map page saying “sorry, no data to show”. You can test this with the OSM link in Category:Castle Birkenleiten; nothing special there, just the first page where I noticed the problem.

I tried copying a working {{Object location}} from a file page into a category page, and it stopped working.

-- Renardo la vulpo (talk) 21:03, 26 February 2017 (UTC)

I think it is my doing. So the OSM icon next to coordinates will get you to Kartographer which is also based on OSM. Otherwise when in category the second OSM link shows the locations of all the files in the category that have coordinates, and in case of Category:Castle Birkenleiten there might not be any so you get the error. All this stems from the fact that we had 4 separate OSM maps: the Kartographer, commons-on-osm, wiki-osm and WikiMiniAtlas( I am not sure what happen to WikiMiniAtlas, which does not seem to be there anymore). So we had 3 or 4 OSM links with different capabilities and we call them all "OpenStreetMap" (which is also wrong since do not actually link to OSM website, only using their data to render our own maps - it is kind of false advertising especially if the website does not work). So we used an icon for Kartographer and word "OpenStreetMap" which for images shows that image and other near by images on OSM map and for categories shows location of all the images in the category. I hope that in the future Kartographer will be able to turn on and off layers that mimic capabilities of the other 2 tools and we will be able to retire 2 old tools. It would make template much simpler to understand. --Jarekt (talk) 03:11, 27 February 2017 (UTC)
I added coordinates to the files File:Birkenleiten 15 Muenchen-1.jpg and File:Birkenleiten 15 Muenchen-2.jpg. Now the link in the category gives you a result: [1]. --тнояsтеn 08:14, 27 February 2017 (UTC)
Thank you; so the OSM link actually does not show the object location in the coordinates right next to it but the coordinates of the pictures in the category. This was far from evident to me.
Maybe it would be an idea to display the category's {{Object location}} on the map as well? This way there would be something to display even if none of the pictures had coordinates. -- Renardo la vulpo (talk) 18:45, 3 March 2017 (UTC)

Object location as secondary coordinateEdit

Hi all, hi @Jarekt: Is there a reason why this template does not pass the secondary coordinate parameter to mw:Extension:GeoData (via Module:Coordinates) by default? This would allow to obtain the object location using the geosearch API or from the geo_tags SQL table. Related Phabricator task: T135686. – Simon04 (talk) 14:20, 20 May 2017 (UTC)

Simon04, I am not sure what are you asking about. I wrote all the code for this template but I do not have deep understanding of tags needed for communication with tools that might use the data. The way it works is that if someone asks for additional tagging I add it or help with adding it and I try not to loose it as the code changes. So if some passing mechanism is not there, propose to add it, and if no one objects, I will work with you to add it. As I recall, {{Object location}} is much less interesting to mapping tools as it does not say anything about camera location, and depicted object could be meters or kilometers away. Only Proximityrama tool seems to be using that information and they can get coordinates they need somehow. --Jarekt (talk) 14:51, 20 May 2017 (UTC)
@Jarekt: @Kolossos: I would like to see the parameter secondary=1 to be passed for every {{#invoke:Coordinates}} invocation (unless an other value is specified for this parameter). This would greatly ease extracting the object location in my Commons:Locator-tool (currently I fetch the coordinates from Template:Location from the API, but need to fetch and parse the wikitext for extracting the Template:Object location). Would the change be feasible or is there anything objecting this? – Simon04 (talk) 17:44, 21 May 2017 (UTC)

Funktioniert nichtEdit

Auch wenn dieses Template in Bildern mit Geo-Daten in der EXIF-Datei gesetzt wird, geschieht nichts, schon gar nicht nach den genannten 24 Stunden. --Friedo (talk) 12:52, 3 October 2017 (UTC)

Longitude signEdit

@The RedBurn: it looks like your edit of the documentation is wrong: it says "Degrees of Longitude. The sign indicates hemisphere: +(West) and -(East)", while the template works in the opposite way:

--Djadjko (talk) 00:59, 10 October 2017 (UTC)

Return to "Location" page.