Jump to content

Template talk:WikidataCoord

Page contents not supported in other languages.
Coordinates: 52°30′33″N 1°53′5″W / 52.50917°N 1.88472°W / 52.50917; -1.88472
From Wikipedia, the free encyclopedia

Strange error

[edit]

Noticed some strange error in template or module. See Statue_of_Lutgardis,_Charles_Bridge, correct coordinates from wikidata (https://tools.wmflabs.org/geohack/geohack.php?params=50.086845_N_14.4085239_E_globe:earth&language=en) are rendered wrongly (https://tools.wmflabs.org/geohack/geohack.php?pagename=Statue_of_Lutgardis,_Charles_Bridge&params=50_4_49_N_14_24_24_E_type:landmark).Jklamo (talk) 18:37, 24 June 2019 (UTC)[reply]

Frietjes, could you take a look into this. In the above article, the associated entry at wikidata says the coords are 50 4 49, 14 24 24 which is the right place on the small wikimedia preview map shown in wikidata. But in the version of the article that used this template, those same coordinates are in a different location on the OSM map there.
Before I knew about this thread, I assumed the WD coords were just wrong; I found the location on google maps and put those coords (in decimal format) into the article (which located the statue correctly on the OSM map). I thought that was a good fix, but apparently there is more going on here. MB 05:24, 30 June 2019 (UTC)[reply]
MB, 50°05′13″N 14°24′31″E / 50.0869°N 14.4085°E / 50.0869; 14.4085 is not what is in WD (50°4′49″N 14°24′24″E / 50.08028°N 14.40667°E / 50.08028; 14.40667). Frietjes (talk) 13:23, 30 June 2019 (UTC)[reply]
Frietjes, yes, I am aware of that. But 50°4′49″N 14°24′24″E / 50.08028°N 14.40667°E / 50.08028; 14.40667 appears in a different location on the map in WD than it does here. MB 15:22, 30 June 2019 (UTC)[reply]

Changing

[edit]

'coordinate parameters' are passed through to {{Coord}}. Thus we can edit 'region': such as through ISO 3166-2 code (P300), 'type': adm1st / adm2nd / adm3rd, and 'dim': "a number connected to √area (P2046)"
region is used only for adm1st / adm2nd, type is only for the three types allowed (there is no adm4th (for barangay), but dim: is used for every place (with a positive area).

'template parameters' are passed through to {{Coord}} no problem.

Thus for

{{WikidataCoord||{{safesubst:#switch:{{safesubst:#invoke:string|replace|{{safesubst:#invoke:WikidataIB |getValue |P31||fwd=ALL|rank=b |osd=no |noicon=true|linked=false}}|, {{safesubst:label|Q1549591}}|replace=}}
 | municipality of the Philippines
 | city of the Philippines
 | highly urbanized city = type:adm3rd_
 | barangay =
 | province of the Philippines = region:{{safesubst:#invoke:WikidataIB |getValue |P300||fwd=ALL |rank=b |osd=no |noicon=true |linked=false}}_type:adm2nd_
 | region of the Philippines = region:{{safesubst:#invoke:WikidataIB |getValue |P300||fwd=ALL |rank=b |osd=no |noicon=true |linked=false}}_type:adm1st_
 }}dim:{{PH wikidata/power|{{PH wikidata/sqrt|{{convert|{{safesubst:#invoke:WikidataIB |getValue |P2046|qid=Q13669|fwd=ALL|rank=b|osd=no|noicon=true|su=false}}|km|km|2|disp=output number only|comma=off}}}}}}000|format=dms|display=it}}

1a dim:1000|format=dms|display=i}}

1b 10°20′6″N 123°56′56″E / 10.33500°N 123.94889°E / 10.33500; 123.94889 Alang-alang, Mandaue is fourth order
https://geohack.toolforge.org/geohack.php?pagename=Template_talk:WikidataCoord&params=10_19_55_N_123_57_13_E__dim:1000
Well that's OK, and when it gets to GeoHack it's the same too.

2a type:adm3rd_dim:4000|format=dms|display=i}}

2b 9°53′N 123°36′E / 9.883°N 123.600°E / 9.883; 123.600 Argao is third order
https://geohack.toolforge.org/geohack.php?pagename=Template_talk:WikidataCoord&params=9_53_N_123_36_E_
There are no coordinate parameters at all

3a region:PH-SIG_type:adm2nd_dim:8000|format=dms|display=i}}

3b 9°10′48″N 123°34′48″E / 9.18000°N 123.58000°E / 9.18000; 123.58000 Siquijor is second order
https://geohack.toolforge.org/geohack.php?pagename=Template_talk:WikidataCoord&params=9_11_N_123_34_E_
There are no coordinate parameters at all

4a region:PH-07_type:adm1st_dim:16000|format=dms|display=i}}

4b 10°0′N 123°30′E / 10.000°N 123.500°E / 10.000; 123.500 Central Visayas is first order
https://geohack.toolforge.org/geohack.php?pagename=Template_talk:WikidataCoord&params=10_0_N_123_30_E_
There are no coordinate parameters at all

Try with region=no and type=yes:

2c 9°53′N 123°36′E / 9.883°N 123.600°E / 9.883; 123.600
https://geohack.toolforge.org/geohack.php?pagename=Template_talk:WikidataCoord&params=9_53_N_123_36_E_

Try with region=yes and type=no:

2e 9°53′N 123°36′E / 9.883°N 123.600°E / 9.883; 123.600
https://geohack.toolforge.org/geohack.php?pagename=Template_talk:WikidataCoord&params=9_53_N_123_36_E_

Try with both region=no and type=no:

2f 9°53′N 123°36′E / 9.883°N 123.600°E / 9.883; 123.600
https://geohack.toolforge.org/geohack.php?pagename=Template_talk:WikidataCoord&params=9_53_N_123_36_E_
That doesn't work either! Now I guess that means that GeoHack doesn't work because the coordinates in wikidata are only dm not dms. Now to try that, if I can.

So I change the wikidata coordinate to have arcseconds to:
4c https://geohack.toolforge.org/geohack.php?pagename=Template_talk:WikidataCoord&params=10_0_0_N_123_30_0_E_region:PH-07_type:adm1st_dim:1000000

At last I worked what is wrong and what is to be done. But I can't do it – wikidataCoord, GeoHack and Wikidata between them have to agree what is to be done.
(It is a bit confused, as I had to change a couple of coordinate, and that means the older coordinates have been wiped.) Maybe I'll send this to Village pump.

Overprecise Records of wikidata

[edit]

In Flaminio Obelisk another user replaced my {{WikidataCoord}} with {{coord}} saying "adding coord to replace overprecise Wikidata coords". Why are wikidata coords overprecise? Why does it matter? I just wanted to use the database wikidata instead of adding the coords again manually for OSM.Ruedi33a (talk) 17:21, 8 October 2021 (UTC)[reply]

Explained in WP:OPCOORD. MB 18:26, 8 October 2021 (UTC)[reply]
Not the fault of the template. {{WikidataCoord}} merely renders the coordinates that are stored at Wikidata:
the raw information from wikidata:
{{#property:P625|from=Q568194}} → 41°54'38.52"N, 12°28'34.86"E
and the rendered output of {{WikidataCoord}}:
{{WikidataCoord|Q568194|display=}}41°54′38.52″N 12°28′34.86″E / 41.9107000°N 12.4763500°E / 41.9107000; 12.4763500
Trappist the monk (talk) 18:35, 8 October 2021 (UTC)[reply]

Template:WikidataCoord and Category:Coordinates_on_Wikidata

[edit]

Please check Wikipedia:Village_pump_(technical)#Template:WikidataCoord_and_Category:Coordinates_on_Wikidata. --Tim Wu (talk) 15:49, 14 May 2022 (UTC)[reply]

Error

[edit]

Used on Villa Park (in preview; I did not save), the markup:

{{WikidataCoord|type:landmark_region:GB |display=inline,title}}

generates an error: {{WikidataCoord}} – malformed coordinate data.

What's up? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 14:43, 12 June 2023 (UTC)[reply]

That error message occurs because {{{1}}} is assigned the value type:landmark_region:GB which is not a QID so the call into wikidata returns nothing and nothing is not valid coordinate data. Rewriting the template to include the QID works:
{{WikidataCoord|Q175339|type:landmark_region:GB |display=inline,title}}
52°30′33″N 1°53′5″W / 52.50917°N 1.88472°W / 52.50917; -1.88472
See the template documentation...
Trappist the monk (talk) 15:27, 12 June 2023 (UTC)[reply]