示例#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);
        }
示例#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;
        }
示例#3
0
文件: Api.cs 项目: wangpei421/h3net
 /// <summary>
 /// Erases all the information for a linkedgeopolygon
 /// </summary>
 /// <param name="polygon"></param>
 public static void DestroyLinkedPolygon(LinkedGeoPolygon polygon)
 {
     polygon.Clear();
 }
示例#4
0
文件: Api.cs 项目: wangpei421/h3net
 /// <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();
 }