Commit f355d479 authored by Cédric Traizet's avatar Cédric Traizet Committed by Julien Osman

REFAC: use itk::Point instead of individual coordinates in Orbit parameters

parent 3af52e5d
......@@ -29,6 +29,8 @@
#include <vector>
#include <sstream>
#include "itkPoint.h"
namespace otb
{
......@@ -103,16 +105,14 @@ struct OTBMetadata_EXPORT SARNoise
*/
struct OTBMetadata_EXPORT Orbit
{
using PointType = itk::Point<double, 3>;
/** Timestamp at which orbit state vectors apply */
MetaData::Time time;
/** Position vector */
double posX;
double posY;
double posZ;
PointType position;
/** Velocity vector */
double velX;
double velY;
double velZ;
PointType velocity;
};
/** \struct SARParam
......
......@@ -334,14 +334,13 @@ std::vector<Orbit> CosmoImageMetadataInterface::getOrbits(const MetadataSupplier
orbit.time = time ;
orbit.posX = std::stod(vECEF_sat_pos[i*3 + 0]) ;
orbit.posY = std::stod(vECEF_sat_pos[i*3 + 1]) ;
orbit.posZ = std::stod(vECEF_sat_pos[i*3 + 2]) ;
orbit.velX = std::stod(vECEF_sat_vel[i*3 + 0]) ;
orbit.velY = std::stod(vECEF_sat_vel[i*3 + 1]) ;
orbit.velZ = std::stod(vECEF_sat_vel[i*3 + 2]) ;
orbit.position[0] = std::stod(vECEF_sat_pos[i*3 + 0]) ;
orbit.position[1] = std::stod(vECEF_sat_pos[i*3 + 1]) ;
orbit.position[2] = std::stod(vECEF_sat_pos[i*3 + 2]) ;
orbit.velocity[0] = std::stod(vECEF_sat_vel[i*3 + 0]) ;
orbit.velocity[1] = std::stod(vECEF_sat_vel[i*3 + 1]) ;
orbit.velocity[0] = std::stod(vECEF_sat_vel[i*3 + 2]) ;
orbitVector.push_back(orbit);
}
......
......@@ -415,12 +415,12 @@ std::vector<Orbit> Sentinel1ImageMetadataInterface::GetOrbits(const XMLMetadataS
std::string path_root = "product.generalAnnotation.orbitList.orbit_" + oss.str();
Orbit orbit;
std::istringstream(xmlMS.GetAs<std::string>(path_root + ".time")) >> orbit.time;
orbit.posX = xmlMS.GetAs<double>(path_root + ".position.x");
orbit.posY = xmlMS.GetAs<double>(path_root + ".position.y");
orbit.posZ = xmlMS.GetAs<double>(path_root + ".position.z");
orbit.velX = xmlMS.GetAs<double>(path_root + ".velocity.x");
orbit.velY = xmlMS.GetAs<double>(path_root + ".velocity.y");
orbit.velZ = xmlMS.GetAs<double>(path_root + ".velocity.z");
orbit.position[0] = xmlMS.GetAs<double>(path_root + ".position.x");
orbit.position[1] = xmlMS.GetAs<double>(path_root + ".position.y");
orbit.position[2] = xmlMS.GetAs<double>(path_root + ".position.z");
orbit.velocity[0] = xmlMS.GetAs<double>(path_root + ".velocity.x");
orbit.velocity[1] = xmlMS.GetAs<double>(path_root + ".velocity.y");
orbit.velocity[2] = xmlMS.GetAs<double>(path_root + ".velocity.z");
orbitVector.push_back(orbit);
}
return orbitVector;
......
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