/// <summary> /// Initializes a new instance of the <see cref="VesselGeoPosition"/> class. /// </summary> public VesselGeoPosition(long objectId, string positionSource, double longitude, double latitude, DateTime timestamp, IGeoHashAlgorithm geoHasher) { ObjectId = objectId; Position = new Point(new Position(latitude, longitude)); Timestamp = timestamp; Date = timestamp.Date; GeoHash = geoHasher.GeoHashCoordinates(longitude, latitude); Source = Enum.Parse <PositionSource>(positionSource); CreatedOn = DateTime.Now; }
/// <summary> /// Initializes a new instance of the <see cref="VesselGeoPosition"/> class. /// </summary> public VesselGeoPosition(PositionReport position, IGeoHashAlgorithm geoHasher) : this(position.ObjectId, position.Source, position.Longitude, position.Latitude, position.Timestamp, geoHasher) { }