Skip to content
Snippets Groups Projects
Commit a27f06da authored by Gaëlle USSEGLIO's avatar Gaëlle USSEGLIO
Browse files

ENH: Update new functions of otbSarSensorModelAdapter with the OTB usage

parent 4408f639
No related branches found
No related tags found
1 merge request!5Enhance otb sar sensor model adapter
......@@ -92,13 +92,13 @@ public:
(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) and satellite velocity */
bool WorldToSatPositionAndVelocity(const Point3DType & inGeoPoint, Point3DType & satelitePosition,
Point3DType & sateliteVelocity) const;
/** Transform world point (lat,lon,hgt) to cartesian point (x,y,z) */
static bool WorldToCartesian(const Point3DType & inGeoPoint, Point3DType & outCartesianPoint);
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);
......
......@@ -117,8 +117,8 @@ bool SarSensorModelAdapter::WorldToLineSampleYZ(const Point3DType & inGeoPoint,
}
ossimGpt inGpt;
inGpt.lat = inGeoPoint[0];
inGpt.lon = inGeoPoint[1];
inGpt.lon = inGeoPoint[0];
inGpt.lat = inGeoPoint[1];
inGpt.hgt = inGeoPoint[2];
ossimDpt outDpt;
......@@ -145,8 +145,8 @@ bool SarSensorModelAdapter::WorldToLineSample(const Point3DType & inGeoPoint, Po
}
ossimGpt inGpt;
inGpt.lat = inGeoPoint[0];
inGpt.lon = inGeoPoint[1];
inGpt.lon = inGeoPoint[0];
inGpt.lat = inGeoPoint[1];
inGpt.hgt = inGeoPoint[2];
ossimDpt outDpt;
......@@ -162,21 +162,14 @@ bool SarSensorModelAdapter::WorldToLineSample(const Point3DType & inGeoPoint, Po
return true;
}
bool SarSensorModelAdapter::WorldToCartesian(const Point3DType & inGeoPoint, Point3DType & outCartesianPoint) const
bool SarSensorModelAdapter::WorldToCartesian(const Point3DType & inGeoPoint, Point3DType & outCartesianPoint)
{
if(m_SensorModel.get() == ITK_NULLPTR)
{
return false;
}
ossimGpt inGpt;
inGpt.lat = inGeoPoint[0];
inGpt.lon = inGeoPoint[1];
inGpt.lon = inGeoPoint[0];
inGpt.lat = inGeoPoint[1];
inGpt.hgt = inGeoPoint[2];
ossimEcefPoint outCartesien(inGpt);
if(outCartesien.isNan())
return false;
......@@ -186,12 +179,11 @@ bool SarSensorModelAdapter::WorldToCartesian(const Point3DType & inGeoPoint, Poi
outCartesianPoint[2] = outCartesien.z();
return true;
}
bool SarSensorModelAdapter::WorldToSatPositionAndVelocity(const Point3DType & inGeoPoint,
Point3DType & satelitePosition,
Point3DType & sateliteVelocity) const
bool SarSensorModelAdapter::WorldToSatPositionAndVelocity(const Point3DType & inGeoPoint,
Point3DType & satelitePosition,
Point3DType & sateliteVelocity) const
{
if(m_SensorModel.get() == ITK_NULLPTR)
{
......@@ -199,10 +191,9 @@ bool SarSensorModelAdapter::WorldToCartesian(const Point3DType & inGeoPoint, Poi
}
ossimGpt inGpt;
inGpt.lat = inGeoPoint[0];
inGpt.lon = inGeoPoint[1];
inGpt.lon = inGeoPoint[0];
inGpt.lat = inGeoPoint[1];
inGpt.hgt = inGeoPoint[2];
ossimplugins::ossimSarSensorModel::TimeType azimuthTime;
double rangeTime;
......@@ -211,7 +202,7 @@ bool SarSensorModelAdapter::WorldToCartesian(const Point3DType & inGeoPoint, Poi
const bool success = m_SensorModel->worldToAzimuthRangeTime(inGpt, azimuthTime, rangeTime,sensorPos,sensorVel);
if(sensorPos.isNan())
if(sensorPos.isNan() || !success)
return false;
satelitePosition[0] = sensorPos.x();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment