Beispiel #1
0
        public async Task Put(Position position, string key, string value)
        {
            // we should think about having some kind of transaction concept around this
            var pkv = new PositionKeyValue { Key = key, Value = value, Latitude = position.Latitude, Longitude = position.Longitude };
            var quadKey = CreateGeoKey(position, key);

            var existingQuadKey = await this.KeyIndex.Get(key);
            if (null != (existingQuadKey))
            {
                // the value already exists, so delete it
                await this.GeoIndex.Delete(existingQuadKey);
            }

            await Task.WhenAll(this.GeoIndex.Put(quadKey, pkv), this.KeyIndex.Put(key, quadKey));
        }
Beispiel #2
0
 public Task<IEnumerable<PositionKeyValueDistance>> Search(Position position, double radius)
 {
     // this is work in progress
     throw new NotImplementedException();
 }
Beispiel #3
0
 private static string CreateGeoKey(Position position, string key)
 {
     return string.Format("{0}{1}{2}", position.GetQuadKey(), ((char)254), key);
 }