Exemple #1
0
        /// <summary>
        /// Add a newly constructed polygon to current polygon.
        /// </summary>
        /// <returns>Reference to new polygon</returns>
        /// <exception cref="Exception"></exception>
        public LinkedGeoPolygon AddNewLinkedGeoPolygon()
        {
            if (Next != null)
            {
                throw new Exception("polygon.Next must be null");
            }

            Next = new LinkedGeoPolygon();
            return(Next);
        }
Exemple #2
0
        /// <summary>
        /// Free all the geoloops and propagate to the next polygon until
        /// there's no more polygons.
        /// </summary>
        public void Clear()
        {
            foreach (var loop in _geoLoops)
            {
                loop.Clear();
            }

            Next?.Clear();
            Next = null;
        }
Exemple #3
0
 /// <summary>
 /// Erases all the information for a linkedgeopolygon
 /// </summary>
 /// <param name="polygon"></param>
 public static void DestroyLinkedPolygon(LinkedGeoPolygon polygon)
 {
     polygon.Clear();
 }
Exemple #4
0
 /// <summary>
 /// Create a LinkedGeoPolygon from a set of contiguous hexagons
 /// </summary>
 /// <param name="h3Set"></param>
 /// <param name="outPolygon"></param>
 public static void H3SetToLinkedGeo(List <H3Index> h3Set, out LinkedGeoPolygon outPolygon)
 {
     outPolygon = h3Set.ToLinkedGeoPolygon();
 }