public static GeoLatLonRange Parse(string val)
            {
                GeoFacetCountCollector.GeoRange range = GeoFacetCountCollector.Parse(val);
                float latStart = range.Lat - range.Rad;
                float latEnd   = range.Lat + range.Rad;
                float lonStart = range.Lon - range.Rad;
                float lonEnd   = range.Lon + range.Rad;

                StringBuilder buf = new StringBuilder();

                buf.Append("[").Append(latStart).Append(" TO ").Append(latEnd).Append("]");
                string latRange = buf.ToString();

                buf = new StringBuilder();
                buf.Append("[").Append(lonStart).Append(" TO ").Append(lonEnd).Append("]");
                string lonRange = buf.ToString();

                return(new GeoLatLonRange(latRange, lonRange, latStart, latEnd, lonStart, lonEnd, range.Rad));
            }
예제 #2
0
 /// <summary>
 /// Builds a random access filter.
 /// </summary>
 /// <param name="value">Should be of the form: lat, lon: rad</param>
 /// <param name="selectionProperty"></param>
 /// <returns></returns>
 public override RandomAccessFilter BuildRandomAccessFilter(string value, IDictionary <string, string> selectionProperty)
 {
     GeoFacetCountCollector.GeoRange range = GeoFacetCountCollector.Parse(value);
     return(new GeoFacetFilter(this, range.Lat, range.Lon, range.Rad, _miles));
 }