コード例 #1
0
ファイル: lidarpoint.hpp プロジェクト: cugwhp/terrace
	LidarPoint(const LidarMetadata& theMetadata, const liblas::Point& theLasPoint)	
		: mMetadata(&theMetadata),
		  mCoords(wykobi::make_point(static_cast<long>(theLasPoint.GetRawX()), 
			static_cast<long>(theLasPoint.GetRawY()), 
			static_cast<long>(theLasPoint.GetRawZ()))),
		  mCls(theLasPoint.GetClassification().GetClass())
	{
	}
コード例 #2
0
ファイル: las2txt.cpp プロジェクト: egparmehr/libLAS-1.6
std::string GetPointString( std::string const& parse_string,
                            std::string const& delimiter,
                            liblas::Point const& p, 
                            boost::array<boost::uint32_t, 4> precisions, 
                            boost::uint32_t index)
{
    
    std::ostringstream output;
    

    output.setf(std::ios_base::fixed, std::ios_base::floatfield);
    

    boost::uint32_t i = 0;
    liblas::Color const& c = p.GetColor();
    for (;;)
    {
        
        switch (parse_string[i])
        {
        /* // the x coordinate */      
        case 'x':
            output.setf(std::ios_base::fixed, std::ios_base::floatfield);
            output.precision(precisions[0]); //x precision
            output << p.GetX();
            // lidardouble2string(printstring, LASPoint_GetX(p)); fprintf(file_out, "%s", printstring);
            break;
        /* // the y coordinate */
        case 'y':
            output.setf(std::ios_base::fixed, std::ios_base::floatfield);
            output.precision(precisions[1]); //y precision
            output << p.GetY();
            break;
        /* // the z coordinate */ 
        case 'z':
            output.setf(std::ios_base::fixed, std::ios_base::floatfield);
            output.precision(precisions[2]); //z precision
            output << p.GetZ();
            break;
        /* // the raw x coordinate */      
        case 'X':
            output << p.GetRawX();
            break;
        /* // the raw y coordinate */
        case 'Y':
            output << p.GetRawY();
            break;
        /* // the raw z coordinate */ 
        case 'Z':
            output << p.GetRawZ();
            break;
        /* // the gps-time */
        case 't': 
            output.setf(std::ios_base::fixed, std::ios_base::floatfield);
            output.precision(precisions[3]); //t precision
            output << p.GetTime();
            break;
        /* // the intensity */
        case 'i':
            output << p.GetIntensity();
            break;
        /* the scan angle */
        case 'a':
            output << p.GetScanAngleRank();
            break;
        /* the number of the return */
        case 'r': 
            output << p.GetReturnNumber();
            break;
        /* the classification */
        case 'c':
            output << static_cast<boost::uint32_t>(p.GetClassification().GetClass());
            break;
        /* the classification name */
        case 'C':
            output << p.GetClassification().GetClassName();
            break;
        /* the user data */
        case 'u': 
            output << p.GetUserData();
            break;
        /* the number of returns of given pulse */
        case 'n':
            output << p.GetNumberOfReturns();
            break;
        /* the red channel color */
        case 'R':
            output << c.GetRed();
            break;            
        /* the green channel color */
        case 'G': 
            output << c.GetGreen();
            break;            
        /* the blue channel color */
        case 'B': 
            output << c.GetBlue();
            break;            
        case 'M':
            output << index;
            break;
        case 'p':
            output << p.GetPointSourceID();
            break;
        /* the edge of flight line flag */
        case 'e': 
            output << p.GetFlightLineEdge();
            break;
        /* the direction of scan flag */
        case 'd': 
            output << p.GetScanDirection();
            break;
        }

        i++;

        if (parse_string[i])
        {
            output << delimiter;
        }
        else
        {
            output << std::endl;
            break;
        }

    }

    
    return output.str();
}