Created
September 10, 2018 12:24
-
-
Save daniellemccool/82ba40ced9c10e14acdedfbe2ffbed17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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