Skip to content

Instantly share code, notes, and snippets.

@daniellemccool
Created September 10, 2018 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daniellemccool/82ba40ced9c10e14acdedfbe2ffbed17 to your computer and use it in GitHub Desktop.
Save daniellemccool/82ba40ced9c10e14acdedfbe2ffbed17 to your computer and use it in GitHub Desktop.
using System;
using Newtonsoft.Json;
using SQLite;
namespace Tabi.DataObjects
{
public class PositionEntry
{
[PrimaryKey, AutoIncrement, JsonIgnore]
public int Id { get; set; }
[JsonIgnore]
public int DeviceId { get; set; }
[Ignore]
public Device Device { get; set; }
public double Latitude { get; set; }
public double Longitude { get; set; }
public double Accuracy { get; set; }
public double Speed { get; set; }
public double Altitude { get; set; }
public double DesiredAccuracy { get; set; }
public double DistanceBetweenPreviousPosition { get; set; }
public string Comment { get; set; }
[Indexed]
public DateTimeOffset Timestamp { get; set; }
public double DistanceTo(PositionEntry other)
{
return Util.DistanceBetween(Latitude, Longitude, other.Latitude, other.Longitude);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment