Monuments without coordinates are placed at coordinates 0, 0 in campaign lists sorted by distance.
Version: unspecified
Severity: major
Monuments without coordinates are placed at coordinates 0, 0 in campaign lists sorted by distance.
Version: unspecified
Severity: major
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T41476 coords 0, 0 used for monuments without coordinates | |||
Resolved | None | T41540 'lat' and 'lon' are 0 when the value is NULL in the database JSON output |
In the database we have very few records with lat=lon=0:
mysql> SELECT COUNT(*) FROM monuments_all WHERE lat=0 AND lon=0;
+----------+
COUNT(*) |
+----------+
136 |
+----------+
1 row in set (37.19 sec)
We do have a lot of records where it is unknown, see for example Russia: http://toolserver.org/~erfgoed/api/api.php?action=search&format=json&srcountry=ru&srlang=ru
If I look up the first is in the database:
mysql> SELECT lat,lon FROM monuments_all WHERE lang='ru' AND country='ru' AND id=7800000000;
+------+------+
lat | lon |
+------+------+
NULL | NULL |
+------+------+
1 row in set (0.03 sec)
So the JSON incorrectly outputs this as 0 instead of NULL. Api bug should be filed to fix this.
This might be due to forcing the numbers to be numeric instead of strings; if we can check for null and pass it through straight, the json encoder should encode them as null...
Of course we can just special-case 0,0 since it's in the middle of the ocean and there are no real monuments there. ;)
Max fixed this api side
https://github.com/wikimedia/WLMMobile/pull/213 should take care of client
Although saying that - we *Still* need to fix the data so that monuments are not registered at 0,0 but this is lower priority.
I guess we need to remove the coordinates from any monuments in the data which are located at 0,0.