Page MenuHomePhabricator

coords 0, 0 used for monuments without coordinates
Closed, ResolvedPublic

Description

Monuments without coordinates are placed at coordinates 0, 0 in campaign lists sorted by distance.


Version: unspecified
Severity: major

Details

Reference
bz39476

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 12:57 AM
bzimport set Reference to bz39476.
bzimport added a subscriber: Unknown Object (MLST).

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;
+------+------+

latlon

+------+------+

NULLNULL

+------+------+
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. ;)

Talking with Tomasz we should be fixing the data to not send 0,0.

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.