Commit 8a4e5a6a authored by Cédric Traizet's avatar Cédric Traizet
Browse files

BUG: don't use IageMetadataInterface date getters in...

BUG: don't use IageMetadataInterface date getters in ConvertStringTimeUTCToJulianDay as they return the starting date, not the input date
parent c6dcb950
......@@ -490,23 +490,24 @@ int TerraSarXSarImageMetadataInterface::GetProductionYear() const
double TerraSarXSarImageMetadataInterface::ConvertStringTimeUTCToJulianDay(const std::string& value) const
{
std::vector<std::string> splitDate;
boost::split(splitDate, value, boost::is_any_of("-T:"));
int year = this->GetYear();
int month = this->GetMonth();
int day = this->GetDay();
int hour = this->GetHour();
int minu = this->GetMinute();
double sec = 0;
boost::split(splitDate, value, boost::is_any_of("-T:Z"));
int year, month, day, hour, minu;
double sec;
try
{
sec = std::stod(splitDate[5]);
}
{
year = std::stoi(splitDate[0].c_str());
month = std::stoi(splitDate[1].c_str());
day = std::stoi(splitDate[2].c_str());
hour = std::stoi(splitDate[3].c_str());
minu = std::stoi(splitDate[4].c_str());
sec = std::stod(splitDate[5].c_str());
}
catch( ... )
{
// Throw an exception
throw std::runtime_error("Failed to seconds.");
}
{
throw std::runtime_error("Failed to parse input date ");
}
// Conversion to julian day
// according to http://en.wikipedia.org/wiki/Julian_day
......
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