zamojski / TowerCollector

The OpenCellID and MLS contributor's app.
Mozilla Public License 2.0
227 stars 27 forks source link

json export lacks some data points #44

Closed jidanni closed 6 years ago

jidanni commented 6 years ago

Curious if any of the formats lost data, I tried

$ grep -c 466.*92 * #MCC MNC
2018-09-17-06-39-41.gpx:353
2018-09-17-06-39-49.csv:353
2018-09-17-06-39-35.csv:353
2018-09-17-06-39-55.json:323

Why did json lack some points?

One reason seems to be during a cell transition when stationary, in the json file the new cell is ignored:

2018-09-17-06-39-49.csv:254:24.14220491,120.63880148,466,92,,,24950,,105859362,,,387,60,,"2018-09-16 08:32:21.225Z",28,2,120,LTE,"asus ASUS_Z012DA"
2018-09-17-06-39-49.csv:255:24.14220491,120.63880148,466,92,,,24950,,105859352,,,388,49,,"2018-09-16 08:32:24.269Z",28,2,120,LTE,"asus ASUS_Z012DA"
2018-09-17-06-39-55.json:74:{"timestamp":1537086741225,"position":{"latitude":24.14220491,"longitude":120.63880148,"accuracy":27.87,"altitude":84,"heading":120.1,"speed":2.24,"source":"gps"},"cellTowers":[{"radioType":"lte","mobileCountryCode":466,"mobileNetworkCode":92,"locationAreaCode":24950,"cellId":105859362,"primaryScramblingCode":387,"asu":60,"signalStrength":-80,"serving":1},{"radioType":"lte","mobileCountryCode":466,"mobileNetworkCode":92,"locationAreaCode":24950,"cellId":105859352,"primaryScramblingCode":388,"asu":49,"signalStrength":-91,"serving":1}]},

OK but what is more valid, the old cell or the new cell? And what if the new cell only occurs once, thus not the case of 'who cares, there will be plenty of it following later'. And even if in that case, a valuable data point is thrown away.

Anyway one hopes that within the app one can find a warning that JSON contains less data points.

zamojski commented 6 years ago

I don't see any data loss here, if you format JSON text correctly you will see it contains exactly the same cells.

{
  "timestamp":1537086741225,
  "position":{
    "latitude":24.14220491,
    "longitude":120.63880148,
    "accuracy":27.87,
    "altitude":84,
    "heading":120.1,
    "speed":2.24,
    "source":"gps"
  },
  "cellTowers":[
    {
      "radioType":"lte",
      "mobileCountryCode":466,
      "mobileNetworkCode":92,
      "locationAreaCode":24950,
      "cellId":105859362,
      "primaryScramblingCode":387,
      "asu":60,
      "signalStrength":-80,
      "serving":1
    },
    {
      "radioType":"lte",
      "mobileCountryCode":466,
      "mobileNetworkCode":92,
      "locationAreaCode":24950,
      "cellId":105859352,
      "primaryScramblingCode":388,
      "asu":49,
      "signalStrength":-91,
      "serving":1
    }
  ]
}
jidanni commented 6 years ago

Oops.