Template talk:Location

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

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

Text direction[edit]

When I view the coördinates in Hebrew, for example here, the order of the letters and the numbers is completely confused. The reason for this is that Hebrew is written from right to left, but the letters N, E, S, W are used, too, and they confuse the directionality algorithm without proper adjustment.

I see that these letters are translated to some languages, but I'm not asking to make a full translation of these letters into Hebrew, at least for now. I'm not enough of an expert on cartography in the Hebrew language, but in the Hebrew Wikipedia, coördinates are shown with English letters for N, E, S, W, so it's at least acceptable to use the English letters without translation. However, the direction of the whole <a> element should be set to ltr. Can anyone please do it?

Caveat: I'm not sure what to do about other right to left languages here. Arabic does have these letters translated, and if ltr is applied there, it will become wrong.

Thanks! Amir E. Aharoni (talk) 17:47, 24 September 2021 (UTC)Reply[reply]

Simply embedding the link in a <bdi> fixes the layout as long as the numbers and the letters use the same directionality—this seems to be the case for both Hebrew/Yiddish (Western Arabic numbers and English letters) and Arabic (Eastern Arabic numbers and Arabic letters). However, Persian uses Persian numbers (similar to the Eastern Arabic ones) and English letters (I don’t know whether it’s intentional, though), at which point HTML’s dumb bidirectional algorithm fails. To be honest, I, as a human, am not sure how to do it properly, either. As a comparison, this is how it looks like with forced RTL directionality:
۵۸° ۰۳′ ۴۶٫۵۸″ N, ۶۸° ۱۹′ ۴۵٫۴۱۸″ E
and this is how it looks like when I let the browser decide on directionality:
۵۸° ۰۳′ ۴۶٫۵۸″ N, ۶۸° ۱۹′ ۴۵٫۴۱۸″ E
(and it decides to use LTR, at least Firefox 78). So the simple <bdi> probably does more good than harm, but it’s not a perfect solution. —Tacsipacsi (talk) 20:54, 25 September 2021 (UTC)Reply[reply]

Adding Template:Object location with Visual Editor does not work properly / parameters Latitude and Longitude[edit]

Hi, adding template {{Object location}} via the Visual Editor menu: insert template offers 2 parameters Latitude and Longitude, which results in inserted code like

  • {{Object location|Latitude=50° 37′ 50.63″ N|Longitude=6° 37′ 50.63″ E}}

and results in

  • coordinates not displayed properly and
  • Error: Invalid parameters! (coordinates are missing or not numeric) Error in template * unknown parameter name (Template:Object location): 'Longitude; Latitude'

while the following variants work properly

  • {{Object location|1=50° 37′ 50.63″ N|2=6° 37′ 50.63″ E}}
  • {{Object location|50° 37′ 50.63″ N|6° 37′ 50.63″ E}}

Especially for users new to coordinates (and assuming such users will also tend to use the Visual Editor), this is annoying. Neither Latitude nor Longitude is a legal parameter name, so it should not be inserted at all. I assume that the templatedata is wrong. @Meru7: , who stumbled across this behavior. best --Herzi Pinki (talk) 22:01, 6 October 2021 (UTC)Reply[reply]

@Herzi Pinki: I’ve simply removed TemplateData, the two syntax versions make it impossible to properly model the template parameters in TemplateData. No TemplateData is still better than broken TemplateData. —Tacsipacsi (talk) 22:10, 6 October 2021 (UTC)Reply[reply]
Sometimes, a bad solution is better than nothing …
--Albinfo (talk) 22:27, 6 October 2021 (UTC)Reply[reply]

LUA error[edit]

I am experiencing an error "Lua error in Module:Coordinates at line 168: attempt to index local 'entity' (a nil value)" when adding this template to some pictures, see for example File:Dorflinde Prem.jpg. It worked fine here: File:Bildstock Helfenwang.jpg. I use this template because even if my original pictures were taken with GPS enabled, the location info gets lost when I use an image editor to crop and resize the pictures, so I manually add the location with this template. The difference between the two pictures is that I edited the first one with GIMP and the second one with gThumb. --Bruno413 (talk) 09:38, 30 June 2022 (UTC)Reply[reply]

It seems to work now, even if I haven't changed anything in the file. It might be related to that I cleared my browser cookie cache. --Bruno413 (talk) 13:31, 30 June 2022 (UTC)Reply[reply]
No, I think it was fixed by Jarekt’s edit to the module. —Tacsipacsi (talk) 17:07, 30 June 2022 (UTC)Reply[reply]

Display sequence[edit]

It's not anyway serious, just irritating a bit: when as well Camera location and Object location are given, in my logic is the first one the camera, and the second one the object. I know that it can be seen the other way - first I glance an object, and then I grip my camera.
So I do not know whether it will be worth any effort to change that sequence (which is now object - camera). I just would like it more the other way.
See as an example Blick von der Teufelskanzel.jpg -- sarang사랑 14:31, 12 August 2022 (UTC)Reply[reply]

@Sarang: , That order is encoded in {{Inform}} used by File:Blick von der Teufelskanzel.jpg. --Jarekt (talk) 11:33, 2 September 2022 (UTC)Reply[reply]
I had not been aware that the order can be changed that way - thank you for the hint! It is now corrected - sarang사랑 11:36, 2 September 2022 (UTC)Reply[reply]

link to help[edit]

@Jarekt: Will there be a possibility to suppress the display of the OOjs UI icon help.svg - it bears IMHO no indispensable information, and can be very disturbing, e.g. there.
It is generated at stmt 829 of Module:Coordinates. -- sarang사랑 10:42, 2 September 2022 (UTC)Reply[reply]

@Sarang: , the OOjs UI icon help.svg on the right of the Template has been part of the template since 2007 and I am reluctant to just remove it. I am not very attached to it, but I do not know if other users find it useful or not. Maybe the best option would be propose this change at Commons:Village pump/Proposals (2 options: keep as is or remove) and if there is consensus I will easily remove it. --Jarekt (talk) 11:33, 2 September 2022 (UTC)Reply[reply]
Thank you, but it is not such urgent, I can live with it very well. -- sarang사랑 11:36, 2 September 2022 (UTC)Reply[reply]