Skip to content
Snippets Groups Projects
Commit 0d843220 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

OSSIM: updating ossimplugins/ossim to r15063

parent df23e810
No related branches found
No related tags found
No related merge requests found
......@@ -379,7 +379,7 @@ bool ossimCosmoSkymedModel::UtcDateTimeStringToCivilDate(const std::string &utcS
outputDate.set_year(atoi(year_str));
outputDate.set_month(atoi(month_str));
outputDate.set_day(atoi(day_str));
outputDate.set_second(0);
outputDate.set_second(0.0);
outputDate.set_decimal(0.0);
return true ;
......
......@@ -155,6 +155,17 @@ bool ossimRadarSat2Model::open(const ossimFilename& file)
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "isRadarSat2...\n";
ossimString s;
if ( rsDoc.getBeamModeMnemonic(xdoc, s) )
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "beam_mode_mnemonic: " << s << "\n";
}
if ( rsDoc.getAcquisitionType(xdoc, s) )
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "acquisition_type: " << s << "\n";
}
}
// Set the base class number of lines and samples
......
......@@ -628,6 +628,13 @@ bool ossimRadarSat2ProductDoc::getSensor(const ossimXmlDocument* xdoc,
return ossim::getPath(path, xdoc, s);
}
bool ossimRadarSat2ProductDoc::getBeamModeMnemonic(
const ossimXmlDocument* xdoc, ossimString& s) const
{
ossimString path = "/product/sourceAttributes/beamModeMnemonic";
return ossim::getPath(path, xdoc, s);
}
bool ossimRadarSat2ProductDoc::getImageId(const ossimXmlDocument* xdoc,
ossimString& s) const
{
......@@ -635,6 +642,14 @@ bool ossimRadarSat2ProductDoc::getImageId(const ossimXmlDocument* xdoc,
return ossim::getPath(path, xdoc, s);
}
bool ossimRadarSat2ProductDoc::getAcquisitionType(
const ossimXmlDocument* xdoc, ossimString& s) const
{
ossimString path =
"/product/sourceAttributes/radarParameters/acquisitionType";
return ossim::getPath(path, xdoc, s);
}
bool ossimRadarSat2ProductDoc::getRadarCenterFrequency(
const ossimXmlDocument* xdoc, ossimString& s) const
{
......
......@@ -107,9 +107,17 @@ public:
bool getSensor(const ossimXmlDocument* xdoc,
ossimString& s) const;
/** /product/sourceAttributes/beamModeMnemonic */
bool getBeamModeMnemonic(const ossimXmlDocument* xdoc,
ossimString& s) const;
bool getImageId(const ossimXmlDocument* xdoc,
ossimString& s) const;
/** /product/sourceAttributes/radarParameters/acquisitionType */
bool getAcquisitionType(const ossimXmlDocument* xdoc,
ossimString& s) const;
bool getRadarCenterFrequency(const ossimXmlDocument* xdoc,
ossimString& s) const;
......
//----------------------------------------------------------------------------
//
// "Copyright Centre National d'Etudes Spatiales"
//
// License: LGPL
//
// See LICENSE.txt file in the top level directory for more details.
//
//----------------------------------------------------------------------------
// $Id$
#include <SensorParams.h>
#include <ossim/base/ossimKeywordlist.h>
#include <ossim/base/ossimString.h>
namespace ossimplugins
{
static const char PREFIX[] = "sensor_params.";
static const char PRF_KW[] = "prf";
static const char SF_KW[] = "sampling_frequency";
static const char RWL_KW[] = "radar_wave_length";
static const char COL_DIR_KW[] = "column_direction";
static const char LIN_DIR_KW[] = "line_direction";
static const char SIGHT_DIR_KW[] = "sight_direction";
static const char SEMI_MAJOR_AXIS_KW[] = "semi_major_axis";
static const char SEMI_MINOR_AXIS_KW[] = "semi_minor_axis";
static const char NUM_AZIMUTH_LOOKS_KW[] = "number_azimuth_looks";
static const char NUM_RANGE_LOOKS_KW[] = "number_range_looks";
SensorParams::SensorParams():
_prf(0.0),
_sf(0.0),
_rwl(0.0),
_col_direction(1),
_lin_direction(1),
_sightDirection(Right),
_semiMajorAxis(6378137.0),
_semiMinorAxis(6356752.3141),
_nAzimuthLook(1),
_nRangeLook(1)
{
}
SensorParams::~SensorParams()
{
}
SensorParams::SensorParams(const SensorParams& rhs):
_prf(rhs._prf),
_sf(rhs._sf),
_rwl(rhs._rwl),
_col_direction(rhs._col_direction),
_lin_direction(rhs._lin_direction),
_sightDirection(rhs._sightDirection),
_semiMajorAxis(rhs._semiMajorAxis),
_semiMinorAxis(rhs._semiMinorAxis),
_nAzimuthLook(rhs._nAzimuthLook),
_nRangeLook(rhs._nRangeLook)
{
}
SensorParams& SensorParams::operator=(const SensorParams& rhs)
{
_prf = rhs._prf;
_sf = rhs._sf;
_rwl = rhs._rwl;
_col_direction = rhs._col_direction;
_lin_direction = rhs._lin_direction;
_sightDirection = rhs._sightDirection;
_semiMajorAxis = rhs._semiMajorAxis;
_semiMinorAxis = rhs._semiMinorAxis;
_nAzimuthLook = rhs._nAzimuthLook;
_nRangeLook = rhs._nRangeLook;
_semiMajorAxis = rhs._semiMajorAxis;
_semiMinorAxis = rhs._semiMinorAxis;
return *this;
}
bool SensorParams::saveState(ossimKeywordlist& kwl, const char* prefix) const
{
std::string pfx;
if (prefix)
{
pfx = prefix;
}
pfx += PREFIX;
kwl.add(pfx.c_str(), PRF_KW, _prf);
kwl.add(pfx.c_str(), SF_KW, _sf);
kwl.add(pfx.c_str(), RWL_KW, _rwl);
kwl.add(pfx.c_str(), COL_DIR_KW, _col_direction);
kwl.add(pfx.c_str(), LIN_DIR_KW, _lin_direction);
kwl.add(pfx.c_str(), SIGHT_DIR_KW, static_cast<int>(_sightDirection));
kwl.add(pfx.c_str(), SEMI_MAJOR_AXIS_KW, _semiMajorAxis);
kwl.add(pfx.c_str(), SEMI_MINOR_AXIS_KW, _semiMinorAxis);
kwl.add(pfx.c_str(), NUM_AZIMUTH_LOOKS_KW, _nAzimuthLook);
kwl.add(pfx.c_str(), NUM_RANGE_LOOKS_KW, _nRangeLook);
return true;
}
bool SensorParams::loadState(const ossimKeywordlist& kwl, const char* prefix)
{
bool result = true;
std::string pfx;
if (prefix)
{
pfx = prefix;
}
pfx += PREFIX;
ossimString s;
const char* lookup = 0;
lookup = kwl.find(pfx.c_str(), PRF_KW);
if (lookup)
{
s = lookup;
_prf = s.toDouble();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), SF_KW);
if (lookup)
{
s = lookup;
_sf = s.toDouble();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), RWL_KW);
if (lookup)
{
s = lookup;
_rwl = s.toDouble();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), COL_DIR_KW);
if (lookup)
{
s = lookup;
_col_direction = s.toInt();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), LIN_DIR_KW);
if (lookup)
{
s = lookup;
_lin_direction = s.toInt();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), SIGHT_DIR_KW);
if (lookup)
{
s = lookup;
if ( s.toInt() == 0 )
{
_sightDirection = SensorParams::Left;
}
else
{
_sightDirection = SensorParams::Right;
}
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), SEMI_MAJOR_AXIS_KW);
if (lookup)
{
s = lookup;
_semiMajorAxis = s.toDouble();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), SEMI_MINOR_AXIS_KW);
if (lookup)
{
s = lookup;
_semiMinorAxis = s.toDouble();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), NUM_AZIMUTH_LOOKS_KW);
if (lookup)
{
s = lookup;
_nAzimuthLook = s.toDouble();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), NUM_RANGE_LOOKS_KW);
if (lookup)
{
s = lookup;
_nRangeLook = s.toDouble();
}
else
{
result = false;
}
return result;
}
}
//----------------------------------------------------------------------------
//
// "Copyright Centre National d'Etudes Spatiales"
//
// License: LGPL
//
// See LICENSE.txt file in the top level directory for more details.
//
//----------------------------------------------------------------------------
// $Id$
#include <SensorParams.h>
#include <ossim/base/ossimKeywordlist.h>
#include <ossim/base/ossimString.h>
namespace ossimplugins
{
static const char PREFIX[] = "sensor_params.";
static const char PRF_KW[] = "prf";
static const char SF_KW[] = "sampling_frequency";
static const char RWL_KW[] = "radar_wave_length";
static const char COL_DIR_KW[] = "column_direction";
static const char LIN_DIR_KW[] = "line_direction";
static const char SIGHT_DIR_KW[] = "sight_direction";
static const char SEMI_MAJOR_AXIS_KW[] = "semi_major_axis";
static const char SEMI_MINOR_AXIS_KW[] = "semi_minor_axis";
static const char NUM_AZIMUTH_LOOKS_KW[] = "number_azimuth_looks";
static const char NUM_RANGE_LOOKS_KW[] = "number_range_looks";
SensorParams::SensorParams():
_prf(0.0),
_sf(0.0),
_rwl(0.0),
_col_direction(1),
_lin_direction(1),
_sightDirection(Right),
_semiMajorAxis(6378137.0),
_semiMinorAxis(6356752.3141),
_nAzimuthLook(1),
_nRangeLook(1)
{
}
SensorParams::~SensorParams()
{
}
SensorParams::SensorParams(const SensorParams& rhs):
_prf(rhs._prf),
_sf(rhs._sf),
_rwl(rhs._rwl),
_col_direction(rhs._col_direction),
_lin_direction(rhs._lin_direction),
_sightDirection(rhs._sightDirection),
_semiMajorAxis(rhs._semiMajorAxis),
_semiMinorAxis(rhs._semiMinorAxis),
_nAzimuthLook(rhs._nAzimuthLook),
_nRangeLook(rhs._nRangeLook)
{
}
SensorParams& SensorParams::operator=(const SensorParams& rhs)
{
_prf = rhs._prf;
_sf = rhs._sf;
_rwl = rhs._rwl;
_col_direction = rhs._col_direction;
_lin_direction = rhs._lin_direction;
_sightDirection = rhs._sightDirection;
_semiMajorAxis = rhs._semiMajorAxis;
_semiMinorAxis = rhs._semiMinorAxis;
_nAzimuthLook = rhs._nAzimuthLook;
_nRangeLook = rhs._nRangeLook;
_semiMajorAxis = rhs._semiMajorAxis;
_semiMinorAxis = rhs._semiMinorAxis;
return *this;
}
bool SensorParams::saveState(ossimKeywordlist& kwl, const char* prefix) const
{
std::string pfx;
if (prefix)
{
pfx = prefix;
}
pfx += PREFIX;
kwl.add(pfx.c_str(), PRF_KW, _prf);
kwl.add(pfx.c_str(), SF_KW, _sf);
kwl.add(pfx.c_str(), RWL_KW, _rwl);
kwl.add(pfx.c_str(), COL_DIR_KW, _col_direction);
kwl.add(pfx.c_str(), LIN_DIR_KW, _lin_direction);
kwl.add(pfx.c_str(), SIGHT_DIR_KW, static_cast<int>(_sightDirection));
kwl.add(pfx.c_str(), SEMI_MAJOR_AXIS_KW, _semiMajorAxis);
kwl.add(pfx.c_str(), SEMI_MINOR_AXIS_KW, _semiMinorAxis);
kwl.add(pfx.c_str(), NUM_AZIMUTH_LOOKS_KW, _nAzimuthLook);
kwl.add(pfx.c_str(), NUM_RANGE_LOOKS_KW, _nRangeLook);
return true;
}
bool SensorParams::loadState(const ossimKeywordlist& kwl, const char* prefix)
{
bool result = true;
std::string pfx;
if (prefix)
{
pfx = prefix;
}
pfx += PREFIX;
ossimString s;
const char* lookup = 0;
lookup = kwl.find(pfx.c_str(), PRF_KW);
if (lookup)
{
s = lookup;
_prf = s.toDouble();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), SF_KW);
if (lookup)
{
s = lookup;
_sf = s.toDouble();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), RWL_KW);
if (lookup)
{
s = lookup;
_rwl = s.toDouble();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), COL_DIR_KW);
if (lookup)
{
s = lookup;
_col_direction = s.toInt();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), LIN_DIR_KW);
if (lookup)
{
s = lookup;
_lin_direction = s.toInt();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), SIGHT_DIR_KW);
if (lookup)
{
s = lookup;
if ( s.toInt() == 0 )
{
_sightDirection = SensorParams::Left;
}
else
{
_sightDirection = SensorParams::Right;
}
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), SEMI_MAJOR_AXIS_KW);
if (lookup)
{
s = lookup;
_semiMajorAxis = s.toDouble();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), SEMI_MINOR_AXIS_KW);
if (lookup)
{
s = lookup;
_semiMinorAxis = s.toDouble();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), NUM_AZIMUTH_LOOKS_KW);
if (lookup)
{
s = lookup;
_nAzimuthLook = s.toDouble();
}
else
{
result = false;
}
lookup = kwl.find(pfx.c_str(), NUM_RANGE_LOOKS_KW);
if (lookup)
{
s = lookup;
_nRangeLook = s.toDouble();
}
else
{
result = false;
}
return result;
}
}
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