/// <summary> /// Performs a nearest neighbour search on the nodes from a specified center limiting the number of results. /// </summary> /// <param name="center">The center of the search.</param> /// <param name="maxcount">The maximum number of results to return.</param> /// <returns>Returns up to maxcount nodes in matching order of the nearest neighbour search.</returns> public IEnumerable <T> NearestNeighbourSearch(T center, int maxcount) { return(_tree.GetNearestNeighbours(GeoUtil.GetCoord(center), maxcount).Select(v => v.Value)); }
/// <summary> /// Adds a node to the <see cref="ReverseGeoCode<T>"/> internal structure. /// </summary> /// <param name="node">The <see cref="IGeoLocation"/> to add.</param> public void Add(T node) { _tree.Add(GeoUtil.GetCoord(node), node); }
/// <summary> /// Performs a radial search on the nodes from a specified center within a given radius limiting the number of /// results. /// </summary> /// <param name="center">The center of the search.</param> /// <param name="radius">The radius to search in.</param> /// <param name="maxcount">The maximum number of results to return.</param> /// <returns>Returns up to maxcount nodes matching the radial search.</returns> public IEnumerable <T> RadialSearch(T center, double radius, int maxcount) { return(_tree.RadialSearch(GeoUtil.GetCoord(center), radius, maxcount).Select(v => v.Value)); }