Commit fdd36f69 authored by Cyrille Valladeau's avatar Cyrille Valladeau

MRG

parents b891c117 aca77cd9
......@@ -752,6 +752,17 @@ MARK_AS_ADVANCED(OTB_SHOW_ALL_MSG_DEBUG)
# ADD_DEFINITIONS(-DOTB_SHOW_ALL_MSG_DEBUG)
# ENDIF( OTB_SHOW_ALL_MSG_DEBUG )
OPTION(OTB_COMPILE_WITH_FULL_WARNING "OTB developers : Compilation with FULL warning (use only for otb developers)." OFF)
MARK_AS_ADVANCED(OTB_COMPILE_WITH_FULL_WARNING)
IF(OTB_COMPILE_WITH_FULL_WARNING)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(OTB_FULL_WARNING_LIST_PARAMETERS "-Wall -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -pedantic -Wuninitialized -Wparentheses -Wunknown-pragmas -Wswitch" CACHE STRING "List of compilation parameters.")
MARK_AS_ADVANCED(OTB_FULL_WARNING_LIST_PARAMETERS)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(OTB_COMPILE_WITH_FULL_WARNING)
#-----------------------------------------------------------------------------
# Advanced option to avoid recompiling utilities at each cmake reconfiguration
OPTION(OTB_DISABLE_UTILITIES_COMPILATION "Disable utilities compilation (developpers only - use at you own risk)" OFF)
......
......@@ -22,3 +22,10 @@ ENDIF(OTB_USE_VISU_GUI)
IF(OTB_USE_PQXX)
SUBDIRS(GeospatialAnalysis)
ENDIF(OTB_USE_PQXX)
IF(OTB_COMPILE_WITH_FULL_WARNING)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OTB_FULL_WARNING_LIST_PARAMETERS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OTB_FULL_WARNING_LIST_PARAMETERS}")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(OTB_COMPILE_WITH_FULL_WARNING)
......@@ -904,18 +904,17 @@ ImageMetadataInterface::GetQuickbirdPhysicalGain( const MetaDataDictionaryType &
}
}
//Value computed from
// http://www.geoeye.com/CorpSite/assets/docs/technical-papers/2009/IKONOS_Esun_Calculations.pdf
// to get the equivalent of the SPOT alpha
//Value computed from
// http://groups.google.com/group/otb-users/browse_thread/thread/bdd88b418c5076f4?pli=1
VariableLengthVectorType gain;
gain.SetSize(5);
if (isPost20030606)
{
gain[0] = 0.16200;//Pan
gain[1] = 0.23590;//Blue
gain[2] = 0.14530;//Green
gain[3] = 0.17850;//Red
gain[4] = 0.13530;//NIR
gain[0] = 1. / 0.16200;//Pan
gain[1] = 1. / 0.23590;//Blue
gain[2] = 1. / 0.14530;//Green
gain[3] = 1. / 0.17850;//Red
gain[4] = 1. / 0.13530;//NIR
}
else
{
......
......@@ -40,3 +40,10 @@ ELSE(OTB_BINARY_DIR)
MESSAGE("OTB not found. Please set OTB_DIR")
ENDIF(OTB_FOUND)
ENDIF(OTB_BINARY_DIR)
IF(OTB_COMPILE_WITH_FULL_WARNING)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OTB_FULL_WARNING_LIST_PARAMETERS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OTB_FULL_WARNING_LIST_PARAMETERS}")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(OTB_COMPILE_WITH_FULL_WARNING)
......@@ -18,7 +18,7 @@
#include <ossim/imaging/ossimUsgsDemTileSource.h>
#include <ossim/imaging/ossimLandsatTileSource.h>
#include <ossim/imaging/ossimGeneralRasterTileSource.h>
#include <ossim/imaging/ossimERSTileSource.h>
// #include <ossim/imaging/ossimERSTileSource.h>
#include <ossim/imaging/ossimVpfTileSource.h>
#include <ossim/imaging/ossimTileMapTileSource.h>
#include <ossim/base/ossimTrace.h>
......@@ -281,17 +281,17 @@ ossimImageHandler* ossimImageHandlerFactory::open(const ossimFilename& fileName)
}
delete result;
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "trying ERS" << std::endl;
}
result = new ossimERSTileSource;
if(result->open(copyFilename))
{
return result;
}
delete result;
// if(traceDebug())
// {
// ossimNotify(ossimNotifyLevel_DEBUG)
// << "trying ERS" << std::endl;
// }
// result = new ossimERSTileSource;
// if(result->open(copyFilename))
// {
// return result;
// }
// delete result;
// Note: SRTM should be in front of general raster...
if(traceDebug())
......@@ -592,17 +592,17 @@ ossimImageHandler* ossimImageHandlerFactory::open(const ossimKeywordlist& kwl,
}
delete result;
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "trying ERS" << std::endl;
}
result = new ossimERSTileSource;
if(result->loadState(kwl, prefix))
{
return result;
}
delete result;
// if(traceDebug())
// {
// ossimNotify(ossimNotifyLevel_DEBUG)
// << "trying ERS" << std::endl;
// }
// result = new ossimERSTileSource;
// if(result->loadState(kwl, prefix))
// {
// return result;
// }
// delete result;
// Note: SRTM should be in front of general raster...
if(traceDebug())
{
......@@ -681,10 +681,10 @@ ossimObject* ossimImageHandlerFactory::createObject(const ossimString& typeName)
{
return new ossimLandsatTileSource();
}
if(STATIC_TYPE_NAME(ossimERSTileSource) == typeName)
{
return new ossimERSTileSource();
}
// if(STATIC_TYPE_NAME(ossimERSTileSource) == typeName)
// {
// return new ossimERSTileSource();
// }
if(STATIC_TYPE_NAME(ossimSrtmTileSource) == typeName)
{
return new ossimSrtmTileSource();
......@@ -784,7 +784,7 @@ void ossimImageHandlerFactory::getTypeNameList(std::vector<ossimString>& typeLis
typeList.push_back(STATIC_TYPE_NAME(ossimTiffTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimUsgsDemTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimLandsatTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimERSTileSource));
// typeList.push_back(STATIC_TYPE_NAME(ossimERSTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimSrtmTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimGeneralRasterTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimTileMapTileSource));
......
......@@ -14,7 +14,7 @@
#include <ossim/imaging/ossimTerraSarTileSource.h>
//#include <ossim/imaging/ossimCosmoSkymedTileSource.h>
#include <ossim/imaging/ossimEnvisatAsarTileSource.h>
#include <ossim/imaging/ossimErsSarTileSource.h>
// #include <ossim/imaging/ossimErsSarTileSource.h>
......@@ -117,18 +117,18 @@ ossimImageHandler* ossimImageHandlerSarFactory::open(const ossimFilename& fileNa
// delete result;
// ERS
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "trying Ers Sar"
<< std::endl;
}
result = new ossimErsSarTileSource;
if(result->open(copyFilename))
{
return result;
}
delete result;
// if(traceDebug())
// {
// ossimNotify(ossimNotifyLevel_DEBUG)
// << "trying Ers Sar"
// << std::endl;
// }
// result = new ossimErsSarTileSource;
// if(result->open(copyFilename))
// {
// return result;
// }
// delete result;
//// Cosmo Skymed
//if(traceDebug())
......@@ -215,18 +215,18 @@ ossimImageHandler* ossimImageHandlerSarFactory::open(const ossimKeywordlist& kwl
}
delete result;
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "trying Ers Sar"
<< std::endl;
}
result = new ossimErsSarTileSource();
if(result->loadState(kwl, prefix))
{
return result;
}
delete result;
// if(traceDebug())
// {
// ossimNotify(ossimNotifyLevel_DEBUG)
// << "trying Ers Sar"
// << std::endl;
// }
// result = new ossimErsSarTileSource();
// if(result->loadState(kwl, prefix))
// {
// return result;
// }
// delete result;
/*if(traceDebug())
{
......@@ -268,10 +268,10 @@ ossimObject* ossimImageHandlerSarFactory::createObject(const ossimString& typeNa
{
return new ossimCosmoSkymedTileSource();
}*/
if(STATIC_TYPE_NAME(ossimErsSarTileSource) == typeName)
{
return new ossimErsSarTileSource();
}
// if(STATIC_TYPE_NAME(ossimErsSarTileSource) == typeName)
// {
// return new ossimErsSarTileSource();
// }
// if(STATIC_TYPE_NAME(ossimRadarSat2TileSource) == typeName)
// {
// return new ossimRadarSat2TileSource();
......@@ -338,6 +338,6 @@ void ossimImageHandlerSarFactory::getTypeNameList(std::vector<ossimString>& type
typeList.push_back(STATIC_TYPE_NAME(ossimTerraSarTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimEnvisatAsarTileSource));
//typeList.push_back(STATIC_TYPE_NAME(ossimCosmoSkymedTileSource));
typeList.push_back(STATIC_TYPE_NAME(ossimErsSarTileSource));
// typeList.push_back(STATIC_TYPE_NAME(ossimErsSarTileSource));
// typeList.push_back(STATIC_TYPE_NAME(ossimRadarSat2TileSource));
}
......@@ -51,7 +51,7 @@ static ossimTrace traceDebug = ossimTrace("ossimSensorModelFactory:debug");
#include <ossim/projection/ossimTerraSarModel.h>
//#include <ossim/projection/ossimCosmoSkymedModel.h>
// #include <ossim/projection/ossimRadarSat2Model.h>
#include <ossim/projection/ossimErsSarModel.h>
// #include <ossim/projection/ossimErsSarModel.h>
#include <ossim/projection/ossimTileMapModel.h>
//***
......@@ -212,10 +212,10 @@ ossimSensorModelFactory::createProjection(const ossimString &name) const
// {
// return new ossimRadarSat2Model;
// }
if (name == STATIC_TYPE_NAME(ossimErsSarModel))
{
return new ossimErsSarModel;
}
// if (name == STATIC_TYPE_NAME(ossimErsSarModel))
// {
// return new ossimErsSarModel;
// }
//***
// ADD_MODEL: (Please leave this comment for the next programmer)
//***
......@@ -268,7 +268,7 @@ ossimSensorModelFactory::getTypeNameList(std::vector<ossimString>& typeList)
typeList.push_back(STATIC_TYPE_NAME(ossimTerraSarModel));
// typeList.push_back(STATIC_TYPE_NAME(ossimCosmoSkymedModel));
typeList.push_back(STATIC_TYPE_NAME(ossimEnvisatAsarModel));
typeList.push_back(STATIC_TYPE_NAME(ossimErsSarModel));
// typeList.push_back(STATIC_TYPE_NAME(ossimErsSarModel));
typeList.push_back(STATIC_TYPE_NAME(ossimTileMapModel));
//***
// ADD_MODEL: Please leave this comment for the next programmer. Add above.
......
//----------------------------------------------------------------------------
//
// "Copyright Centre National d'Etudes Spatiales"
//
// License: LGPL
//
// See LICENSE.txt file in the top level directory for more details.
//
//----------------------------------------------------------------------------
// $Id$
#include "ers/ErsSar/ErsSarLeader/ErsSarFileDescriptor.h"
namespace ossimplugins
{
ErsSarFileDescriptor::ErsSarFileDescriptor() : ErsSarRecord("sar_desc_rec")
{
}
ErsSarFileDescriptor::~ErsSarFileDescriptor()
{
}
std::ostream& operator<<(std::ostream& os, const ErsSarFileDescriptor& data)
{
os<<"ascii_flag:"<<data._ascii_flag.c_str()<<std::endl;
os<<"format_doc:"<<data._format_doc.c_str()<<std::endl;
os<<"format_ver:"<<data._format_ver.c_str()<<std::endl;
os<<"design_rev:"<<data._design_rev.c_str()<<std::endl;
os<<"software_id:"<<data._software_id.c_str()<<std::endl;
os<<"file_num:"<<data._file_num<<std::endl;
os<<"file_name:"<<data._file_name.c_str()<<std::endl;
os<<"rec_seq:"<<data._rec_seq.c_str()<<std::endl;
os<<"seq_loc:"<<data._seq_loc<<std::endl;
os<<"seq_len:"<<data._seq_len<<std::endl;
os<<"rec_code:"<<data._rec_code.c_str()<<std::endl;
os<<"code_loc:"<<data._code_loc<<std::endl;
os<<"code_len:"<<data._code_len<<std::endl;
os<<"rec_len:"<<data._rec_len.c_str()<<std::endl;
os<<"rlen_loc:"<<data._rlen_loc<<std::endl;
os<<"rlen_len:"<<data._rlen_len<<std::endl;
os<<"n_dataset:"<<data._n_dataset<<std::endl;
os<<"l_dataset:"<<data._l_dataset<<std::endl;
os<<"n_map_proj:"<<data._n_map_proj<<std::endl;
os<<"l_map_proj:"<<data._l_map_proj<<std::endl;
os<<"n_plat_pos:"<<data._n_plat_pos<<std::endl;
os<<"l_plat_pos:"<<data._l_plat_pos<<std::endl;
os<<"n_att_data:"<<data._n_att_data<<std::endl;
os<<"l_att_data:"<<data._l_att_data<<std::endl;
os<<"n_radi_data:"<<data._n_radi_data<<std::endl;
os<<"l_radi_data:"<<data._l_radi_data<<std::endl;
os<<"n_radi_comp:"<<data._n_radi_comp<<std::endl;
os<<"l_radi_comp:"<<data._l_radi_comp<<std::endl;
os<<"n_qual_sum:"<<data._n_qual_sum<<std::endl;
os<<"l_qual_sum:"<<data._l_qual_sum<<std::endl;
os<<"n_data_his:"<<data._n_data_his<<std::endl;
os<<"l_data_his:"<<data._l_data_his<<std::endl;
os<<"n_rang_spec:"<<data._n_rang_spec<<std::endl;
os<<"l_rang_spec:"<<data._l_rang_spec<<std::endl;
os<<"n_dem_desc:"<<data._n_dem_desc<<std::endl;
os<<"l_dem_desc:"<<data._l_dem_desc<<std::endl;
os<<"n_radar_par:"<<data._n_radar_par<<std::endl;
os<<"l_radar_par:"<<data._l_radar_par<<std::endl;
os<<"n_anno_data:"<<data._n_anno_data<<std::endl;
os<<"l_anno_data:"<<data._l_anno_data<<std::endl;
os<<"n_det_proc:"<<data._n_det_proc<<std::endl;
os<<"l_det_proc:"<<data._l_det_proc<<std::endl;
os<<"n_cal:"<<data._n_cal<<std::endl;
os<<"l_cal:"<<data._l_cal<<std::endl;
os<<"n_gcp:"<<data._n_gcp<<std::endl;
os<<"l_gcp:"<<data._l_gcp<<std::endl;
os<<"n_fac_data:"<<data._n_fac_data<<std::endl;
os<<"l_fac_data:"<<data._l_fac_data<<std::endl;
return os;
}
std::istream& operator>>(std::istream& is, ErsSarFileDescriptor& data)
{
char buf2[3];
buf2[2] = '\0';
char buf12[13];
buf12[12] = '\0';
char buf16[17];
buf16[16] = '\0';
char buf4[5];
buf4[4] = '\0';
char buf6[7];
buf6[6] = '\0';
char buf8[9];
buf8[8] = '\0';
char buf64[65];
buf64[64] = '\0';
char buf60[61];
buf60[60] = '\0';
char buf288[289];
buf288[288] = '\0';
is.read(buf2,2);
data._ascii_flag = buf2;
is.read(buf2,2);
is.read(buf12,12);
data._format_doc = buf12;
is.read(buf2,2);
data._format_ver = buf2;
is.read(buf2,2);
data._design_rev = buf2;
is.read(buf12,12);
data._software_id = buf12;
is.read(buf4,4);
data._file_num = atoi(buf4);
is.read(buf16,16);
data._file_name = buf16;
is.read(buf4,4);
data._rec_seq = buf4;
is.read(buf8,8);
data._seq_loc = atoi(buf8);
is.read(buf4,4);
data._seq_len = atoi(buf4);
is.read(buf4,4);
data._rec_code = buf4;
is.read(buf8,8);
data._code_loc = atoi(buf8);
is.read(buf4,4);
data._code_len = atoi(buf4);
is.read(buf4,4);
data._rec_len = buf4;
is.read(buf8,8);
data._rlen_loc = atoi(buf8);
is.read(buf4,4);
data._rlen_len = atoi(buf4);
is.read(buf4,4);
is.read(buf64,64);
is.read(buf6,6);
data._n_dataset = atoi(buf6);
is.read(buf6,6);
data._l_dataset = atoi(buf6);
is.read(buf6,6);
data._n_map_proj = atoi(buf6);
is.read(buf6,6);
data._l_map_proj = atoi(buf6);
is.read(buf6,6);
data._n_plat_pos = atoi(buf6);
is.read(buf6,6);
data._l_plat_pos = atoi(buf6);
is.read(buf6,6);
data._n_att_data = atoi(buf6);
is.read(buf6,6);
data._l_att_data = atoi(buf6);
is.read(buf6,6);
data._n_radi_data = atoi(buf6);
is.read(buf6,6);
data._l_radi_data = atoi(buf6);
is.read(buf6,6);
data._n_radi_comp = atoi(buf6);
is.read(buf6,6);
data._l_radi_comp = atoi(buf6);
is.read(buf6,6);
data._n_qual_sum = atoi(buf6);
is.read(buf6,6);
data._l_qual_sum = atoi(buf6);
is.read(buf6,6);
data._n_data_his = atoi(buf6);
is.read(buf6,6);
data._l_data_his = atoi(buf6);
is.read(buf6,6);
data._n_rang_spec = atoi(buf6);
is.read(buf6,6);
data._l_rang_spec = atoi(buf6);
is.read(buf6,6);
data._n_dem_desc = atoi(buf6);
is.read(buf6,6);
data._l_dem_desc = atoi(buf6);
is.read(buf6,6);
data._n_radar_par = atoi(buf6);
is.read(buf6,6);
data._l_radar_par = atoi(buf6);
is.read(buf6,6);
data._n_anno_data = atoi(buf6);
is.read(buf6,6);
data._l_anno_data = atoi(buf6);
is.read(buf6,6);
data._n_det_proc = atoi(buf6);
is.read(buf6,6);
data._l_det_proc = atoi(buf6);
is.read(buf6,6);
data._n_cal = atoi(buf6);
is.read(buf6,6);
data._l_cal = atoi(buf6);
is.read(buf6,6);
data._n_gcp = atoi(buf6);
is.read(buf6,6);
data._l_gcp = atoi(buf6);
is.read(buf60,60);
is.read(buf6,6);
data._n_fac_data = atoi(buf6);
is.read(buf6,6);
data._l_fac_data = atoi(buf6);
is.read(buf288,288);
return is;
}
ErsSarFileDescriptor::ErsSarFileDescriptor(const ErsSarFileDescriptor& rhs):
ErsSarRecord(rhs),
_ascii_flag(rhs._ascii_flag),
_format_doc(rhs._format_doc),
_format_ver(rhs._format_ver),
_design_rev(rhs._design_rev),
_software_id(rhs._software_id),
_file_num(rhs._file_num),
_file_name(rhs._file_name),
_rec_seq(rhs._rec_seq),
_seq_loc(rhs._seq_loc),
_seq_len(rhs._seq_len),
_rec_code(rhs._rec_code),
_code_loc(rhs._code_loc),
_code_len(rhs._code_len),
_rec_len(rhs._rec_len),
_rlen_loc(rhs._rlen_loc),
_rlen_len(rhs._rlen_len),
_n_dataset(rhs._n_dataset),
_l_dataset(rhs._l_dataset),
_n_map_proj(rhs._n_map_proj),
_l_map_proj(rhs._l_map_proj),
_n_plat_pos(rhs._n_plat_pos),
_l_plat_pos(rhs._l_plat_pos),
_n_att_data(rhs._n_att_data),
_l_att_data(rhs._l_att_data),
_n_radi_data(rhs._n_radi_data),
_l_radi_data(rhs._l_radi_data),
_n_radi_comp(rhs._n_radi_comp),
_l_radi_comp(rhs._l_radi_comp),
_n_qual_sum(rhs._n_qual_sum),
_l_qual_sum(rhs._l_qual_sum),
_n_data_his(rhs._n_data_his),
_l_data_his(rhs._l_data_his),
_n_rang_spec(rhs._n_rang_spec),
_l_rang_spec(rhs._l_rang_spec),
_n_dem_desc(rhs._n_dem_desc),
_l_dem_desc(rhs._l_dem_desc),
_n_radar_par(rhs._n_radar_par),
_l_radar_par(rhs._l_radar_par),
_n_anno_data(rhs._n_anno_data),
_l_anno_data(rhs._l_anno_data),
_n_det_proc(rhs._n_det_proc),
_l_det_proc(rhs._l_det_proc),
_n_cal(rhs._n_cal),
_l_cal(rhs._l_cal),
_n_gcp(rhs._n_gcp),
_l_gcp(rhs._l_gcp),
_n_fac_data(rhs._n_fac_data),
_l_fac_data(rhs._l_fac_data)
{
}
ErsSarFileDescriptor& ErsSarFileDescriptor::operator=(const ErsSarFileDescriptor& rhs)
{
_ascii_flag = rhs._ascii_flag;
_format_doc = rhs._format_doc;
_format_ver = rhs._format_ver;
_design_rev = rhs._design_rev;
_software_id = rhs._software_id;
_file_num = rhs._file_num;
_file_name = rhs._file_name;
_rec_seq = rhs._rec_seq;
_seq_loc = rhs._seq_loc;
_seq_len = rhs._seq_len;
_rec_code = rhs._rec_code;
_code_loc = rhs._code_loc;
_code_len = rhs._code_len;
_rec_len = rhs._rec_len;
_rlen_loc = rhs._rlen_loc;
_rlen_len = rhs._rlen_len;
_n_dataset = rhs._n_dataset;
_l_dataset = rhs._l_dataset;
_n_map_proj = rhs._n_map_proj;
_l_map_proj = rhs._l_map_proj;
_n_plat_pos = rhs._n_plat_pos;
_l_plat_pos = rhs._l_plat_pos;
_n_att_data = rhs._n_att_data;
_l_att_data = rhs._l_att_data;
_n_radi_data = rhs._n_radi_data;
_l_radi_data = rhs._l_radi_data;
_n_radi_comp = rhs._n_radi_comp;
_l_radi_comp = rhs._l_radi_comp;
_n_qual_sum = rhs._n_qual_sum ;
_l_qual_sum = rhs._l_qual_sum;
_n_data_his = rhs._n_data_his;
_l_data_his = rhs._l_data_his;
_n_rang_spec = rhs._n_rang_spec;
_l_rang_spec = rhs._l_rang_spec;
_n_dem_desc = rhs._n_dem_desc;
_l_dem_desc = rhs._l_dem_desc;