コード例 #1
0
        // geohash.org
        public string GetPathAsGeoHash()
        {
            TrackingContext context = new TrackingContext();

            var locations = context.Trackings
                            .Where(t => t.ValidGPS)
                            .Select(t => t.Location)
                            .ToList();

            var path = locations.Select(l => GeoHash.Encode(l.Latitude, l.Longitude));

            return(string.Join(",", path));
        }
コード例 #2
0
        // geohash.org
        public string GetPathAsGeoHash()
        {
            IList <string> path = new List <string>();

            using (var context = new TrackingContext())
            {
                var locations = context.Trackings.Where(t => t.ValidGPS).Select(t => t.Location).ToList();

                foreach (Location location in locations)
                {
                    path.Add(GeoHash.Encode(location.Latitude, location.Longitude));
                }

                return(string.Join(",", path));
            }
        }
コード例 #3
0
 public DbTrackingRepository(TrackingContext context)
 {
     this.context = context;
 }
コード例 #4
0
 public LocationRepository(TrackingContext context)
 {
     this.context = context;
 }