本文整理汇总了C++中ossimGpt::makeNan方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimGpt::makeNan方法的具体用法?C++ ossimGpt::makeNan怎么用?C++ ossimGpt::makeNan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimGpt
的用法示例。
在下文中一共展示了ossimGpt::makeNan方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lineSampleToWorld
//*****************************************************************************
// METHOD: ossimRpcModel::lineSampleToWorld()
//
// Overrides base class implementation. Performs DEM intersection.
//*****************************************************************************
void ossimRpcModel::lineSampleToWorld(const ossimDpt& imagePoint,
ossimGpt& worldPoint) const
{
//---
// Under debate... (drb 20130610)
// this seems to be more accurate for the round trip
//---
#if 0
if(!imagePoint.hasNans())
{
lineSampleHeightToWorld(imagePoint,
worldPoint.height(),
worldPoint);
}
else
{
worldPoint.makeNan();
}
#else
if(!imagePoint.hasNans())
{
ossimEcefRay ray;
imagingRay(imagePoint, ray);
ossimElevManager::instance()->intersectRay(ray, worldPoint);
}
else
{
worldPoint.makeNan();
}
#endif
}
示例2: lineSampleToWorld
void ossimBuckeyeSensor::lineSampleToWorld(const ossimDpt& image_point,
ossimGpt& gpt) const
{
if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::lineSampleToWorld:entering..." << std::endl;
if(image_point.hasNans())
{
gpt.makeNan();
return;
}
//***
// Determine imaging ray and invoke elevation source object's services to
// intersect ray with terrain model:
//***
ossimEcefRay ray;
imagingRay(image_point, ray);
ossimElevManager::instance()->intersectRay(ray, gpt);
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
ossimNotify(ossimNotifyLevel_DEBUG) << "ray = " << ray << std::endl;
ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
}
if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::lineSampleToWorld: returning..." << std::endl;
return;
}
示例3: imageToGround
void ossimIvtGeomXform::imageToGround(const ossimDpt& ipt, ossimGpt& gpt)
{
gpt.makeNan();
if(m_geom.valid())
{
m_geom->localToWorld(ipt, gpt);
}
}
示例4: viewToGround
void ossimIvtGeomXform::viewToGround(const ossimDpt& viewPt, ossimGpt& gpt)
{
ossimDpt ipt;
gpt.makeNan();
viewToImage(viewPt, ipt);
if(!ipt.hasNans())
{
imageToGround(ipt, gpt);
}
}
示例5: lineSampleToWorld
void ossimRpcProjection::lineSampleToWorld(const ossimDpt& imagePoint,
ossimGpt& worldPoint) const
{
if(!imagePoint.hasNans())
{
lineSampleHeightToWorld(imagePoint,
worldPoint.height(),
worldPoint);
}
else
{
worldPoint.makeNan();
}
}
示例6: lineSampleToWorld
void ossimCsmSensorModel::lineSampleToWorld(const ossimDpt& image_point,
ossimGpt& gpt) const
{
if(image_point.hasNans())
{
gpt.makeNan();
return;
}
//***
// Determine imaging ray and invoke elevation source object's services to
// intersect ray with terrain model:
//***
ossimEcefRay ray;
imagingRay(image_point, ray);
ossimElevManager::instance()->intersectRay(ray, gpt);
}
示例7: lineSampleHeightToWorld
void ossimTileMapModel::lineSampleHeightToWorld(const ossimDpt& image_point,
const double& /* height */,
ossimGpt& gpt) const
{
if(!image_point.hasNans())
{
gpt.lon = static_cast<double>(image_point.samp)/(1 << qDepth)/256 *360.0-180.0;
double y = static_cast<double>(image_point.line)/(1 << qDepth)/256;
double ex = exp(4*M_PI*(y-0.5));
gpt.lat = -180.0/M_PI*asin((ex-1)/(ex+1));
}
else
{
gpt.makeNan();
}
return;
}
示例8: lineSampleToWorld
//*****************************************************************************
// METHOD: ossimRpcModel::lineSampleToWorld()
//
// Overrides base class implementation. Performs DEM intersection.
//*****************************************************************************
void ossimRpcModel::lineSampleToWorld(const ossimDpt& imagePoint,
ossimGpt& worldPoint) const
{
//lineSampleHeightToWorld(imagePoint, theHgtOffset, worldPoint);
//worldPoint.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(worldPoint);
//if(!worldPoint.hasNans()) return;
if(!imagePoint.hasNans())
{
ossimEcefRay ray;
imagingRay(imagePoint, ray);
if (m_proj) worldPoint.datum(m_proj->getDatum()); //loong
ossimElevManager::instance()->intersectRay(ray, worldPoint);
}
else
{
worldPoint.makeNan();
}
}
示例9: lineSampleHeightToWorld
void ossimBuckeyeSensor::lineSampleHeightToWorld(const ossimDpt& image_point,
const double& heightEllipsoid,
ossimGpt& worldPoint) const
{
if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::lineSampleHeightToWorld: entering..." << std::endl;
if (!insideImage(image_point))
{
worldPoint.makeNan();
}
else
{
//***
// First establish imaging ray from image point:
//***
ossimEcefRay ray;
imagingRay(image_point, ray);
ossimEcefPoint Pecf (ray.intersectAboveEarthEllipsoid(heightEllipsoid));
worldPoint = ossimGpt(Pecf);
}
if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::lineSampleHeightToWorld: returning..." << std::endl;
}
示例10: lineSampleToWorld
void ossimSpectraboticsRedEdgeModel::lineSampleToWorld(const ossimDpt& image_point,
ossimGpt& gpt) const
{
if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpectraboticsRedEdgeModel::lineSampleToWorld:entering..." << std::endl;
if(image_point.hasNans())
{
gpt.makeNan();
return;
}
//***
// Extrapolate if image point is outside image:
//***
// if (!insideImage(image_point))
// {
// gpt.makeNan();
// gpt = extrapolate(image_point);
// return;
// }
//***
// Determine imaging ray and invoke elevation source object's services to
// intersect ray with terrain model:
//***
ossimEcefRay ray;
imagingRay(image_point, ray);
ossimElevManager::instance()->intersectRay(ray, gpt);
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
ossimNotify(ossimNotifyLevel_DEBUG) << "ray = " << ray << std::endl;
ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
}
if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::lineSampleToWorld: returning..." << std::endl;
return;
}
示例11: intersectRay
//*****************************************************************************
// METHOD: intersectRay()
//
// Service method for intersecting a ray with the elevation surface to
// arrive at a ground point. The ray is expected to originate ABOVE the
// surface and pointing down.
//
// NOTE: the gpt argument is expected to be initialized with the desired
// datum, including ellipsoid, for the proper intersection point to be
// computed.
//
// LIMITATION: This release supports only single valued solutions, i.e., it
// is possible a ray passing through one side of a mountain and out the other
// will return an intersection with the far side. Eventually, a more robust
// algorithm will be employed.
//
//*****************************************************************************
bool ossimElevSource::intersectRay(const ossimEcefRay& ray, ossimGpt& gpt, double defaultElevValue)
{
if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimElevSource::intersectRay: entering..." << std::endl;
static const double CONVERGENCE_THRESHOLD = 0.001; // meters
static const int MAX_NUM_ITERATIONS = 50;
double h_ellips; // height above ellipsoid
bool intersected;
ossimEcefPoint prev_intersect_pt (ray.origin());
ossimEcefPoint new_intersect_pt;
double distance;
bool done = false;
int iteration_count = 0;
if(ray.hasNans())
{
gpt.makeNan();
return false;
}
//***
// Set the initial guess for horizontal intersect position as the ray's
// origin, and establish the datum and ellipsoid:
//***
const ossimDatum* datum = gpt.datum();
const ossimEllipsoid* ellipsoid = datum->ellipsoid();
// double lat, lon, h;
// ellipsoid->XYZToLatLonHeight(ray.origin().x(),
// ray.origin().y(),
// ray.origin().z(),
// lat, lon, h);
// ossimGpt nadirGpt(lat, lon, h);
// std::cout << "nadir pt = " << nadirGpt << std::endl;
gpt = ossimGpt(prev_intersect_pt, datum);
//
// Loop to iterate on ray intersection with variable elevation surface:
//
do
{
//
// Intersect ray with ellipsoid inflated by h_ellips:
//
h_ellips = getHeightAboveEllipsoid(gpt);
if ( ossim::isnan(h_ellips) ) h_ellips = defaultElevValue;
intersected = ellipsoid->nearestIntersection(ray,
h_ellips,
new_intersect_pt);
if (!intersected)
{
//
// No intersection (looking over the horizon), so set ground point
// to NaNs:
//
gpt.makeNan();
done = true;
}
else
{
//
// Assign the ground point to the latest iteration's intersection
// point:
//
gpt = ossimGpt(new_intersect_pt, datum);
//
// Determine if convergence achieved:
//
distance = (new_intersect_pt - prev_intersect_pt).magnitude();
if (distance < CONVERGENCE_THRESHOLD)
done = true;
else
{
prev_intersect_pt = new_intersect_pt;
}
}
iteration_count++;
//.........这里部分代码省略.........
示例12: lineSampleHeightToWorld
//*****************************************************************************
// METHOD: ossimRpcModel::lineSampleHeightToWorld()
//
// Performs reverse projection of image line/sample to ground point.
// The imaging ray is intersected with a level plane at height = elev.
//
// NOTE: U = line, V = sample -- this differs from the convention.
//
//*****************************************************************************
void ossimRpcModel::lineSampleHeightToWorld(const ossimDpt& image_point,
const double& ellHeight,
ossimGpt& gpt) const
{
// if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::lineSampleHeightToWorld: entering..." << std::endl;
//***
// Extrapolate if point is outside image:
//***
if (!insideImage(image_point))
{
// gpt = extrapolate(image_point, ellHeight);
// if (traceExec()) CLOG << "returning..." << endl;
gpt.makeNan();
return;
}
//***
// Constants for convergence tests:
//***
static const int MAX_NUM_ITERATIONS = 10;
static const double CONVERGENCE_EPSILON = 0.1; // pixels
//***
// The image point must be adjusted by the adjustable parameters as well
// as the scale and offsets given as part of the RPC param normalization.
//
// NOTE: U = line, V = sample
//***
double U = (image_point.y-theLineOffset - theIntrackOffset) / (theLineScale+theIntrackScale);
double V = (image_point.x-theSampOffset - theCrtrackOffset) / (theSampScale+theCrtrackScale);
//***
// Rotate the normalized U, V by the map rotation error (adjustable param):
//***
double U_rot = theCosMapRot*U - theSinMapRot*V;
double V_rot = theSinMapRot*U + theCosMapRot*V;
U = U_rot;
V = V_rot;
// now apply adjust intrack and cross track
//***
// Initialize quantities to be used in the iteration for ground point:
//***
double nlat = 0.0; // normalized latitude
double nlon = 0.0; // normalized longitude
double nhgt;
if(ossim::isnan(ellHeight))
{
nhgt = (theHgtScale - theHgtOffset) / theHgtScale; // norm height
}
else
{
nhgt = (ellHeight - theHgtOffset) / theHgtScale; // norm height
}
double epsilonU = CONVERGENCE_EPSILON/(theLineScale+theIntrackScale);
double epsilonV = CONVERGENCE_EPSILON/(theSampScale+theCrtrackScale);
int iteration = 0;
//***
// Declare variables only once outside the loop. These include:
// * polynomials (numerators Pu, Pv, and denominators Qu, Qv),
// * partial derivatives of polynomials wrt X, Y,
// * computed normalized image point: Uc, Vc,
// * residuals of normalized image point: deltaU, deltaV,
// * partial derivatives of Uc and Vc wrt X, Y,
// * corrections to normalized lat, lon: deltaLat, deltaLon.
//***
double Pu, Qu, Pv, Qv;
double dPu_dLat, dQu_dLat, dPv_dLat, dQv_dLat;
double dPu_dLon, dQu_dLon, dPv_dLon, dQv_dLon;
double Uc, Vc;
double deltaU, deltaV;
double dU_dLat, dU_dLon, dV_dLat, dV_dLon, W;
double deltaLat, deltaLon;
//***
// Now iterate until the computed Uc, Vc is within epsilon of the desired
// image point U, V:
//***
do
{
//***
// Calculate the normalized line and sample Uc, Vc as ratio of
// polynomials Pu, Qu and Pv, Qv:
//***
Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
//.........这里部分代码省略.........
示例13: lineSampleHeightToWorld
void ossimEquDistCylProjection::lineSampleHeightToWorld(const ossimDpt &lineSample,
const double& hgtEllipsoid,
ossimGpt& gpt)const
{
//
// make sure that the passed in lineSample is good and
// check to make sure our easting northing is good so
// we can compute the line sample.
//
//
if(lineSample.hasNans())
{
gpt.makeNan();
return;
}
if(theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
{
ossimMapProjection::lineSampleHeightToWorld(lineSample, hgtEllipsoid, gpt);
return;
}
else
{
if(theUlEastingNorthing.hasNans())
{
gpt.makeNan();
return;
}
ossimDpt eastingNorthing;
eastingNorthing = (theUlEastingNorthing);
eastingNorthing.x += (lineSample.x*theMetersPerPixel.x);
//
// Note: the Northing is positive up. In image space
// the positive axis is down so we must multiply by
// -1
//
eastingNorthing.y += (-lineSample.y*theMetersPerPixel.y);
//
// now invert the meters into a ground point.
//
gpt = inverse(eastingNorthing);
gpt.datum(theDatum);
if(gpt.isLatNan() && gpt.isLonNan())
{
gpt.makeNan();
}
else
{
// Finally assign the specified height:
gpt.hgt = hgtEllipsoid;
}
}
if(theElevationLookupFlag)
{
gpt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(gpt);
}
}