Page MenuHomePhabricator

Do not approximate coordinates when saving, but only on presentation level
Open, Needs TriagePublic

Description

https://www.wikidata.org/wiki/Q207576 (https://www.wikidata.org/w/index.php?title=Q207576&oldid=1153317172) has got two different coordinates (yes, a constraint violation, but this is not the point). Values linked to are

  • 48.2083_N_16.3731_E
  • 48.20833_N_16.373064_E

a minor difference at the 5th digit after the period
the coordinates are rendered (below the map) as follows:

  • 48°11'N, 16°23'E
  • 48°12'29.99"N, 16°22'23.02"E

which is a huge difference of 1.5/0.5 minutes (not visible on the two maps, that's why I was wondering).

The first coordinate should render / geohack renders: 48° 12′ 29.88″ N, 16° 22′ 23.16″ E which seems to be correct and near to the other coordinate.

Event Timeline

same for the second coordinate in https://www.wikidata.org/w/index.php?title=Q801607&oldid=1162774540
WD shows ''48°8'2"N, 16°17'13"E'' while
geohack shows 48° 8′ 4.92″ N, 16° 17′ 2.04″ E

the rounding is done be special (and strange) value of 0.0134603°
Maybe this is some magic number from the conversion from some other grid. If so, the value shown is misleading.

same for the first coord in https://www.wikidata.org/w/index.php?title=Q12343559&diff=1082146732&oldid=896933408&diffmode=source
with precision +/- 0.013101
is rendered as 46°42'19"N, 12°36'59"E in WD
but for geohack this is 46° 42′ 38.52″ N, 12° 37′ 0.12″ E

which is a distance of more than 600 meters. (20'' in north-south direction).

https://www.wikidata.org/w/index.php?title=Q7861551&oldid=1095688967
first coord links to 47° 15′ 28.8″ N, 11° 24′ 38.16″ E in geohack, but is rendered as 47°15'7"N, 11°24'34"E in Wikidata (a difference of 20'' / 4'')

I suspect that when storing coordinates the precision is applied to the value and values are changed acc. to the given precision. Changing the precision will again do some conversion on the coordinates and store new values. Original values get lost. I take the coordinates from GIS services, that offer decimal notation and degree/minutes/seconds notation as well. I have no idea, which of those values is the primary value and which is a simple conversion (not lossless!). So taking the wrong one is the first step where precision might get lost. The second is storing to WP where values might be converted to and fro. When coordinates are imported to wikidata, again a loss of precision occurs.

Proposal: Store coordinates in wikidata as they are given (if syntactically correct), allow user chances of that coordinates in case they are considered unprecise. BUT: Apply any precision only for the presentation, not for the stored values.

valerio.bozzolan renamed this task from wrong rendering of coordinates in Wikidata to Do not approximate coordinates when saving, but only on presentation level.May 31 2022, 3:53 PM