Ejemplo n.º 1
0
void write_points(  liblas::Reader& reader,
                    std::ostream& oss,
                    std::string const& parse_string,
                    std::string const& delimiter,
                    std::vector<liblas::FilterPtr>& filters,
                    std::vector<liblas::TransformPtr>& transforms,
                    boost::array<boost::uint32_t, 4> precisions,
                    bool bPrintLabels,
                    bool bPrintHeader,
                    bool verbose)
{

    liblas::Summary summary;
    
    reader.SetFilters(filters);
    reader.SetTransforms(transforms);


    if (verbose)
    std::cout << "Writing points:" 
        << "\n - : "
        << std::endl;

    //
    // Translation of points cloud to features set
    //
    boost::uint32_t i = 0;
    boost::uint32_t const size = reader.GetHeader().GetPointRecordsCount();
    
    if (bPrintHeader)
    {
        oss << GetHeader(reader);
    }
    
    if (bPrintLabels) 
    {
        oss << GetLabels(parse_string, delimiter);
    }


    while (reader.ReadNextPoint())
    {
        liblas::Point const& p = reader.GetPoint();
        // summary.AddPoint(p); 
        std::string output = GetPointString(parse_string, delimiter, p, precisions, i);
        
        oss << output;
        if (verbose)
            term_progress(std::cout, (i + 1) / static_cast<double>(size));
        i++;

    }
    if (verbose)
        std::cout << std::endl;
    
    
}
Ejemplo n.º 2
0
liblas::Summary check_points(   liblas::Reader& reader,
                                std::vector<liblas::FilterPtr>& filters,
                                std::vector<liblas::TransformPtr>& transforms,
                                bool verbose)
{

    liblas::Summary summary;
    
    reader.SetFilters(filters);
    reader.SetTransforms(transforms);



    if (verbose)
    std::cout << "Scanning points:" 
        << "\n - : "
        << std::endl;

    //
    // Translation of points cloud to features set
    //
    boost::uint32_t i = 0;
    boost::uint32_t const size = reader.GetHeader().GetPointRecordsCount();
    

    while (reader.ReadNextPoint())
    {
        liblas::Point const& p = reader.GetPoint();
        summary.AddPoint(p);
        if (verbose)
            term_progress(std::cout, (i + 1) / static_cast<double>(size));
        i++;

    }
    if (verbose)
        std::cout << std::endl;
    
    return summary;
    
}