Commit 7da52347 authored by Gaëlle USSEGLIO's avatar Gaëlle USSEGLIO
Browse files

ENH : Update of SarSensorModelAdapter with 2 two new functions

parent b02e0e07
......@@ -91,7 +91,13 @@ public:
/** Transform world point (lat,lon,hgt) to input image point
(col,row) */
bool WorldToLineSample(const Point3DType & inGEoPOint, Point2DType & cr) const;
/** Transform world point (lat,lon,hgt) to cartesian point (x,y,z) */
bool WorldToCartesian(const Point3DType & inGeoPoint, Point3DType & outCartesianPoint) const;
/** Transform world point (lat,lon,hgt) to satellite position (x,y,z)*/
bool WorldToSatPosition(const Point3DType & inGeoPoint, Point3DType & satelitePosition) const;
static bool ImageLineToDeburstLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long imageLine, unsigned long & deburstLine);
static void DeburstLineToImageLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long deburstLine, unsigned long & imageLine);
......
......@@ -162,6 +162,62 @@ bool SarSensorModelAdapter::WorldToLineSample(const Point3DType & inGeoPoint, Po
return true;
}
bool SarSensorModelAdapter::WorldToCartesian(const Point3DType & inGeoPoint, Point3DType & outCartesianPoint) const
{
if(m_SensorModel.get() == ITK_NULLPTR)
{
return false;
}
ossimGpt inGpt;
inGpt.lat = inGeoPoint[0];
inGpt.lon = inGeoPoint[1];
inGpt.hgt = inGeoPoint[2];
ossimEcefPoint outCartesien(inGpt);
if(outCartesien.isNan())
return false;
outCartesianPoint[0] = outCartesien.x();
outCartesianPoint[1] = outCartesien.y();
outCartesianPoint[2] = outCartesien.z();
return true;
}
bool SarSensorModelAdapter::WorldToSatPosition(const Point3DType & inGeoPoint, Point3DType & satelitePosition) const
{
if(m_SensorModel.get() == ITK_NULLPTR)
{
return false;
}
ossimGpt inGpt;
inGpt.lat = inGeoPoint[0];
inGpt.lon = inGeoPoint[1];
inGpt.hgt = inGeoPoint[2];
ossimplugins::ossimSarSensorModel::TimeType azimuthTime;
double rangeTime;
ossimEcefPoint sensorPos;
ossimEcefVector sensorVel;
const bool success = m_SensorModel->worldToAzimuthRangeTime(inGpt, azimuthTime, rangeTime,sensorPos,sensorVel);
if(sensorPos.isNan())
return false;
satelitePosition[0] = sensorPos.x();
satelitePosition[1] = sensorPos.y();
satelitePosition[2] = sensorPos.z();
return true;
}
} // namespace otb
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment