Template talk:WikidataCoord

Page contents not supported in other languages.
From Startupedia

Strange error

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)

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

Changing

'coordinate parameters' are passed through to {{Coord}}. Thus we can edit Template:'regionTemplate:': such as through (P300), Template:'typeTemplate:': adm1st / adm2nd / adm3rd, and Template:'dimTemplate:': "a number connected to √ (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 <poem>{{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}} </poem>1a dim:Expression error: Unrecognized punctuation character "[".000|format=dms|display=i}}

1b {{WikidataCoord}} – malformed coordinate data 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:Expression error: Unrecognized punctuation character "[".000|format=dms|display=i}}

2b {{WikidataCoord}} – malformed coordinate data 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:Expression error: Unrecognized punctuation character "[".000|format=dms|display=i}}

3b {{WikidataCoord}} – malformed coordinate data 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:Expression error: Unrecognized punctuation character "[".000|format=dms|display=i}}

4b {{WikidataCoord}} – malformed coordinate data 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 {{WikidataCoord}} – malformed coordinate data
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 {{WikidataCoord}} – malformed coordinate data
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 {{WikidataCoord}} – malformed coordinate data
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

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)

Explained in WP:OPCOORD. MB 18:26, 8 October 2021 (UTC)
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}}
and the rendered output of {{WikidataCoord}}:
{{WikidataCoord|Q568194|display=}}{{WikidataCoord}} – malformed coordinate data
Trappist the monk (talk) 18:35, 8 October 2021 (UTC)

Template:WikidataCoord and Category:Coordinates_on_Wikidata

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

Error

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

<syntaxhighlight lang="moin">{{WikidataCoord}} – malformed coordinate data</syntaxhighlight>

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)

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:
<syntaxhighlight lang="wikitext" inline="1">{{WikidataCoord}} – malformed coordinate data</syntaxhighlight>
{{WikidataCoord}} – malformed coordinate data
See the template documentation...
Trappist the monk (talk) 15:27, 12 June 2023 (UTC)