github Freika/dawarich 0.24.0-rc

pre-releaseone day ago

Points speed units

Dawarich expects speed to be sent in meters per second. It's already known that OwnTracks and GPSLogger (in some configurations) are sending speed in kilometers per hour.

In GPSLogger it's easily fixable: if you previously had "vel": "%SPD_KMH", change it to "vel": "%SPD", like it's described in the docs.

In OwnTracks it's a bit more complicated. You can't change the speed unit in the settings, so Dawarich will expect speed in kilometers per hour and will convert it to meters per second. Nothing is needed to be done from your side.

Now, we need to fix existing points with speed in kilometers per hour. The following guide assumes that you have been tracking your location exclusively with speed in kilometers per hour. If you have been using both speed units (say, were tracking with OwnTracks in kilometers per hour and with GPSLogger in meters per second), you need to decide what to do with points that have speed in kilometers per hour, as there is no easy way to distinguish them from points with speed in meters per second.

To convert speed in kilometers per hour to meters per second in your points, follow these steps:

  1. Enter Dawarich console
  2. Run points = Point.where(import_id: nil).where.not(velocity: [nil, "0"]).where("velocity NOT LIKE '%.%'"). This will return all tracked (not imported) points.
  3. Run
points.update_all("velocity = CAST(ROUND(CAST((CAST(velocity AS FLOAT) * 1000 / 3600) AS NUMERIC), 1) AS TEXT)")

This will convert speed in kilometers per hour to meters per second and round it to 1 decimal place.

If you have been using both speed units, but you know the dates where you were tracking with speed in kilometers per hour, on the second step of the instruction above, you can add time range to the query to convert speed in kilometers per hour to meters per second only for a specific period of time. Resulting query will look like this:

start_at = DateTime.new(2025, 1, 1, 0, 0, 0).in_time_zone(Time.current.time_zone).to_i
end_at = DateTime.new(2025, 1, 31, 23, 59, 59).in_time_zone(Time.current.time_zone).to_i
points = Point.where(import_id: nil).where.not(velocity: [nil, "0"]).where("timestamp BETWEEN ? AND ?", start_at, end_at).where("velocity NOT LIKE '%.%'")

This will select points tracked between January 1st and January 31st 2025. Then just use step 3 to convert speed in kilometers per hour to meters per second.

Changed

  • Speed for points, that are sent to Dawarich via POST /api/v1/owntracks/points endpoint, will now be converted to meters per second, if topic param is sent. The official GPSLogger instructions are assuming user won't be sending topic param, so this shouldn't affect you if you're using GPSLogger.

Fixed

  • After deleting one point from the map, other points can now be deleted as well. #723 #678
  • Fixed a bug where export file was not being deleted from the server after it was deleted. #808
  • After an area was drawn on the map, a popup is now being shown to allow user to provide a name and save the area. #740
  • Garmin GPX files with empty tracks are now being imported correctly. #827

Added

  • X-Dawarich-Version header to the GET /api/v1/health endpoint response. #800

💙 This release is supported by Steven B., James Manolios, chenrik, aldumil, Arne Schwarck, derpderpington, Chippie, dint, jhalpern, Lex Fradski, Schlufo, cyberswan.at, craftyklaus, JMyrng and Jonah B. on Patreon 💙

What's Changed

New Contributors

Full Changelog: 0.23.6...0.24.0-rc

Don't miss a new dawarich release

NewReleases is sending notifications on new releases.