Beispiel #1
0
        /// <summary>
        /// Return a list of places by proximity
        /// </summary>
        public PlaceDto ReturnPlacesByProximity(double longitude, double latitude, int radius, string type, int offset, int limit)
        {
            var q = new Query();

            if (string.Compare(type, "all", true) != 0)
            {
                q.Search(type);
            }

            q.WithIn(new Circle(longitude, latitude, radius));

            return JsonSerializer.DeserializeFromString<PlaceDto>(ProcessQuery(q, limit, offset));
        }
Beispiel #2
0
        /// <summary>
        /// Return a list of places by town and country
        /// </summary>
        public PlaceDto ReturnPlacesByTownAndCountry(string town, string country, string type, int limit, int offset)
        {
            var q = new Query();

            if (string.Compare(type, "all", true) != 0)
            {
                q.Search(type);
            }

            q.And(q.Field("locality").Equal(town));
            q.And(q.Field("country").Equal(country));

            return JsonSerializer.DeserializeFromString<PlaceDto>(ProcessQuery(q, limit, offset));
        }