本文整理汇总了C++中ossimRefPtr::worldToLineSample方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimRefPtr::worldToLineSample方法的具体用法?C++ ossimRefPtr::worldToLineSample怎么用?C++ ossimRefPtr::worldToLineSample使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimRefPtr
的用法示例。
在下文中一共展示了ossimRefPtr::worldToLineSample方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testIpts
//.........这里部分代码省略.........
// Image point, sample, line:
key = IPT_KW + ossimString::toString( i ).string();
value = kwl.findKey( key );
if ( value.size() )
{
ossimDpt ipt; // image point
ossimGpt wpt; // world point
ossimGpt gt; // ground truth
ossimDpt gtd; // wpt to gt delta
ossimDpt rtp; // round trip point
ossimDpt rtd; // round trip delta;
ipt.toPoint( value );
ipt.x += iptShift;
ipt.y += iptShift;
cout << "itest_ipt" << std::setw(8) << i << ": " << value << "\n";
// Get the height above ellipsoid:
ossim_float64 hgt = 0.0;
key = IPT_HGT_KW + ossimString::toString( i ).string();
value = kwl.findKey( key );
if ( value.size() )
{
ossimString os ( value );
hgt = os.toFloat64();
if ( heightUnits == OSSIM_FEET )
{
hgt *= MTRS_PER_FT;
}
}
else
{
cerr << "missing height above ellipsoid for point! Using 0.0."
<< endl;
}
cout << "itest_hgt" << std::setw(8) << i << ": " << value << "\n";
model->lineSampleHeightToWorld( ipt, hgt, wpt );
cout << "itest_wpt" << std::setw(8) << i << ": " << wpt << "\n";
if ( wpt.hasNans() == false )
{
model->worldToLineSample( wpt, rtp );
// Get the ground truth;
key = IPT_GT_KW + ossimString::toString( i ).string();
value = kwl.findKey( key );
if ( value.size() )
{
gt.toPoint( value );
cout << "itest_gt" << std::setw(9) << i << ": " << gt << "\n";
if ( gt.isNan() == false )
{
gtd.x = wpt.lon - gt.lon;
gtd.y = wpt.lat - gt.lat;
ossimDpt mpd = wpt.metersPerDegree();
ossimDpt gtm;
gtm.x = gtd.x * mpd.x;
gtm.y = gtd.y * mpd.y;
cout << "itest_gtd_dd" << std::setw(5) << i << ": " << gtd << "\n";
cout << "itest_gtd_mtrs" << std::setw(3) << i << ": " << gtm << "\n";
}
}
else
{
gt.makeNan();
}
rtd = ipt - rtp;
cout << "itest_rtp" << std::setw(8) << i << ": " << rtp << "\n"
<< "itest_rtd" << std::setw(8) << i << ": " << rtd << "\n\n";
}
else
{
cerr << "model->worldToLineSample(...) result has nans!\n"
<< wpt << endl;
}
++foundPts;
}
++i;
if ( i > POINTS+100 )
{
break;
}
}
cout << "\ntestIpts end **********************************\n\n";
}
} // End: testIpts
示例2: testGpts
void testGpts( ossimRefPtr<ossimNitfRsmModel>& model, const ossimKeywordlist& kwl )
{
if ( model.valid() )
{
cout << std::setfill(' ') << setiosflags(ios::left);
const std::string ID_KW = "gtest_id";
const std::string GPT_KW = "gtest_gpt";
const ossim_uint32 POINTS = kwl.numberOf( ID_KW.c_str() );
cout << "\ngtest begin ********************************\n\n"
<< "number_of_points_world_points: " << POINTS << "\n";
ossim_uint32 foundPts = 0;
ossim_uint32 i = 0;
std::string key;
std::string value;
while ( foundPts < POINTS )
{
// ID:
key = ID_KW + ossimString::toString( i ).string();
value = kwl.findKey( key );
if ( value.size() )
{
cout << "gtest_id" << std::setw(6) << i << ": " << value << "\n";
}
// World point :
key = GPT_KW + ossimString::toString( i ).string();
value = kwl.findKey( key );
if ( value.size() )
{
ossimDpt ipt; // image point
ossimGpt wpt; // world point
ossimGpt rtp; // round trip point
ossimDpt rtd; // round trip delta;
wpt.toPoint( value );
cout << "gtest_gpt" << std::setw(5) << i << ": " << wpt << "\n";
model->worldToLineSample( wpt, ipt );
if ( wpt.hasNans() == false )
{
model->lineSampleHeightToWorld( ipt, wpt.hgt, rtp );
rtd.x = wpt.lon - rtp.lon;
rtd.y = wpt.lat - rtp.lat;
cout << "gtest_ipt" << std::setw(5) << i << ": " << ipt << "\n"
<< "gtest_rtp" << std::setw(5) << i << ": " << rtp << "\n"
<< "gtest_rtd" << std::setw(5) << i << ": " << rtd << "\n\n";
}
else
{
cerr << "model->worldToLineSample(...) result has nans!\n"
<< wpt << endl;
}
++foundPts;
}
++i;
if ( i > POINTS+100 )
{
break;
}
}
cout << "\ngtest end **********************************\n\n";
}
} // End: testGpts