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}}

Explanation[edit]

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

No param for elevation[edit]

The height above sea level is often an interesting property of a location; but the template does not yet have a parameter to show it. sarang사랑 10:26, 26 October 2016 (UTC)

We could do that, wikidata has elevation above sea level (P2044) property we could tap into and we could add a local parameter. So lets say Category:Salt Lake City has {{Object location}} template linked to wikidata and wikidata has elevation of 1,288±1 meters. We could display it in the {{Object location}} template but I am not convinced that it is desirable. That elevation does not mean much to me and will take space in the template and make it more cluttered. Elevations for individual photographs could be remarkably inaccurate as your phones and GPS units do not have a good way to measure GPS. Finally there is no big benefit to uploders to get it right or include it at all, no additional functionality is unlocked. --Jarekt (talk) 12:08, 26 October 2016 (UTC)
It may good for some organism photos as they only found in an altitude range. But only useful if can produce a search results based on a particular altitude or altitude range. Jee 12:15, 26 October 2016 (UTC)
Thank you. The pictures about hiking pathes and shelters are somehow incomplete without the altidude. And when there is a geo-location, it would not be bad if it is mentioned there. BTW, when pictures contain EXIF GPS the altitude is stored with this data. Of course it can be verified with other sources. So I thought one more optional parameter might be fine; but I can live without it, especially when nobody else wants this expansion. sarang사랑 16:51, 26 October 2016 (UTC)
I do not mind adding it if there is consensus on the subject and if we come up with some clever way to display it. My current position is Symbol neutral vote.svg Neutral. So if we decide to add it. How should it be displayed? For the reference {{Object location|Wikidata=Q1025253}} gives the following source code:
Object location 49° 20′ 14″ N, 22° 04′ 03″ E Openstreetmap logo.svg View this and other nearby images on: OpenStreetMap - Google Earth infoEdit coordinates on Wikidata
Can you two ( and other users) propose ways to add altitude? --Jarekt (talk) 18:50, 26 October 2016 (UTC)
Altitude would be useful in our many pictures from an airplane window. However, phone and camera GPS fixes in that circumstance are much less reliable than on the ground. Jim.henderson (talk) 14:37, 28 October 2016 (UTC)
I have some pictures from an airplane window but I have no way of knowing the altitude for any of them. it could be calculated from cameras field-of-view, resolution and size in pixels of known geographical features. However I doubt anybody wou go through that kind of calculations to tag an image. --Jarekt (talk) 14:44, 28 October 2016 (UTC)

Cat "Files with maps"[edit]

Hi everyone, seems that all files using this template end up in the mentioned category. What is it for? And why is it not created yet? --Arnd (talk) 20:14, 2 November 2016 (UTC)

It looks like Kartographer extension which was recently added to {{Location}} template adds those. --Jarekt (talk) 02:10, 3 November 2016 (UTC)
Based on this patch: Differentiate tracking categories by namespace. Raymond 07:40, 3 November 2016 (UTC)

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 coordinate[edit]

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)