Example #1
0
        private static string DoCell(H3Index h3, H3ToGeoBoundaryArguments argParser)
        {
            var sb = new StringBuilder();
            var gb = h3.ToGeoBoundary();

            if (argParser.Kml)
            {
                string name = string.IsNullOrEmpty(argParser.KmlName)
                                  ? "H3 Geometry"
                                  : argParser.KmlDescription;
                string desc = string.IsNullOrEmpty(argParser.KmlDescription)
                                  ? "Generated by h3ToGeoBoundary"
                                  : argParser.KmlDescription;

                sb.Append(Kml.PtsHeader(name, desc));
                sb.Append(Kml.OutputBoundaryKML(gb, h3.ToString()));
                sb.Append(Kml.PtsFooter());
            }
            else
            {
                sb.AppendLine(h3.ToString());
                sb.Append(Utility.GeoBoundaryPrintLines(gb));
            }

            return(sb.ToString());
        }