Commit 34c6e4af authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

Backed out changeset 7c90958e13c3

parent 9fb20ceb
......@@ -100,19 +100,19 @@ IF(WIN32)
IF (MSVC)
IF(OTB_BUILD_PEDANTIC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
ENDIF()
ENDIF(OTB_BUILD_PEDANTIC)
IF (MSVC80)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNING)
ENDIF()
ENDIF()
ELSE()
ENDIF(MSVC80)
ENDIF(MSVC)
ELSE(WIN32)
IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
IF(OTB_BUILD_PEDANTIC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
ENDIF()
ENDIF()
ENDIF(OTB_BUILD_PEDANTIC)
ENDIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
ENDIF(WIN32)
#-----------------------------------------------------------------------------
......
......@@ -66,7 +66,7 @@ public:
* \param labelObject the label object to vectorize
* \return The vectorized label object as a polygon.
*/
inline PolygonPointerType operator()(const LabelObjectType * labelObject);
inline PolygonType * operator()(const LabelObjectType * labelObject);
private:
/// Internal structures
......@@ -109,6 +109,8 @@ private:
/// Walk right to update the finite states machine.
inline void WalkRight(unsigned int line,const IndexType & startPoint, const IndexType & endPoint, PolygonType * polygon, const StateType state);
PolygonPointerType m_Polygon;
// Internal structure to store runs
RunsPerLineVectorType m_InternalDataSet;
......
......@@ -43,7 +43,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
template<class TLabelObject, class TPolygon>
inline typename LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
::PolygonPointerType
::PolygonType *
LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
::operator()(const LabelObjectType * labelObject)
{
......@@ -52,7 +52,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_PositionFlag = LEFT_END;
m_InternalDataSet.clear();
PolygonPointerType polygon = PolygonType::New();
m_Polygon = PolygonType::New();
// Get the internal container
LineContainerType lcontainer = labelObject->GetLineContainer();
......@@ -118,7 +118,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = secondCandidateRun;
m_CurrentState = DOWN_RIGHT;
m_PositionFlag = LEFT_END;
WalkRight(m_CurrentLine-1,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
WalkRight(m_CurrentLine-1,m_CurrentPoint,LeftEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
else
......@@ -128,7 +128,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = firstCandidateRun;
m_CurrentState = UP_RIGHT;
m_PositionFlag = RIGHT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),polygon, m_CurrentState);
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
}
......@@ -141,7 +141,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
// Up-Left Case
m_CurrentState = UP_LEFT;
m_PositionFlag = RIGHT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,RightEnd(secondCandidateRun),polygon, m_CurrentState);
WalkLeft(m_CurrentLine,m_CurrentPoint,RightEnd(secondCandidateRun),m_Polygon, m_CurrentState);
m_CurrentLine--;
m_CurrentRun = secondCandidateRun;
}
......@@ -150,7 +150,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
// Down-Left case
m_CurrentState = DOWN_LEFT;
m_PositionFlag = LEFT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
}
break;
......@@ -171,7 +171,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = secondCandidateRun;
m_CurrentState = UP_LEFT;
m_PositionFlag = RIGHT_END;
WalkLeft(m_CurrentLine+1,m_CurrentPoint,RightEnd(m_CurrentRun),polygon, m_CurrentState);
WalkLeft(m_CurrentLine+1,m_CurrentPoint,RightEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
else
{
......@@ -180,7 +180,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = firstCandidateRun;
m_CurrentState = DOWN_LEFT;
m_PositionFlag = LEFT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
}
......@@ -195,7 +195,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentLine++;
m_CurrentState = DOWN_RIGHT;
m_PositionFlag = LEFT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
WalkRight(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
else
......@@ -203,7 +203,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
// Up-Right case
m_CurrentState = UP_RIGHT;
m_PositionFlag = RIGHT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),polygon, m_CurrentState);
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
}
......@@ -223,7 +223,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentState = UP_LEFT;
m_PositionFlag = RIGHT_END;
m_CurrentRun = secondCandidateRun;
WalkLeft(m_CurrentLine+1,m_CurrentPoint,RightEnd(m_CurrentRun),polygon, m_CurrentState);
WalkLeft(m_CurrentLine+1,m_CurrentPoint,RightEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
else
......@@ -233,7 +233,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = firstCandidateRun;
m_CurrentState = DOWN_LEFT;
m_PositionFlag = LEFT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
}
......@@ -248,14 +248,14 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = secondCandidateRun;
m_CurrentState = DOWN_RIGHT;
m_PositionFlag = LEFT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
WalkRight(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
else
{
// Up-Right case
m_CurrentState = UP_RIGHT;
m_PositionFlag = RIGHT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),polygon, m_CurrentState);
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
}
......@@ -275,7 +275,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = secondCandidateRun;
m_CurrentState = DOWN_RIGHT;
m_PositionFlag = LEFT_END;
WalkRight(m_CurrentLine-1,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
WalkRight(m_CurrentLine-1,m_CurrentPoint,LeftEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
else
......@@ -285,7 +285,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = firstCandidateRun;
m_CurrentState = UP_RIGHT;
m_PositionFlag = RIGHT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),polygon, m_CurrentState);
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
}
else
......@@ -297,7 +297,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
// Up-Left case
m_CurrentState = UP_LEFT;
m_PositionFlag = RIGHT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,RightEnd(secondCandidateRun),polygon, m_CurrentState);
WalkLeft(m_CurrentLine,m_CurrentPoint,RightEnd(secondCandidateRun),m_Polygon, m_CurrentState);
m_CurrentLine--;
m_CurrentRun = secondCandidateRun;
......@@ -307,7 +307,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
// Down-Left case
m_CurrentState = DOWN_LEFT;
m_PositionFlag = LEFT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),m_Polygon, m_CurrentState);
}
}
......@@ -317,7 +317,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
goesOn = m_CurrentPoint != m_StartingPoint;
}
return polygon;
return m_Polygon;
}
template<class TLabelObject, class TPolygon>
......
......@@ -117,7 +117,7 @@ VectorDataExtractROI<TVectorData>
chrono.Start();
ProcessNode(inputRoot,outputRoot);
chrono.Stop();
std::cout<<"VectorDataExtractROI: "<<m_Kept<<" Features processed in "<<chrono.GetMeanTime()<<" seconds."<<std::endl;
otbMsgDevMacro(<<"VectorDataExtractROI: "<<m_Kept<<" Features processed in "<<chrono.GetMeanTime()<<" seconds.");
}/*End GenerateData()*/
......
......@@ -357,7 +357,11 @@ ImageFileReader<TOutputImage>
{
otbMsgDevMacro( <<"OSSIM Open Image SUCCESS ! ");
// hasMetaData = handler->getImageGeometry(geom_kwl);
hasMetaData = handler->saveState(geom_kwl);
ossimProjection* projection = handler->getImageGeometry()->getProjection();
if (projection)
{
hasMetaData = projection->saveState(geom_kwl);
}
}
// Free memory
delete handler;
......
......@@ -108,9 +108,11 @@ ImageFileWriter<TInputImage>
}
else
{
//FIXME find out exactly what we are trying to do here
//there is no meaning to blindly save the kwl if we didn't update it in the pipeline
// handler->setImageGeometry(geom_kwl);
handler->loadState(geom_kwl);
handler->saveImageGeometry();
// handler->getImageGeometry()->getProjection()->loadState(geom_kwl);
// handler->saveImageGeometry();
handler->close();
}
}
......
......@@ -124,7 +124,7 @@ private:
/** \class OTB_GCP
*
* \brief This OTB_GCP class is used to manege the GCP parameters
* \brief This OTB_GCP class is used to manage the GCP parameters
* in OTB.
*
*/
......
......@@ -552,9 +552,12 @@ StreamingImageFileWriter<TInputImage>
}
else
{
//FIXME find out exactly what we are trying to do here
//there is no meaning to blindly save the kwl if we didn't update it in the pipeline
// handler->setImageGeometry(geom_kwl);
handler->loadState(geom_kwl);
handler->saveImageGeometry();
// handler->getImageGeometry()->getProjection()->loadState(geom_kwl);
//
// handler->saveImageGeometry();
handler->close();
}
}
......
......@@ -120,7 +120,7 @@ GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions
if (!projectionInformationAvailable)
{
std::cout << "WARNING: Impossible to create the projection from string: "<< m_ProjectionRefWkt << std::endl;
otbMsgDevMacro(<<"WARNING: Impossible to create the projection from string: "<< m_ProjectionRefWkt);
return false;
}
......@@ -129,7 +129,7 @@ GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions
//a better solution might be available...
if (std::string(kwl.find("type")) == "ossimEquDistCylProjection")
{
std::cout << "WARNING: Not instanciating a ossimEquDistCylProjection"<< std::endl;
otbMsgDevMacro(<< "WARNING: Not instanciating a ossimEquDistCylProjection");
return false;
}
......
......@@ -75,7 +75,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions
::SetEllipsoid()
{
ossimEllipsoid ellipsoid;
this->GetMapProjection()->setEllipsoid(ellipsoid);
m_MapProjection->setEllipsoid(ellipsoid);
}
/// Method to set the projection ellipsoid by copy
......@@ -83,7 +83,7 @@ template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform
void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::SetEllipsoid(const ossimEllipsoid &ellipsoid)
{
this->GetMapProjection()->setEllipsoid(ellipsoid);
m_MapProjection->setEllipsoid(ellipsoid);
}
///// Method to set the projection ellipsoid by knowing its code
......@@ -92,7 +92,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions
::SetEllipsoid(std::string code)
{
const ossimEllipsoid ellipsoid = *(ossimEllipsoidFactory::instance()->create(ossimString(code)));
this->GetMapProjection()->setEllipsoid(ellipsoid);
m_MapProjection->setEllipsoid(ellipsoid);
}
///// Method to set the projection ellipsoid by knowing its axis
......@@ -101,7 +101,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions
::SetEllipsoid(const double &major_axis, const double &minor_axis)
{
ossimEllipsoid ellipsoid(major_axis,minor_axis);
this->GetMapProjection()->setEllipsoid(ellipsoid);
m_MapProjection->setEllipsoid(ellipsoid);
}
template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
......@@ -122,9 +122,9 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu
//map projection
ossimGpt ossimGPoint;
ossimGPoint=this->GetMapProjection()->inverse(ossimDPoint);
ossimGPoint=m_MapProjection->inverse(ossimDPoint);
ossimGPoint.changeDatum(ossimDatumFactory::instance()->wgs84() );
// otbGenericMsgDebugMacro(<< "Inverse : " << std::endl << this->GetMapProjection()->print(std::cout));
// otbGenericMsgDebugMacro(<< "Inverse : " << std::endl << m_MapProjection->print(std::cout));
outputPoint[0]=ossimGPoint.lon;
outputPoint[1]=ossimGPoint.lat;
......@@ -139,7 +139,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu
//map projection
ossimDpt ossimDPoint;
ossimDPoint=this->GetMapProjection()->forward(ossimGPoint);
ossimDPoint=m_MapProjection->forward(ossimGPoint);
// otbGenericMsgDebugMacro(<< "Forward : ========================= " << std::endl << m_MapProjection->print(std::cout));
outputPoint[0]=ossimDPoint.x;
outputPoint[1]=ossimDPoint.y;
......@@ -166,7 +166,7 @@ typename MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimens
MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::Origin()
{
ossimGpt ossimOrigin=this->GetMapProjection()->origin();
ossimGpt ossimOrigin=m_MapProjection->origin();
InputPointType otbOrigin;
otbOrigin[0]= ossimOrigin.lat;
otbOrigin[1]= ossimOrigin.lon;
......@@ -180,7 +180,7 @@ double
MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::GetFalseNorthing() const
{
double falseNorthing=this->GetMapProjection()->getFalseNorthing();
double falseNorthing=m_MapProjection->getFalseNorthing();
return falseNorthing;
}
......@@ -191,7 +191,7 @@ double
MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::GetFalseEasting() const
{
double falseEasting=this->GetMapProjection()->getFalseEasting();
double falseEasting=m_MapProjection->getFalseEasting();
return falseEasting;
}
......@@ -202,7 +202,7 @@ double
MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::GetStandardParallel1() const
{
double standardParallel1=this->GetMapProjection()->getStandardParallel1();
double standardParallel1=m_MapProjection->getStandardParallel1();
return standardParallel1;
}
......@@ -213,7 +213,7 @@ double
MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::GetStandardParallel2() const
{
double standardParallel2=this->GetMapProjection()->getStandardParallel2();
double standardParallel2=m_MapProjection->getStandardParallel2();
return standardParallel2;
}
......@@ -225,7 +225,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu
::GetProjectionName() const
{
std::string projectionName;
projectionName=this->GetMapProjection()->getProjectionName();
projectionName=m_MapProjection->getProjectionName();
return projectionName;
}
......@@ -236,7 +236,7 @@ bool
MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::IsGeographic() const
{
return (this->GetMapProjection()->isGeographic());
return (m_MapProjection->isGeographic());
}
///\return the major axis of the ellipsoid
......@@ -245,7 +245,7 @@ double
MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::GetA() const
{
double majorAxis=this->GetMapProjection()->getA();
double majorAxis=m_MapProjection->getA();
return majorAxis;
}
......@@ -256,7 +256,7 @@ double
MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::GetB() const
{
double minorAxis=this->GetMapProjection()->getB();
double minorAxis=m_MapProjection->getB();
return minorAxis;
}
......@@ -267,7 +267,7 @@ double
MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::GetF() const
{
double flattening=this->GetMapProjection()->getF();
double flattening=m_MapProjection->getF();
return flattening;
}
......@@ -278,7 +278,7 @@ typename MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimens
MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::GetMetersPerPixel() const
{
ossimDpt ossimMetersPerPixels=this->GetMapProjection()->getMetersPerPixel();
ossimDpt ossimMetersPerPixels=m_MapProjection->getMetersPerPixel();
OutputPointType metersPerPixels;
metersPerPixels[0]=ossimMetersPerPixels.x;
......@@ -293,7 +293,7 @@ typename MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimens
MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::GetDecimalDegreesPerPixel() const
{
ossimDpt ossimDecimalDegreesPerPixels=this->GetMapProjection()->getDecimalDegreesPerPixel();
ossimDpt ossimDecimalDegreesPerPixels=m_MapProjection->getDecimalDegreesPerPixel();
OutputPointType DecimalDegreesPerPixels;
DecimalDegreesPerPixels[0]=ossimDecimalDegreesPerPixels.x;
......@@ -307,7 +307,7 @@ template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform
void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::SetAB(double a, double b)
{
this->GetMapProjection()->setAB(a,b);
m_MapProjection->setAB(a,b);
}
///Set the origin
......@@ -316,10 +316,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions
::SetOrigin(const InputPointType &origin)
{
ossimGpt ossimOrigin(origin[1], origin[0]);
this->GetMapProjection()->setOrigin(ossimOrigin);
//TODO: 29-02-2008 Emmanuel: when ossim version > 1.7.2 only
// SetOrigin required (remove SetDatum)
this->GetMapProjection()->setDatum(ossimOrigin.datum());
m_MapProjection->setOrigin(ossimOrigin);
}
///Set the origin in a given datum
......@@ -328,8 +325,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions
::SetOrigin(const InputPointType &origin, std::string datumCode)
{
ossimGpt ossimOrigin(origin[1], origin[0], 0, ossimDatumFactory::instance()->create(datumCode));
this->GetMapProjection()->setOrigin(ossimOrigin);
this->GetMapProjection()->setDatum(ossimOrigin.datum());
m_MapProjection->setOrigin(ossimOrigin);
}
///Set the map resolution in meters
......@@ -338,7 +334,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions
::SetMetersPerPixel(const OutputPointType &point)
{
ossimDpt ossimDPoint(point[0], point[1]);
this->GetMapProjection()->setMetersPerPixel(ossimDPoint);
m_MapProjection->setMetersPerPixel(ossimDPoint);
}
///Set the map resolution in degree
......@@ -347,7 +343,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions
::SetDecimalDegreesPerPixel(const OutputPointType &point)
{
ossimDpt ossimDPoint(point[0], point[1]);
this->GetMapProjection()->setDecimalDegreesPerPixel(ossimDPoint);
m_MapProjection->setDecimalDegreesPerPixel(ossimDPoint);
}
///\return an approximation of the resolution in degree
......@@ -357,7 +353,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions
{
ossimDpt ossimMetersPerPixel(metersPerPixel[0], metersPerPixel[1]);
ossimGpt ossimGround(ground[1],ground[0]);
this->GetMapProjection()->computeDegreesPerPixel(ossimGround,ossimMetersPerPixel,deltaLat,deltaLon);
m_MapProjection->computeDegreesPerPixel(ossimGround,ossimMetersPerPixel,deltaLat,deltaLon);
}
///\return an approximation of the resolution in meters
......@@ -369,7 +365,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu
//Correction
ossimGpt ossimCenter(center[1],center[0]);
ossimDpt ossimMetersPerPixel;
this->GetMapProjection()->computeMetersPerPixel(ossimCenter,deltaDegreesPerPixelLat, deltaDegreesPerPixelLon,ossimMetersPerPixel);
m_MapProjection->computeMetersPerPixel(ossimCenter,deltaDegreesPerPixelLat, deltaDegreesPerPixelLon,ossimMetersPerPixel);
metersPerPixel[0]=ossimMetersPerPixel.x;
metersPerPixel[1]=ossimMetersPerPixel.y;
}
......@@ -381,7 +377,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu
::ComputeMetersPerPixel(double deltaDegreesPerPixelLat, double deltaDegreesPerPixelLon, OutputPointType &metersPerPixel)
{
ossimDpt ossimMetersPerPixel;
this->GetMapProjection()->computeMetersPerPixel(this->GetMapProjection()->origin(),deltaDegreesPerPixelLat, deltaDegreesPerPixelLon,ossimMetersPerPixel);
m_MapProjection->computeMetersPerPixel(m_MapProjection->origin(),deltaDegreesPerPixelLat, deltaDegreesPerPixelLon,ossimMetersPerPixel);
metersPerPixel[0]=ossimMetersPerPixel.x;
metersPerPixel[1]=ossimMetersPerPixel.y;
}
......@@ -392,7 +388,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu
::GetWkt() const
{
ossimKeywordlist kwl;
this->GetMapProjection()->saveState(kwl);
m_MapProjection->saveState(kwl);
ossimOgcWktTranslator wktTranslator;
std::string wkt;
wkt = wktTranslator.fromOssimKwl(kwl);
......@@ -413,7 +409,7 @@ void
MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions>
::PrintMap() const
{
std::cout << this->GetMapProjection()->print(std::cout);
std::cout << m_MapProjection->print(std::cout);
}
......
......@@ -51,8 +51,6 @@ public:
itkGetMacro( Lat, double );
itkGetMacro( PlaceName, std::string );
itkSetMacro( Lon, double );
itkSetMacro( Lat, double );
itkSetMacro( PlaceName, std::string );
typedef enum {ALL, GEONAMES, GOOGLE, YAHOO} SearchMethodEnum;//Not implemented yet TODO
......@@ -80,5 +78,4 @@ private:
} // namespace otb
#endif
......@@ -43,7 +43,7 @@ SensorModelBase< TScalarType,NInputDimensions,NOutputDimensions>
m_DEMHandler = DEMHandlerType::New();
m_UseDEM = false;
m_DEMIsLoaded = false;
m_AverageElevation = -32768.0;
m_AverageElevation = 0.0;
}
......
......@@ -3,7 +3,7 @@
FILE(GLOB OTBRadiometry_SRCS "*.cxx" )
ADD_LIBRARY(OTBRadiometry ${OTBRadiometry_SRCS})
TARGET_LINK_LIBRARIES (OTBRadiometry OTBCommon otb6S otbossim otbossim)
TARGET_LINK_LIBRARIES (OTBRadiometry OTBCommon otb6S)
IF(OTB_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(OTBRadiometry PROPERTIES ${OTB_LIBRARY_PROPERTIES})
ENDIF(OTB_LIBRARY_PROPERTIES)
......
......@@ -116,8 +116,12 @@ ADD_TEST(prTePlaceNameToLonLatExampleTest ${EXE_TESTS2}
Toulouse
)
ADD_TEST(prTeCoordinateToNameExampleTest ${EXE_TESTS2}
--compare-ascii ${TOL}
${BASELINE}/CoordinateToNameExample.txt
${TEMP}/CoordinateToNameExample.txt
CoordinateToNameExampleTest
103.78 1.29
${TEMP}/CoordinateToNameExample.txt
)
ENDIF( OTB_USE_CURL )
......
......@@ -19,21 +19,22 @@
#pragma warning ( disable : 4786 )
#endif
#include <fstream>
#include "otbCoordinateToName.h"
int main( int argc, char* argv[] )
{
if (argc!=3)
if (argc!=4)
{
std::cout << argv[0] <<" <lon> <lat>"
std::cout << argv[0] <<" <lon> <lat> <outputfile>"
<< std::endl;
return EXIT_FAILURE;
}
const char * outFileName = argv[3];
otb::CoordinateToName::Pointer conv = otb::CoordinateToName::New();
conv->SetLon(atof(argv[1]));
......@@ -46,6 +47,11 @@ int main( int argc, char* argv[] )
std::cout << "Nearby place: " << name << std::endl;
std::cout << "Country: " << country << std::endl;
std::ofstream file;
file.open(outFileName);
file << "Nearby place: " << name << std::endl;
file << "Country: " << country << std::endl;
file.close();
return EXIT_SUCCESS;
......
# data file for the Fltk User Interface Designer (fluid)
version 1.0110
version 1.0107
i18n_type 1
i18n_include "otbI18n.h"
i18n_function otbGetTextMacro
......
# data file for the Fltk User Interface Designer (fluid)
version 1.0110
version 1.0107
i18n_type 1
i18n_include "otbI18n.h"