Commit 43f05676 authored by Emmanuel Christophe's avatar Emmanuel Christophe

OSSIM: synch ossim AND ossimplugins with r18162 (almost no patch left: just tilemap)

parent 88e2e453
......@@ -28,7 +28,7 @@ OTB-v.3.6.0 - Changes since version 3.4.0 (2010/??/??)
* System
* Internal ITK updated to 3.20.0 + OTB Patches
* Internal OSSIM and ossim plugins updated to svn revision 18139 + OTB patches
* Internal OSSIM and ossim plugins updated to svn revision 18162 + OTB patches (almost none left)
* Enable the use of an external build of libLAS
* Fix internal libkml for MSVC 2010
......
......@@ -17,13 +17,13 @@ extern "C"
#include <cstdio> /** for size_t */
#include <csetjmp> /** for jmp_buf */
#include <jpeglib.h> /** for jpeg stuff */
//#include <jinclude.h>
//#include <jerror.h>
/**
* @brief Method which uses memory instead of a FILE* to read from.
* @note Used in place of "jpeg_stdio_src(&cinfo, infile)".
*/
OSSIM_DLL void ossimJpegStdIOSrc ( j_decompress_ptr cinfo,
FILE* infile);
//#include <jinclude.h>
//#include <jerror.h>
/**
* @brief Method which uses memory instead of a FILE* to read from.
* @note Used in place of "jpeg_stdio_src(&cinfo, infile)".
*/
OSSIM_DLL void ossimJpegStdIOSrc ( j_decompress_ptr cinfo,
FILE* infile);
}
#endif /* #ifndef ossimJpegMemSrc_HEADER */
......@@ -55,6 +55,151 @@ public:
virtual std::ostream& print(std::ostream& out,
const std::string& prefix) const;
/**
* @brief Get the SENSOR field.
* @return The SENSOR field as a string.
*/
ossimString getSensor() const;
/**
* @brief Get the TIME_FIRST_LINE_IMAGE field.
* @return The TIME_FIRST_LINE_IMAGE field as a string.
*/
ossimString getTimeFirstLineImage() const;
/**
* @brief Get the TIME_IMAGE_DURATION field.
* @return The TIME_IMAGE_DURATION field as a string.
*/
ossimString getTimeImageDuration() const;
/**
* @brief Get the MAX_GSDfield.
* @return The MAX_GSD field as a string.
*/
ossimString getMaxGsd() const;
/**
* @brief Get the ALONG_SCAN_GSD field.
* @return The ALONG_SCAN_GSD field as a string.
*/
ossimString getAlongScanGsd() const;
/**
* @brief Get the CROSS_SCAN_GSD field.
* @return TheCROSS_SCAN_GSD field as a string.
*/
ossimString getCrossScanGsd() const;
/**
* @brief Get the GEO_MEAN_GSD field.
* @return The GEO_MEAN_GSD field as a string.
*/
ossimString getGeoMeanGsd() const;
/**
* @brief Get the A_S_VERT_GSD field.
* @return The A_S_VERT_GSD field as a string.
*/
ossimString getAlongScanVerticalGsd() const;
/**
* @brief Get the C_S_VERT_GSD field.
* @return The C_S_VERT_GSD field as a string.
*/
ossimString getCrossScanVerticalGsd() const;
/**
* @brief Get the GEO_MEAN_VERT_GSD field.
* @return The GEO_MEAN_VERT_GSD field as a string.
*/
ossimString getGeoMeanVerticalGsd() const;
/**
* @brief Get the GEO_BETA_ANGLEfield.
* @return The GEO_BETA_ANGLE field as a string.
*/
ossimString getGeoBetaAngle() const;
/**
* @brief Get the DYNAMIC_RANGE field.
* @return The DYNAMIC_RANGE field as a string.
*/
ossimString getDynamicRange() const;
/**
* @brief Get the NUM_LINES field.
* @return The NUM_LINES field as a string.
*/
ossimString getNumLines() const;
/**
* @brief Get the NUM_SAMPLES field.
* @return The NUM_SAMPLES field as a string.
*/
ossimString getNumSamples() const;
/**
* @brief Get the ANGLE_TO_NORTH field.
* @return The ANGLE_TO_NORTH field as a string.
*/
ossimString getAngleToNorth() const;
/**
* @brief Get the OBLIQUITY_ANGLE field.
* @return The OBLIQUITY_ANGLE field as a string.
*/
ossimString getObliquityAngle() const;
/**
* @brief Get the AZ_OF_OBLIQUITY field.
* @return The AZ_OF_OBLIQUITY field as a string.
*/
ossimString getAzimuthOfObliquity() const;
/**
* @brief Get the GRD_COVER field.
* @return The GRD_COVER field as a string.
*/
ossimString getGroundCover() const;
/**
* @brief Get the SNOW_DEPTH_CAT field.
* @return The SNOW_DEPTH_CAT field as a string.
*/
ossimString getSnowDepth() const;
/**
* @brief Get the SUN_AZIMUTH field.
* @return The SUN_AZIMUTH field as a string.
*/
ossimString getSunAzimuth() const;
/**
* @brief Get the SUN_ELEVATION field.
* @return The SUN_ELEVATION field as a string.
*/
ossimString getSunElevation() const;
/**
* @brief Get the PREDICTED_NIIRS field.
* @return The PREDICTED_NIIRS field as a string.
*/
ossimString getPredictedNiirs() const;
/**
* @brief Get the CIRCL_ERR field.
* @return The CIRCL_ERR field as a string.
*/
ossimString getCE90() const;
/**
* @brief Get the LINEAR_ERR field.
* @return The LINEAR_ERR field as a string.
*/
ossimString getLE90() const;
protected:
/**
......
......@@ -204,38 +204,4 @@ ossimSrtmElevationDatabase::createCell(const ossimGpt& gpt)
}
return result;
#if 0
ossimRefPtr<ossimElevCellHandler> result = 0;
ossim_uint64 id = createId(gpt);
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_cacheMapMutex);
CellMap::iterator iter = m_cacheMap.find(id);
if(iter != m_cacheMap.end())
{
iter->second->updateTimestamp();
result = iter->second->m_handler.get();
}
else
{
ossimFilename f;
createFullPath(f, gpt);
if(f.exists())
{
ossimRefPtr<ossimSrtmHandler> h = new ossimSrtmHandler();
if (h->open(f, m_memoryMapCellsFlag))
{
m_cacheMap.insert(std::make_pair(id, new CellInfo(createId(gpt), h.get())));
result = h.get();
if(m_cacheMap.size() > m_maxOpenCells)
{
flushCacheToMinOpenCells();
}
}
}
}
return result;
#endif
}
......@@ -170,18 +170,20 @@ ossim2dTo2dTransform* ossimImageGeometryFactory::createTransformFromNitf(ossimNi
ossimNitfIchipbTag* ichipb = PTR_CAST(ossimNitfIchipbTag, tag.get());
if (ichipb)
{
const ossimRefPtr<ossimNitfRegisteredTag> blocka =
hdr->getTagData(ossimString("BLOCKA"));
const ossimRefPtr<ossimNitfRegisteredTag> rpc00a =
hdr->getTagData(ossimString("RPC00A"));
const ossimRefPtr<ossimNitfRegisteredTag> rpc00b =
hdr->getTagData(ossimString("RPC00B"));
// const ossimRefPtr<ossimNitfRegisteredTag> blocka =
// hdr->getTagData(ossimString("BLOCKA"));
// const ossimRefPtr<ossimNitfRegisteredTag> rpc00a =
// hdr->getTagData(ossimString("RPC00A"));
// const ossimRefPtr<ossimNitfRegisteredTag> rpc00b =
// hdr->getTagData(ossimString("RPC00B"));
//---
// If any of these tags are present we will use the sub image from
// the ichipb tag.
//---
if ( blocka.get() || rpc00a.get() || rpc00b.get() )
// if ( blocka.get() || rpc00a.get() || rpc00b.get() )
// ************************* THERE ARE PROBLEMS NOT SETTING THIS AT SITE. GO AHEAD AND ALWAYS INIT THE SHIFT
{
result = ichipb->newTransform();
}
......
......@@ -8,13 +8,15 @@
//
// Contains class definition for JpegTileSource.
//*******************************************************************
// $Id: ossimJpegTileSource.cpp 16860 2010-03-11 15:28:09Z gpotts $
// $Id: ossimJpegTileSource.cpp 18145 2010-09-27 14:22:32Z dburken $
#if defined(__BORLANDC__)
#include <iostream>
# include <iostream>
using std::size_t;
#include <stdlib.h>
#include <stdio.h>
# include <stdlib.h>
# include <stdio.h>
#endif
extern "C"
{
#include <stdio.h>
......@@ -49,58 +51,59 @@ static ossimTrace traceDebug("ossimJpegTileSource:degug");
class ossimJpegTileSource::PrivateData
{
public:
PrivateData()
:theCinfo(),
theJerr()
{
}
virtual ~PrivateData()
{
clear();
}
void clear()
{
jpeg_destroy_decompress( &theCinfo );
}
PrivateData()
:theCinfo(),
theJerr()
{
}
virtual ~PrivateData()
{
clear();
}
void clear()
{
jpeg_destroy_decompress( &theCinfo );
}
struct jpeg_decompress_struct theCinfo;
struct jpeg_error_mgr theJerr;
};
//*******************************************************************
// Public Constructor:
//*******************************************************************
ossimJpegTileSource::ossimJpegTileSource()
:
ossimImageHandler(),
theTile(NULL),
theCacheTile(NULL),
theLineBuffer(NULL),
theTile(0),
theCacheTile(0),
theLineBuffer(0),
theFilePtr(0),
theBufferRect(0, 0, 0, 0),
theImageRect(0, 0, 0, 0),
theNumberOfBands(0),
theCacheSize (0),
thePrivateData(0),
thePrivateData(0),
theCacheId(-1)
{
}
//*******************************************************************
// Public Constructor:
//*******************************************************************
ossimJpegTileSource::ossimJpegTileSource(const ossimKeywordlist& kwl,
const char* prefix)
// Public Constructor:
//*******************************************************************
ossimJpegTileSource::ossimJpegTileSource(const ossimKeywordlist& kwl,
const char* prefix)
:
ossimImageHandler(),
theTile(NULL),
theCacheTile(NULL),
theLineBuffer(NULL),
theTile(0),
theCacheTile(0),
theLineBuffer(0),
theFilePtr(0),
theBufferRect(0, 0, 0, 0),
theImageRect(0, 0, 0, 0),
theNumberOfBands(0),
theCacheSize (0),
thePrivateData(0),
thePrivateData(0),
theCacheId(-1)
{
if (loadState(kwl, prefix) == false)
......@@ -115,15 +118,15 @@ ossimJpegTileSource::ossimJpegTileSource(const ossimKeywordlist& kwl,
ossimJpegTileSource::ossimJpegTileSource(const char* jpeg_file)
:
ossimImageHandler(),
theTile(NULL),
theCacheTile(NULL),
theLineBuffer(NULL),
theTile(0),
theCacheTile(0),
theLineBuffer(0),
theFilePtr(0),
theBufferRect(0, 0, 0, 0),
theImageRect(0, 0, 0, 0),
theNumberOfBands(0),
theCacheSize(0),
thePrivateData(0),
thePrivateData(0),
theCacheId(-1)
{
static const char MODULE[]
......@@ -152,13 +155,13 @@ void ossimJpegTileSource::destroy()
{
ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
theTile = NULL;
theCacheTile = NULL;
theTile = 0;
theCacheTile = 0;
if (theLineBuffer)
{
delete [] theLineBuffer;
theLineBuffer = NULL;
theLineBuffer = 0;
}
if (theFilePtr)
{
......@@ -167,8 +170,8 @@ void ossimJpegTileSource::destroy()
}
if(thePrivateData)
{
delete thePrivateData;
thePrivateData = 0;
delete thePrivateData;
thePrivateData = 0;
}
}
......
......@@ -9,7 +9,7 @@
// Description: Contains class definition for ossimNitfTileSource.
//
//*******************************************************************
// $Id: ossimNitfTileSource.cpp 17978 2010-08-24 16:17:00Z dburken $
// $Id: ossimNitfTileSource.cpp 18148 2010-09-27 15:24:28Z gpotts $
#include <jerror.h>
#include <fstream>
......@@ -50,7 +50,7 @@
RTTI_DEF1_INST(ossimNitfTileSource, "ossimNitfTileSource", ossimImageHandler)
#ifdef OSSIM_ID_ENABLED
static const char OSSIM_ID[] = "$Id: ossimNitfTileSource.cpp 17978 2010-08-24 16:17:00Z dburken $";
static const char OSSIM_ID[] = "$Id: ossimNitfTileSource.cpp 18148 2010-09-27 15:24:28Z gpotts $";
#endif
//---
......@@ -929,18 +929,19 @@ ossimImageGeometry* ossimNitfTileSource::getImageGeometry()
PTR_CAST(ossimNitfIchipbTag, tag.get());
if (ichipb)
{
const ossimRefPtr<ossimNitfRegisteredTag> blocka =
hdr->getTagData(ossimString("BLOCKA"));
const ossimRefPtr<ossimNitfRegisteredTag> rpc00a =
hdr->getTagData(ossimString("RPC00A"));
const ossimRefPtr<ossimNitfRegisteredTag> rpc00b =
hdr->getTagData(ossimString("RPC00B"));
// const ossimRefPtr<ossimNitfRegisteredTag> blocka =
// hdr->getTagData(ossimString("BLOCKA"));
// const ossimRefPtr<ossimNitfRegisteredTag> rpc00a =
// hdr->getTagData(ossimString("RPC00A"));
// const ossimRefPtr<ossimNitfRegisteredTag> rpc00b =
// hdr->getTagData(ossimString("RPC00B"));
//---
// If any of these tags are present we will use the sub
// image from the ichipb tag.
//---
if ( blocka.get() || rpc00a.get() || rpc00b.get() )
// if ( blocka.get() || rpc00a.get() || rpc00b.get() )
// ************************* THERE ARE PROBLEMS NOT SETTING THIS AT SITE. GO AHEAD AND ALWAYS INIT THE SHIFT
{
transform = ichipb->newTransform();
}
......
......@@ -226,4 +226,122 @@ std::ostream& ossimNitfCsexraTag::print(
return out;
}
ossimString ossimNitfCsexraTag::getSensor() const
{
return ossimString(theSensor);
}
ossimString ossimNitfCsexraTag::getTimeFirstLineImage() const
{
return ossimString(theTileFirstLine);
}
ossimString ossimNitfCsexraTag::getTimeImageDuration() const
{
return ossimString(theImageTimeDuration);
}
ossimString ossimNitfCsexraTag::getMaxGsd() const
{
return ossimString(theMaxGsd);
}
ossimString ossimNitfCsexraTag::getAlongScanGsd() const
{
return ossimString(theAlongScanGsd);
}
ossimString ossimNitfCsexraTag::getCrossScanGsd() const
{
return ossimString(theCrossScanGsd);
}
ossimString ossimNitfCsexraTag::getGeoMeanGsd() const
{
return ossimString(theGeoMeanGsd);
}
ossimString ossimNitfCsexraTag::getAlongScanVerticalGsd() const
{
return ossimString(theAlongScanVertGsd);
}
ossimString ossimNitfCsexraTag::getCrossScanVerticalGsd() const
{
return ossimString(theCrossScanVertGsd);
}
ossimString ossimNitfCsexraTag::getGeoMeanVerticalGsd() const
{
return ossimString(theGeoMeanVertGsd);
}
ossimString ossimNitfCsexraTag::getGeoBetaAngle() const
{
return ossimString(theGeoBetaAngle);
}
ossimString ossimNitfCsexraTag::getDynamicRange() const
{
return ossimString(theDynamicRange);
}
ossimString ossimNitfCsexraTag::getNumLines() const
{
return ossimString(theLine);
}
ossimString ossimNitfCsexraTag::getNumSamples() const
{
return ossimString(theSamples);
}
ossimString ossimNitfCsexraTag::getAngleToNorth() const
{
return ossimString(theAngleToNorth);
}
ossimString ossimNitfCsexraTag::getObliquityAngle() const
{
return ossimString(theObliquityAngle);
}
ossimString ossimNitfCsexraTag::getAzimuthOfObliquity() const
{
return ossimString(theAzOfObliquity);
}
ossimString ossimNitfCsexraTag::getGroundCover() const
{
return ossimString(theGrdCover);
}
ossimString ossimNitfCsexraTag::getSnowDepth() const
{
return ossimString(theSnowDepthCategory);
}
ossimString ossimNitfCsexraTag::getSunAzimuth() const
{
return ossimString(theSunAzimuth);
}
ossimString ossimNitfCsexraTag::getSunElevation() const
{
return ossimString(theSunElevation);
}
ossimString ossimNitfCsexraTag::getPredictedNiirs() const
{
return ossimString(thePredictedNiirs);
}
ossimString ossimNitfCsexraTag::getCE90() const
{
return ossimString(theCircularError);
}
ossimString ossimNitfCsexraTag::getLE90() const
{
return ossimString(theLinearError);
}
......@@ -9,7 +9,7 @@
// Contains definition of class ossimSpotDimapSupportData.
//
//*****************************************************************************
// $Id: ossimSpotDimapSupportData.cpp 17814 2010-08-03 12:44:02Z dburken $
// $Id: ossimSpotDimapSupportData.cpp 18140 2010-09-27 11:17:57Z gpotts $
#include <iostream>
......
......@@ -29,8 +29,10 @@ using namespace std;
#include <ossimFormosatDimapSupportData.h>
namespace ossimplugins
{
RTTI_DEF1(ossimFormosatModel, "ossimFormosatModel", ossimSensorModel);
}
//---
// Define Trace flags for use within this file:
......@@ -65,7 +67,7 @@ static const ossim_float64 SIGMA[] = { 0.0001, // degrees
0.00005, // delta degrees
0.0001 }; // percent
ossimFormosatModel::ossimFormosatModel()
ossimplugins::ossimFormosatModel::ossimFormosatModel()
:
ossimSensorModel (),
theSupportData (NULL),
......@@ -89,7 +91,7 @@ ossimFormosatModel::ossimFormosatModel()
initAdjustableParameters();
}
ossimFormosatModel::ossimFormosatModel(ossimFormosatDimapSupportData* sd)
ossimplugins::ossimFormosatModel::ossimFormosatModel(ossimFormosatDimapSupportData* sd)
:
ossimSensorModel (),
theSupportData (sd),
......@@ -136,7 +138,7 @@ ossimFormosatModel::ossimFormosatModel(ossimFormosatDimapSupportData* sd)
// DESTRUCTOR: ~ossimFormosatModel()
//
//*****************************************************************************
ossimFormosatModel::~ossimFormosatModel()
ossimplugins::ossimFormosatModel::~ossimFormosatModel()
{
if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimFormosatModel(): entering..." << std::endl;
......@@ -145,7 +147,7 @@ ossimFormosatModel::~ossimFormosatModel()
if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimFormosatModel(): returning..." << std::endl;
}
ossimFormosatModel::ossimFormosatModel(const ossimFormosatModel& rhs)
ossimplugins::ossimFormosatModel::ossimFormosatModel(const ossimFormosatModel& rhs)
:ossimSensorModel(rhs)
{
if(rhs.theSupportData.valid())
......@@ -157,7 +159,7 @@ ossimFormosatModel::ossimFormosatModel(const ossimFormosatModel& rhs)
}
void ossimFormosatModel::computeSatToOrbRotation(NEWMAT::Matrix& result, ossim_float64 t)const
void ossimplugins::ossimFormosatModel::computeSatToOrbRotation(NEWMAT::Matrix& result, ossim_float64 t)const
{
if (traceExec())
{
......@@ -205,7 +207,7 @@ void ossimFormosatModel::computeSatToOrbRotation(NEWMAT::Matrix& result, ossim_f
//*****************************************************************************
// METHOD
//*****************************************************************************
void ossimFormosatModel::computeSatToOrbRotation(ossim_float64 t)const
void ossimplugins::ossimFormosatModel::computeSatToOrbRotation(ossim_float64 t)const
{
if (traceExec())
{
......@@ -257,7 +259,7 @@ void ossimFormosatModel::computeSatToOrbRotation(ossim_float64 t)const
// array.
//
//*****************************************************************************
void ossimFormosatModel::updateModel()
void ossimplugins::ossimFormosatModel::updateModel()
{
clearErrorStatus();
......@@ -308,7 +310,7 @@ void ossimFormosatModel::updateModel()
}
}
void ossimFormosatModel::initAdjustableParameters()
void ossimplugins::ossimFormosatModel::initAdjustableParameters()
{
if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFormosatModel::initAdjustableParameters(): entering..." << std::endl;
......@@ -333,7 +335,7 @@ void ossimFormosatModel::initAdjustableParameters()
if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFormosatModel::initAdjustableParameters(): returning..." << std::endl;
}
void ossimFormosatModel::loadSupportData()
void ossimplugins::ossimFormosatModel::loadSupportData()
{
if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "ossimFormosatModel::loadSupportData(): entering..." << std::endl;
......@@ -439,12 +441,12 @@ void ossimFormosatModel::loadSupportData()
if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFormosatModel::loadSupportData(): returning..." << std::endl;
}
ossimObject* ossimFormosatModel::dup() const
ossimObject* ossimplugins::ossimFormosatModel::dup() const
{
return new ossimFormosatModel(*this);
}
std::ostream& ossimFormosatModel::print(std::ostream& out) const
std::ostream& ossimplugins::ossimFormosatModel::print(std::ostream& out) const
{
// Capture stream flags since we are going to mess with them.
std::ios_base::fmtflags f = out.flags();
......@@ -479,7 +481,7 @@ std::ostream& ossimFormosatModel::print(std::ostream& out) const
return ossimSensorModel::print(out);
}
bool ossimFormosatModel::saveState(ossimKeywordlist& kwl,
bool ossimplugins::ossimFormosatModel::saveState(ossimKeywordlist& kwl,
const char* prefix) const
{
if(theSupportData.valid())
......@@ -495,7 +497,7 @@ bool ossimFormosatModel::saveState(ossimKeywordlist& kwl,
return ossimSensorModel::saveState(kwl, prefix);
}
bool ossimFormosatModel::loadState(const ossimKeywordlist& kwl,
bool ossimplugins::ossimFormosatModel::loadState(const ossimKeywordlist& kwl,
const char* prefix)
{
ossimString supportPrefix = ossimString(prefix) + "support_data.";
......@@ -523,7 +525,7 @@ bool ossimFormosatModel::loadState(const ossimKeywordlist& kwl,
return (getErrorStatus()==ossimErrorCodes::OSSIM_OK);
}
void ossimFormosatModel::imagingRay(const ossimDpt& image_point,
void ossimplugins::ossimFormosatModel::imagingRay(const ossimDpt& image_point,
ossimEcefRay& image_ray) const
{
bool runtime_dbflag = 0;
......@@ -639,7 +641,7 @@ void ossimFormosatModel::imagingRay(const ossimDpt& image_point,
}
}