mozilla / ichnaea

Mozilla Ichnaea
http://location.services.mozilla.com
Apache License 2.0
574 stars 139 forks source link

geolocate appears to be giving geoip results in when only cell tower data is available #416

Closed crankycoder closed 9 years ago

crankycoder commented 9 years ago

I'm pretty sure that this is a bug in ichnaea. Here are screenshots showing my location lookup and the JSON bundle that I uploaded.

2015-03-10 11 20 41

2015-03-10 11 17 57

sshvetsov commented 9 years ago

I was just looking into this. I think the problem is with JSON request object generated in org.mozilla.mozstumbler.service.stumblerthread.datahandling.StumblerBundle.toMLSGeolocate() and org.mozilla.mozstumbler.service.stumblerthread.scanners.cellscanner.CellInfo.toJSONObject().

Google Geolocation API request (since Ichnaea Geolocate API points to Goolge as reference) is specified something like this:

{
  "radioType": ...,
  "cellTowers": [
    {
      "cellId": ...,
      "locationAreaCode": ...,
      "mobileCountryCode": ...,
      "mobileNetworkCode": ...
    }
  ]
}

While MozStumbler generates something like this (note the location of "radioType"):

{
  "cellTowers": [
    {
      "cellId": ...,
      "locationAreaCode": ...,
      "mobileCountryCode": ...,
      "mobileNetworkCode": ...,
      "radioType": ...
    }
  ]
}

I played around with the "geolocate" API and it seems to work the same as "search" API if "radioType" is in the root of the JSON request. Presence or absence of "radioType" in cellTower object doesn't seem to have an effect on result.

crankycoder commented 9 years ago

I'm moving this back to the stumbler client.

hannosch commented 9 years ago

The issue is partly on the service side. The geolocate API supports either putting the radioType at the top-level. Or putting a key called "radio" inside each cell record. That is an undocumented workaround that is specific to some versions of Firefox OS.

What we should be accepting, to match the geosubmit API, is a radioType key inside each cell record.