Freika / dawarich

Self-hosted alternative to Google Location History (Google Maps Timeline)
https://dawarich.app
GNU Affero General Public License v3.0
1.82k stars 31 forks source link

Altitude (and many other properties) null for Owntracks imports #165

Closed snicker closed 4 weeks ago

snicker commented 1 month ago

Describe the bug I've got a substantial number of datapoints coming from Owntracks recorder (~400000, oops). I noticed after my import that the altitude is null (along with some other key properties) in exports and the API response for GETting /api/v1/points. Interestingly, the API call shows the raw import data with the correct metadata.

Version 0.9.8

To Reproduce Steps to reproduce the behavior:

  1. import data from Owntracks recorder in JSON format
  2. export from the Export page or the API
  3. altitude is null on all points in the export

Example data

owntracks_data_to_import.json - a single point extracted from my data, altered to remove PII and set date to midnight on 1/1/2018, altitude at 641

{
  "user": {
    "locations": [
      {
        "cog": 223,
        "batt": 12,
        "lon": -115.181209,
        "acc": 7,
        "bs": 1,
        "p": 94.356,
        "vel": 4,
        "BSSID": "89:2a:a8:91:6c:bc",
        "SSID": "SSID",
        "vac": 3,
        "lat": 37.171681,
        "topic": "owntracks/snicker/phone",
        "conn": "w",
        "m": 1,
        "tst": 1514793600,
        "alt": 641,
        "_type": "location",
        "tid": "NE",
        "_http": true,
        "ghash": "9qqjfbz",
        "isorcv": "2018-01-01T00:00:00Z",
        "isotst": "2018-01-01T00:00:00Z",
        "disptst": "2018-01-01 00:00:00"
      }
    ]
  }
}

2018-01-01_2018-01-01.json exported directly from Dawarich

{
  "ngordon779@gmail.com": {
    "dawarich-export": [
      {
        "lat": "37.171681",
        "lon": "-115.181209",
        "bs": "unknown",
        "batt": null,
        "p": null,
        "alt": null,
        "acc": null,
        "vac": null,
        "vel": null,
        "conn": "unknown",
        "SSID": null,
        "BSSID": null,
        "m": "unknown",
        "tid": "NE",
        "tst": 1514793600,
        "inrids": [],
        "inregions": [],
        "topic": "owntracks/snicker/phone"
      }
    ]
  }
}

API output from GET /api/v1/points?start_at=2017-12-01T00%3A00%3A00&end_at=2018-02-01T00%3A00%3A00&api_key=[redacted]

{
  "id": 424229,
  "battery_status": null,
  "ping": null,
  "battery": null,
  "tracker_id": "NE",
  "topic": "owntracks/snicker/phone",
  "altitude": null,
  "longitude": "-115.181209",
  "velocity": null,
  "trigger": null,
  "bssid": null,
  "ssid": null,
  "connection": null,
  "vertical_accuracy": null,
  "accuracy": null,
  "timestamp": 1514793600,
  "latitude": "37.171681",
  "mode": null,
  "inrids": [],
  "in_regions": [],
  "raw_data": {
    "m": 1,
    "p": 94.356,
    "bs": 1,
    "acc": 7,
    "alt": 641,
    "cog": 223,
    "lat": 37.171681,
    "lon": -115.181209,
    "tid": "NE",
    "tst": 1514793600,
    "vac": 3,
    "vel": 4,
    "SSID": "SSID",
    "batt": 12,
    "conn": "w",
    "BSSID": "89:2a:a8:91:6c:bc",
    "_http": true,
    "_type": "location",
    "ghash": "9qqjfbz",
    "topic": "owntracks/snicker/phone",
    "isorcv": "2018-01-01T00:00:00Z",
    "isotst": "2018-01-01T00:00:00Z",
    "disptst": "2018-01-01 00:00:00"
  },
  "import_id": 31,
  "city": null,
  "country": null,
  "created_at": "2024-08-08T05:57:22.383+01:00",
  "updated_at": "2024-08-08T05:57:22.383+01:00",
  "user_id": 1,
  "geodata": {},
  "visit_id": null
}
Freika commented 4 weeks ago

Should be fixed in https://github.com/Freika/dawarich/releases/tag/0.9.12