<commit_before>// __BEGIN_LICENSE__
// Copyright (C) 2006-2010 United States Government as represented by
// the Administrator of the National Aeronautics and Space Administration.
// All Rights Reserved.
// __END_LICENSE__


#include <vw/BundleAdjustment/BundleAdjustReport.h>
namespace fs = boost::filesystem;

namespace vw {
namespace ba {

  void write_kml_styles( KMLFile& kml ) {
    // GCP Placemark Style
    kml.append_style( "gcp_circle", "", 1.2,
                      "http://maps.google.com/mapfiles/kml/shapes/placemark_circle.png" );
    kml.append_style( "gcp_circle_highlight", "", 1.4,
                      "http://maps.google.com/mapfiles/kml/shapes/placemark_circle_highlight.png" );
    kml.append_stylemap( "gcp_placemark", "gcp_circle",
                         "gcp_circle_highlight" );

    // Est Circle Lvl 1 (Green) Placemark
    kml.append_style( "est_circle_1", "ff00ff00", 0.8,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_style( "est_circle_1_highlight", "ff00ff00", 0.9,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_stylemap( "est_placemark_1", "est_circle_1",
                         "est_circle_1_highlight" );

    // Est Circle Lvl 2 (Green-Yellow) Placemark
    kml.append_style( "est_circle_2", "ff00ff80", 0.8,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_style( "est_circle_2_highlight", "ff00ff80", 0.9,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_stylemap( "est_placemark_2", "est_circle_2",
                         "est_circle_2_highlight" );

    // Est Circle Lvl 3 (Yellow) Placemark
    kml.append_style( "est_circle_3", "ff00ffff", 0.8,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_style( "est_circle_3_highlight", "ff00ffff", 0.9,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_stylemap( "est_placemark_3", "est_circle_3",
                         "est_circle_3_highlight" );

    // Est Circle Lvl 4 (Red-Yellow) Placemark
    kml.append_style( "est_circle_4", "ff0080ff", 0.8,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_style( "est_circle_4_highlight", "ff0080ff", 0.9,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_stylemap( "est_placemark_4", "est_circle_4",
                         "est_circle_4_highlight" );

    // Est Circle Lvl 5 (Red) Placemark
    kml.append_style( "est_circle_5", "ff0000ff", 0.8,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_style( "est_circle_5_highlight", "ff0000ff", 0.9,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_stylemap( "est_placemark_5", "est_circle_5",
                         "est_circle_5_highlight" );
  }

  void write_gcps_kml( KMLFile& kml,
                       ControlNetwork const& cnet ) {
    kml.enter_folder( "Ground Control Points",
                      "Used for Bundle Adjustment in VW" );

    unsigned count = 0;
    for ( ControlNetwork::const_iterator iter = cnet.begin();
          iter != cnet.end(); ++iter ) {
      if ( (*iter).type() == ControlPoint::GroundControlPoint ) {
        count++;
        Vector3 llr = cartography::xyz_to_lon_lat_radius( (*iter).position() );

        std::ostringstream desc;
        // GCP data
        desc << "&lt;h2&gt;Ground Control Point&lt;/h2&gt;";
        desc << "&lt;b&gt;Lon:&lt;/b&gt; " << llr.x() << " deg&lt;br&gt;";
        desc << "&lt;b&gt;Lat:&lt;/b&gt; " << llr.y() << " deg&lt;br&gt;";
        desc << "&lt;b&gt;Rad:&lt;/b&gt; " << llr.z() << " m&lt;br&gt;";

        // Images viewing
        desc << "&lt;h3&gt;Viewed by:&lt;/h3&gt;&lt;ol&gt;";
        for ( ControlPoint::const_iterator measure = (*iter).begin();
              measure != (*iter).end(); ++measure ) {
          desc << "&lt;li&gt;" << "[" << (*measure).image_id() << "] "
               << (*measure).serial() << "&lt;/li&gt;";
        }
        desc << "&lt;/ol&gt;";

        if ( (*iter).id() != "Null" ) {
          kml.append_placemark( llr.x(), llr.y(),
                                (*iter).id(), desc.str(),
                                "gcp_placemark" );
        } else {
          std::ostringstream gcp_name;
          gcp_name << "GCP " << count;
          kml.append_placemark( llr.x(), llr.y(),
                                gcp_name.str(), desc.str(),
                                "gcp_placemark" );
        }
      }
    }

    kml.exit_folder();<commit_msg>Increased precision in BA report KML.<commit_after>// __BEGIN_LICENSE__
// Copyright (C) 2006-2010 United States Government as represented by
// the Administrator of the National Aeronautics and Space Administration.
// All Rights Reserved.
// __END_LICENSE__


#include <vw/BundleAdjustment/BundleAdjustReport.h>
namespace fs = boost::filesystem;

namespace vw {
namespace ba {

  void write_kml_styles( KMLFile& kml ) {
    // GCP Placemark Style
    kml.append_style( "gcp_circle", "", 1.2,
                      "http://maps.google.com/mapfiles/kml/shapes/placemark_circle.png" );
    kml.append_style( "gcp_circle_highlight", "", 1.4,
                      "http://maps.google.com/mapfiles/kml/shapes/placemark_circle_highlight.png" );
    kml.append_stylemap( "gcp_placemark", "gcp_circle",
                         "gcp_circle_highlight" );

    // Est Circle Lvl 1 (Green) Placemark
    kml.append_style( "est_circle_1", "ff00ff00", 0.8,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_style( "est_circle_1_highlight", "ff00ff00", 0.9,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_stylemap( "est_placemark_1", "est_circle_1",
                         "est_circle_1_highlight" );

    // Est Circle Lvl 2 (Green-Yellow) Placemark
    kml.append_style( "est_circle_2", "ff00ff80", 0.8,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_style( "est_circle_2_highlight", "ff00ff80", 0.9,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_stylemap( "est_placemark_2", "est_circle_2",
                         "est_circle_2_highlight" );

    // Est Circle Lvl 3 (Yellow) Placemark
    kml.append_style( "est_circle_3", "ff00ffff", 0.8,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_style( "est_circle_3_highlight", "ff00ffff", 0.9,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_stylemap( "est_placemark_3", "est_circle_3",
                         "est_circle_3_highlight" );

    // Est Circle Lvl 4 (Red-Yellow) Placemark
    kml.append_style( "est_circle_4", "ff0080ff", 0.8,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_style( "est_circle_4_highlight", "ff0080ff", 0.9,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_stylemap( "est_placemark_4", "est_circle_4",
                         "est_circle_4_highlight" );

    // Est Circle Lvl 5 (Red) Placemark
    kml.append_style( "est_circle_5", "ff0000ff", 0.8,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_style( "est_circle_5_highlight", "ff0000ff", 0.9,
                      "http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png" );
    kml.append_stylemap( "est_placemark_5", "est_circle_5",
                         "est_circle_5_highlight" );
  }

  void write_gcps_kml( KMLFile& kml,
                       ControlNetwork const& cnet ) {
    kml.enter_folder( "Ground Control Points",
                      "Used for Bundle Adjustment in VW" );

    unsigned count = 0;
    for ( ControlNetwork::const_iterator iter = cnet.begin();
          iter != cnet.end(); ++iter ) {
      if ( (*iter).type() == ControlPoint::GroundControlPoint ) {
        count++;
        Vector3 llr = cartography::xyz_to_lon_lat_radius( (*iter).position() );

        std::ostringstream desc;
        // GCP data
        desc << "&lt;h2&gt;Ground Control Point&lt;/h2&gt;";
        desc << "&lt;b&gt;Lon:&lt;/b&gt; " << llr.x() << " deg&lt;br&gt;";
        desc << "&lt;b&gt;Lat:&lt;/b&gt; " << llr.y() << " deg&lt;br&gt;";
        desc << "&lt;b&gt;Rad:&lt;/b&gt; " << std::setprecision(12)
             << llr.z() << " m&lt;br&gt;";

        // Images viewing
        desc << "&lt;h3&gt;Viewed by:&lt;/h3&gt;&lt;ol&gt;";
        for ( ControlPoint::const_iterator measure = (*iter).begin();
              measure != (*iter).end(); ++measure ) {
          desc << "&lt;li&gt;" << "[" << (*measure).image_id() << "] "
               << (*measure).serial() << " ( " << measure->position()[0] << ", "
               << measure->position()[1] <<  " ) " << "&lt;/li&gt;";
        }
        desc << "&lt;/ol&gt;";

        if ( (*iter).id() != "Null" ) {
          kml.append_placemark( llr.x(), llr.y(),
                                (*iter).id(), desc.str(),
                                "gcp_placemark" );
        } else {
          std::ostringstream gcp_name;
          gcp_name << "GCP " << count;
          kml.append_placemark( llr.x(), llr.y(),
                                gcp_name.str(), desc.str(),
                                "gcp_placemark" );
        }
      }
    }

    kml.exit_folder();
{'fraction_non_alphanumeric': 0.161177439275422, 'fraction_numerical': 0.02181967888019761, 'mean_word_length': 2.174452793204835, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5442300', 'n_tokens_mistral': 3543, 'n_tokens_neox': 3363, 'n_words': 503}