H3Lib/Extensions/CollectionExtensions.cs
/// <summary>
/// hexRanges takes an array of input hex IDs and a max k-ring and returns an
/// array of hexagon IDs sorted first by the original hex IDs and then by the
/// k-ring (0 to max), with no guaranteed sorting within each k-ring group.
/// </summary>
/// <param name="h3Set">a list of H3Indexes</param>
/// <param name="k">k The number of rings to generate</param>
/// <returns>
/// Tuple
///     Item1 - 0 if no pentagon is encountered. Cannot trust output otherwise
///     Item2 - List of H3Index cells
/// </returns>
hexRanges takes an array of input hex IDs and a max k-ring and returns an
array of hexagon IDs sorted first by the original hex IDs and then by the
k-ring (0 to max), with no guaranteed sorting within each k-ring group.
hexRanges takes an array of input hex IDs and a max k - ring and returns an array of hexagon IDs sorted first by the original hex IDs and then by the k - ring ( 0 to max ) with no guaranteed sorting within each k - ring group .
public static (int, List<H3Index>) HexRanges(this List<H3Index> h3Set, int k)
        {
            var results = new List<H3Index>();
            foreach (var h3Cell in h3Set)
            {
                (int success, List<H3Index> temp) = h3Cell.HexRange(k);
                if (success != 0)
                {
                    return (success, results);
                }
                results.AddRange(temp);
            }
            return (0, results);
        }
public static ( int , List < H3Index > ) HexRanges ( this List < H3Index > h3Set , int k ) { var results = new List < H3Index > ( ) ; foreach ( var h3Cell in h3Set ) { ( int success , List < H3Index > temp ) = h3Cell . HexRange ( k ) ; if ( success != 0 ) { return ( success , results ) ; } results . AddRange ( temp ) ; } return ( 0 , results ) ; }
hexRanges takes an array of input hex IDs and a max k-ring and returns an
array of hexagon IDs sorted first by the original hex IDs and then by the
k-ring (0 to max), with no guaranteed sorting within each k-ring group.
hexRanges takes an array of input hex IDs and a max k - ring and returns an array of hexagon IDs sorted first by the original hex IDs and then by the k - ring ( 0 to max ) with no guaranteed sorting within each k - ring group .
Tuple
Item1 - 0 if no pentagon is encountered. Cannot trust output otherwise
Item2 - List of H3Index cells
Tuple Item1 - 0 if no pentagon is encountered . Cannot trust output otherwise Item2 - List of H3Index cells
List<H3Index>
this
k
int
k The number of rings to generate
k The number of rings to generate
h3Set
a list of H3Indexes
a list of H3Indexes