Template talk:Location/2021

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

Edit request: mark Lat=Long in a tracking cat

{{Edit request}} To adderess this matter, we can add the following:

{{#ifeq: {{{1|}}} | {{{2|}}} | [[Category:Geolocation with identical latitude and longitude]] | }}

I think it would do the trick. -- Tuválkin 02:12, 11 February 2021 (UTC)

@Tuvalkin: ✓ Done Please create Category:Geolocation with identical latitude and longitude. --AntiCompositeNumber (talk) 03:07, 26 March 2021 (UTC)
@Tuvalkin and AntiCompositeNumber:  Reverted, this doesn’t work. First of all, you should have created the tracking category before making the edit request (or immediately after it), with description telling users the purpose of the category (it took me some minutes to find out why File:Hungary 2008-08-15 (3067840057).jpg, a seemingly perfect template usage, ended up in the category). Of course I wouldn’t have reverted the change if the only issue was the red category link, but there are also two things it doesn’t take into account:
  1. Files reading coordinates from SDC. In this case, there are no parameters, consequently {{{1|}}} and {{{2|}}}, both empty, are equal. (This is what happened at File:Hungary 2008-08-15 (3067840057).jpg.)
  2. Files using the alternative (D/M/S) syntax. In this case {{{1|}}} is the degrees of latitude and {{{2|}}} is the minutes of latitude. Comparing them simply doesn’t make sense, while actual problems (where the coordinates are really equal) remain unnoticed. (For example File:Bang Bai Mai Ahoerstemeier 1.jpg is a such incorrectly tagged image.)
These things are normalized and put together in the module, so any tracking should happen there. —Tacsipacsi (talk) 13:34, 26 March 2021 (UTC)

Text wrap

{{Edit request}} Please correct the template to wrap infoboxes or images. Currently, infobox or image on the right side of a category page pushes this template and thus other page content out of the screen. --ŠJů (talk) 02:41, 24 March 2021 (UTC)

@ŠJů:  Not done It is not clear what changes should be made. Please make your changes in Template:Location/sandbox, test them, and then re-add {{Edit request}}. --AntiCompositeNumber (talk) 03:08, 26 March 2021 (UTC)

When used on audio files

When used on audio files this template still says Camera Location, even though we are talking about a microphone.Jidanni (talk) 18:12, 15 April 2021 (UTC)

Low precision showing too high precision in this template

I'm playing around a bit with photos taken from the ISS. See for example File:ISS062-E-549 - View of Earth.jpg. Here we have {{location|34.1|26.6}}, but this shows as "34° 06′ 00″ N, 26° 36′ 00″ E". On File:ISS062-E-97 - View of Earth.jpg the "49°6'N, 104°54'E " from SDC is used, but this shows as " 49° 06′ 00″ N, 104° 54′ 00″ E". This looks like false precision to me. Also the links to maps are zoomed in too much. I guess this template wasn't made with these kind of photos in mind. @Jarekt: can you have a look? Multichill (talk) 12:31, 29 April 2021 (UTC)

Multichill, {{Location}} does adjust the display to precision of the coordinates. Precision is estimated based on number of decimal digits, but to go to lower precision than one second, it has to be set with "prec" parameter (or equivalent Wikibase encoding), for example {{location|34.1|26.6|prec=10000}} will show as "34° 06′ N, 26° 36′ E". I used precision of 10 km based on 0.1*11100 ~ 11 km, where 111000 is approximate degree at equator in meters. --Jarekt (talk) 20:05, 29 April 2021 (UTC)
@Jarekt: not sure if I get it. The precision is set in structured data to 0.1, see http://commons.wikimedia.org/entity/M104419047.json . So why isn't this used? Multichill (talk) 20:14, 29 April 2021 (UTC)
Multichill, Yap SDC based precision was ignored. It should be fixed now. --Jarekt (talk) 03:22, 30 April 2021 (UTC)
@Jarekt: yes, that's a step in the right direction! Leaves the zoom when clicking the OSM icon (Karthographer). On both File:ISS062-E-549 - View of Earth.jpg (0.1) and File:Vintage Train at the KWVR - geograph.org.uk - 1943815.jpg (precision 0.0001) the OSM map opens with the same zoom with the scale on the bottom right set to 1 km. For the earth image this should be much more zoomed out and for the Geograph image this could be a bit more zoomed in (not too much). The precision doesn't seem to have any effect on this link. Multichill (talk) 08:48, 30 April 2021 (UTC)
Multichill, The precision was always only used for the display of the coordinates and not for any of the links. We do not seem to have many links left, as in the past we had servers or tools to overlay commons images on Google earth, Google Maps and Bing, but they all shut down one by one. All we have now are 2 OSM based maps: wikimap.toolforge.org and kartographer. Both seem to support zoom level and I can pick different zoom based on precision. I check and both seem to use the same number system for the zoom level. anybody knows what is a good mapping between precision (in degrees or meters) and zoom level? --Jarekt (talk) 14:32, 30 April 2021 (UTC)

I was afraid you're going to ask that. Long time ago on d:Property talk:P625 this table was posted by Paweł Ziemian:

precision example format Latitude 0 30 50 70 80 85 89 90
10.00000000000000000000 50°N, 0°E 1113195 964056 715548 380736 193305 97022 19428 1
1.00000000000000000000 52°N, 0°W 111320 96406 71555 38074 19331 9703 1943 1
0.10000000000000000000 51.6°N, 0.3°E 11132 9641 7156 3808 1934 971 195 1
0.01666666666666670000 51°33'N, 0°17'46"W 1856 1607 1193 635 323 162 33 1
0.01000000000000000000 51.56°N, 0.28°E 1114 965 716 381 194 98 20 1
0.00100000000000000000 51.556°N, 0.280°E 112 97 72 39 20 10 2 1
0.00027777777777777800 51°33'20"N, 0°16'46"W 31 27 20 11 6 3 1 1
0.00010000000000000000 51.5558°N, 0.2797°E 12 10 8 4 2 1 1 1
0.00002777777777777780 51°33'20.0"N, 0°16'46.0"W 4 3 2 2 1 1 1 1
0.00001000000000000000 51.55583°N, 0.27972°E 2 1 1 1 1 1 1 1
0.00000277777777777778 51°33'20.02"N, 0°16'45.98"W 1 1 1 1 1 1 1 1

So the logic is probably: What is the precision? + What is the latitude? I don't really feel like re-inventing the wheel. If I look at the structured data for both example images the zoom is correct so the part of the Wikibase extension that takes care of that already has the correct logic. We just need to dig up that part of the code so we can do the same in LUA (if Wikibase doesn't happen to have some helper LUA function for this). Multichill (talk) 16:36, 30 April 2021 (UTC)

@Jarekt: Got some pointers from Lucas. I believe we're using this code and here it's hardcoded to zoom 13 which is the 1 km scale we see. In the Kartographer javascript (which we see in the UI) which is based on these messages. Cleanest would be to update the upstream code to not hardcode the zoom. Multichill (talk) 17:08, 30 April 2021 (UTC)
@Multichill: , the numbers in the table seems like something I can calculate with Module:Coordinates distance function (line 204). In the past I was also encoded formulas in w:Longitude#Length_of_a_degree_of_longitude in several programing languages. I think the zoom levels I need are the ones in https://wiki.openstreetmap.org/wiki/Zoom_levels table. That table can be recreated using zoom = ROUND(8.452-3.268*log10(degree)) formula to convert tile width to zoom level, which is something I can use. My Kartographer zoom is also hardwired to level 13 (Module:Coordinates line 172) and wikimap.toolforge.org zoom to level 16 (line 129). I do not think I should go to higher zooms than level 16 (2.4 meter pixels), but can go to lover zooms for lower precision coordinates. --Jarekt (talk) 17:59, 30 April 2021 (UTC)
@Jarekt: sounds good. I always hated math on spheres so happy if you can take care of that part. I hope you can make it so both the UI and the embedded map show the exact same zoom level. I would limit it on 17, that makes sense in cities. Multichill (talk) 18:31, 30 April 2021 (UTC)

Camera direction

How do you insert the camera direction in degrees with this template? I do not have a complete overview of the template but I expect something like:

{{Location|45.8078|8.2581|direction = 35.1}}

This would say that something was taken at [1] with 35.1° of direction (degrees from the north expressed as a clockwise direction). Is this supported now? --Valerio Bozzolan (talk) 10:45, 21 July 2021 (UTC)

OK was able to understand that this is the way:
{{Location|45.8078|8.2581|heading:35}}
Camera location45° 48′ 28.08″ N, 8° 15′ 29.16″ E  Heading=35° Kartographer map based on OpenStreetMap.View all coordinates using: OpenStreetMapinfo

Anyway, I really do not understand why here we reinvented the weel to introduce "heading:value" instead of just "heading=value". What were the reasons? Thank you so much :) --Valerio Bozzolan (talk) 13:34, 21 July 2021 (UTC)

Valerio Bozzolan, When the template was first written in 2006 the original designer chose "heading:value" syntax, and it was used ever since. I agree that "heading=value" would make more sense, but it is hard to change all the files that already use the old syntax and multiple alternative ways to accomplish the same thing did not seem necessary. --Jarekt (talk) 17:37, 21 July 2021 (UTC)

Speaking of heading, do any maps show it? I see the dots in OpenStreetMap, WikiShootMe, and Commons App, but arrows would help in looking for pictures of an object. Jim.henderson (talk) 17:21, 23 July 2021 (UTC)

Example for use

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

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

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)

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)

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

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)

@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)
Sometimes, a bad solution is better than nothing …
:-(
--Albinfo (talk) 22:27, 6 October 2021 (UTC)