Skip to content
Commits on Source (5)
FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
OSSIM_SETUP_APPLICATION(ossim-image-compare INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
#FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
#OSSIM_SETUP_APPLICATION(ossim-image-compare INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
......@@ -10,16 +10,12 @@
// The input formats can be different -- the pixels are compared after any
// unpacking and decompression. Only R0 is compared.
//
// $Id: ossim-image-compare.cpp 19753 2011-06-13 15:20:31Z dburken $
//----------------------------------------------------------------------------
#include <ossim/base/ossimArgumentParser.h>
#include <ossim/base/ossimApplicationUsage.h>
#include <ossim/base/ossimConstants.h>
#include <ossim/base/ossimException.h>
#include <ossim/base/ossimNotify.h>
#include <ossim/init/ossimInit.h>
#include <iostream>
#include <ossim/imaging/ossimImageHandlerRegistry.h>
#include <ossim/imaging/ossimImageSourceSequencer.h>
......@@ -67,6 +63,7 @@ int main(int argc, char *argv[])
ossimFilename f1 (argv[1]);
ossimFilename f2 (argv[2]);
cout << "\nComparing <"<<f1<<"> to <"<<f2<<">..."<<endl;
// Establish input image handlers:
ossimImageHandlerRegistry* registry = ossimImageHandlerRegistry::instance();
ossimRefPtr<ossimImageHandler> h1 = registry->open(ossimFilename(argv[1]));
......
......@@ -12,6 +12,11 @@ IF ("${OSSIM_DEV_HOME}" STREQUAL "")
ENDIF()
ENDIF()
if(EXISTS ${CMAKE_TOOLCHAIN_FILE})
MESSAGE("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}")
ENDIF()
if(NOT EXISTS ${OSSIM_DEV_HOME})
MESSAGE(FATAL_ERROR "Please pass in or define a valid OSSIM_DEV_HOME root path where all modules are located. This includes ossim, ossim-planet, ... etc.")
ENDIF()
......@@ -68,6 +73,7 @@ MESSAGE( STATUS "CMAKE_SYSTEM_INCLUDE_PATH = ${CMAKE_SYSTEM_INCLUDE_PATH}")
MESSAGE( STATUS "CMAKE_SYSTEM_LIBRARY_PATH = ${CMAKE_SYSTEM_LIBRARY_PATH}")
MESSAGE( STATUS "CMAKE_SYSTEM_PREFIX_PATH = ${CMAKE_SYSTEM_PREFIX_PATH}")
MESSAGE( STATUS "CMAKE_SYSTEM_IGNORE_PATH = ${CMAKE_SYSTEM_IGNORE_PATH}")
MESSAGE( STATUS "CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}")
MESSAGE( STATUS "\n" )
......
#!/bin/bash
sourceanalyzer -b ossimlabs ar $@
#!/bin/bash
sourceanalyzer -b ossimlabs gcc $@
#!/bin/bash
sourceanalyzer -b ossimlabs g++ $@
INCLUDE (CMakeForceCompiler)
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
#specify the compilers
SET(CMAKE_C_COMPILER ${CMAKE_SOURCE_DIR}/fortify/fortify_cc)
SET(CMAKE_CXX_COMPILER ${CMAKE_SOURCE_DIR}/fortify/fortify_cxx)
SET(CMAKE_AR_COMPILER ${CMAKE_SOURCE_DIR}/fortify/fortify_ar)
......@@ -65,48 +65,28 @@ esac
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
pushd $SCRIPT_DIR/.. >/dev/null
CMAKE_DIR=$PWD
#echo "@@@@@ CMAKE_DIR=$CMAKE_DIR"
popd >/dev/null
# Establish the top-level directory above repo containing this script
#echo "@@@@@ BEFORE OSSIM_DEV_HOME=$OSSIM_DEV_HOME"
if [ -z $OSSIM_DEV_HOME ]; then
pushd $CMAKE_DIR/../.. >/dev/null
export OSSIM_DEV_HOME=$PWD
#echo "@@@@@ NEW OSSIM_DEV_HOME=$OSSIM_DEV_HOME"
popd >/dev/null
#else
#echo "@@@@@ OSSIM_DEV_HOME UNCHANGED!"
fi
# Establish CMake's output build directory:
if [ -z "$OSSIM_BUILD_DIR" ]; then
if [ "$BUILD_TYPE_ARG" == "ECLIPSE" ]; then
pushd $OSSIM_DEV_HOME/..
OSSIM_BUILD_DIR=$PWD/ossimlabs_eclipse_build
popd
else
OSSIM_BUILD_DIR=$OSSIM_DEV_HOME/build
fi
fi
# Establish CMAKE's install directory:
if [ -z "$OSSIM_INSTALL_PREFIX" ]; then
OSSIM_INSTALL_PREFIX=$OSSIM_DEV_HOME/install
fi
# Additional stuff for ECLIPSE CDT4 users:
CMAKE_G_ARG="Unix Makefiles"
if [ "$BUILD_TYPE_ARG" == "ECLIPSE" ]; then
CMAKE_ECLIPSE_VERSION=4.7.1
CMAKE_G_ARG="Eclipse CDT4 - Unix Makefiles"
CMAKE_CXX_FLAGS="-std=c++11"
cp -f $CMAKE_DIR/CMakeLists.txt $OSSIM_DEV_HOME
CMAKE_DIR=$OSSIM_DEV_HOME
echo "Generating eclipse project files for Eclipse $CMAKE_ECLIPSE_VERSION."
fi
echo "@@@@@ OSSIM_BUILD_DIR=$OSSIM_BUILD_DIR"
echo "OSSIM_BUILD_DIR=$OSSIM_BUILD_DIR"
mkdir -p $OSSIM_BUILD_DIR
pushd $OSSIM_BUILD_DIR >/dev/null
rm -f CMakeCache.txt
......@@ -242,13 +222,14 @@ elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/D
export CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
fi
echo "Generating Makefiles in" $OSSIM_BUILD_DIR
if [ "${BUILD_WITH_FORTIFY}" == "true" ] ; then
INSERT_FORTIFY_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=${CMAKE_DIR}/fortify/fortify_linux_toolchain.cmake
echo;echo "Building with fortify toolchain"; echo
fi
# CMAKE command
cmake -G "$CMAKE_G_ARG" \
cmake -G "$CMAKE_G_ARG" "$INSERT_FORTIFY_TOOLCHAIN" \
-DCMAKE_CXX_FLAGS=$CMAKE_CXX_FLAGS \
-DCMAKE_ECLIPSE_VERSION=$CMAKE_ECLIPSE_VERSION \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DOSSIM_DEV_HOME=$OSSIM_DEV_HOME \
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
......@@ -300,5 +281,6 @@ cmake -G "$CMAKE_G_ARG" \
-DOSSIM_BUILD_ADDITIONAL_PLUGIN_DIRECTORIES=$OSSIM_BUILD_ADDITIONAL_PLUGIN_DIRECTORIES \
$CMAKE_DIR
echo CMAKE_COMMAND: $CMAKE_COMMAND
popd >/dev/null
ossim (2.5.0-2) UNRELEASED; urgency=medium
ossim (2.5.1-1) unstable; urgency=medium
* Team upload.
* New upstream release.
* Bump Standards-Version to 4.2.1, no changes.
* Refresh patches.
-- Bas Couwenberg <sebastic@debian.org> Tue, 28 Aug 2018 14:49:39 +0200
-- Bas Couwenberg <sebastic@debian.org> Thu, 20 Sep 2018 07:44:25 +0200
ossim (2.5.0-1) unstable; urgency=medium
......
......@@ -81,7 +81,7 @@ Author: Bas Couwenberg <sebastic@debian.org>
<< std::endl;
--- a/src/support_data/ossimTiffInfo.cpp
+++ b/src/support_data/ossimTiffInfo.cpp
@@ -329,7 +329,7 @@ std::ostream& ossimTiffInfo::print(std::
@@ -334,7 +334,7 @@ std::ostream& ossimTiffInfo::print(std::
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_WARN)
......@@ -90,7 +90,7 @@ Author: Bas Couwenberg <sebastic@debian.org>
<< std::endl;
}
m_inputStream.reset();
@@ -752,7 +752,7 @@ std::ostream& ossimTiffInfo::print(std::
@@ -764,7 +764,7 @@ std::ostream& ossimTiffInfo::print(std::
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_WARN)
......@@ -133,7 +133,7 @@ Author: Bas Couwenberg <sebastic@debian.org>
if (hasBrightnesContrastOperation())
{
// Assumption bright contrast filter in chain:
@@ -2066,7 +2066,7 @@ ossimRefPtr<ossimSingleImageChain> ossim
@@ -2067,7 +2067,7 @@ ossimRefPtr<ossimSingleImageChain> ossim
setupChainHistogram(ic, std::make_shared<ossimSrcRecord>(rec));
}
......
......@@ -51,9 +51,9 @@ namespace ossim
// FORMAT is YYYY:MM:DD HH:MM:SS
OTIFFTAG_DATETIME = 306,
OTIFFTAG_ARTIST = 315,
OTIFFTAG_PREDICTOR = 317,
OTIFFTAG_COLORMAP = 320,
OTIFFTAG_SUBIFD = 330,
OTIFFTAG_TILEWIDTH = 322,
OTIFFTAG_TILELENGTH = 323,
......@@ -63,6 +63,9 @@ namespace ossim
OTIFFTAG_SAMPLEFORMAT = 339,
OTIFFTAG_SMINSAMPLEVALUE = 340,
OTIFFTAG_SMAXSAMPLEVALUE = 341,
OTIFFTAG_YCBCRSUBSAMPLING = 530,
OTIFFTAG_YCBCRPOSITIONING = 531,
OTIFFTAG_REFERENCEBLACKWHITE = 532,
OTIFFTAG_XMLPACKET = 700,
OSAMPLEFORMAT_UINT = 1,
OSAMPLEFORMAT_INT = 2,
......@@ -149,7 +152,13 @@ namespace ossim
OPHOTO_MASK = 4, // $holdout mask
OPHOTO_SEPARATED = 5, // !color separations
OPHOTO_YCBCR = 6, // !CCIR 601
OPHOTO_CIELAB = 7 // !1976 CIE L*a*b*
OPHOTO_CIELAB = 7, // !1976 CIE L*a*b*
OPHOTO_ICCLAB = 9,
OPHOTO_ITULAB = 10,
OPHOTO_LAST = 11, // this is here for range checking
OPHOTO_LOGL = 32844,
OPHOTO_LOGLUV = 32845
};
enum ModelType
......
......@@ -13,9 +13,11 @@
#define ossimNitfWriterBase_HEADER 1
#include <ossim/imaging/ossimImageFileWriter.h>
#include <ossim/base/ossimRefPtr.h>
#include <ossim/support_data/ossimNitfRegisteredTag.h>
#include <ossim/support_data/ossimNitfFileHeaderV2_1.h>
#include <ossim/support_data/ossimNitfImageHeaderV2_1.h>
#include <vector>
class ossimFilename;
class ossimImageSourceSequencer;
......@@ -69,7 +71,6 @@ public:
*/
virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
/**
* Saves the state of the writer to kwl with prefix then calls
* base class ossimImageFileWriter::saveState
......@@ -155,7 +156,7 @@ protected:
*
* @note Currently only used with map projected images.
*/
void addGeolobTag(const ossimMapProjection* mapProj,
void addGeolobTag(ossimMapProjectionInfo& mapInfo,
ossimNitfImageHeaderV2_X* hdr);
/**
......@@ -202,7 +203,6 @@ protected:
*/
bool theEnableGeolobTagFlag;
private:
TYPE_DATA
......
......@@ -20,6 +20,8 @@
#include <ossim/projection/ossimRpcModel.h>
#include <ossim/support_data/ossimQuickbirdMetaData.h>
#include <ossim/support_data/ossimQuickbirdRpcHeader.h>
#include <memory>
class ossimFilename;
class ossimQuickbirdMetaData;
......@@ -61,6 +63,7 @@ public:
{
return theSupportData.get();
}
protected:
bool parseNitfFile(const ossimFilename &file);
bool parseTiffFile(const ossimFilename &file);
......@@ -78,6 +81,7 @@ protected:
void finishConstruction();
ossimRefPtr<ossimQuickbirdMetaData> theSupportData;
std::shared_ptr<ossimQuickbirdRpcHeader> m_qbRpcHeader;
TYPE_DATA
};
......
......@@ -72,35 +72,35 @@ namespace ossim
* @code
* connection_string: /data/sanfran_utm.tif
* current_entry: 0
* dir0.is_geotiff: 1
* dir0.is_tiled: true
* dir0.tifftag.angular_units: 9108
* dir0.tifftag.bits_per_sample: 8
* dir0.tifftag.compression: 1
* dir0.tifftag.datum_code: 6326
* dir0.tifftag.false_easting: 500000
* dir0.tifftag.false_northing: 0
* dir0.tifftag.gcs_code: 4326
* dir0.tifftag.geo_double_params: (6378137,6356752.3141999999061)
* dir0.tifftag.geo_pixel_scale: (5,5,0)
* dir0.tifftag.geo_tie_points: (0,0,0,538185,4208785,0)
* dir0.tifftag.image_length: 8000
* dir0.tifftag.image_width: 8000
* dir0.tifftag.linear_units: 9001
* dir0.tifftag.max_sample_value: 255
* dir0.tifftag.min_sample_value: 1
* dir0.tifftag.model_type: 1
* dir0.tifftag.origin_lat: 0
* dir0.tifftag.origin_lon: -123
* dir0.tifftag.pcs_code: 32610
* dir0.tifftag.photometric: 2
* dir0.tifftag.planar_config: 1
* dir0.tifftag.raster_type: 2
* dir0.tifftag.sample_format: 1
* dir0.tifftag.samples_per_pixel: 3
* dir0.tifftag.scale_factor: 0.9996
* dir0.tifftag.tile_length: 64
* dir0.tifftag.tile_width: 64
* tiff.image0.is_geotiff: 1
* tiff.image0.is_tiled: true
* tiff.image0.tifftag.angular_units: 9108
* tiff.image0.tifftag.bits_per_sample: 8
* tiff.image0.tifftag.compression: 1
* tiff.image0.tifftag.datum_code: 6326
* tiff.image0.tifftag.false_easting: 500000
* tiff.image0.tifftag.false_northing: 0
* tiff.image0.tifftag.gcs_code: 4326
* tiff.image0.tifftag.geo_double_params: (6378137,6356752.3141999999061)
* tiff.image0.tifftag.geo_pixel_scale: (5,5,0)
* tiff.image0.tifftag.geo_tie_points: (0,0,0,538185,4208785,0)
* tiff.image0.tifftag.image_length: 8000
* tiff.image0.tifftag.image_width: 8000
* tiff.image0.tifftag.linear_units: 9001
* tiff.image0.tifftag.max_sample_value: 255
* tiff.image0.tifftag.min_sample_value: 1
* tiff.image0.tifftag.model_type: 1
* tiff.image0.tifftag.origin_lat: 0
* tiff.image0.tifftag.origin_lon: -123
* tiff.image0.tifftag.pcs_code: 32610
* tiff.image0.tifftag.photometric: 2
* tiff.image0.tifftag.planar_config: 1
* tiff.image0.tifftag.raster_type: 2
* tiff.image0.tifftag.sample_format: 1
* tiff.image0.tifftag.samples_per_pixel: 3
* tiff.image0.tifftag.scale_factor: 0.9996
* tiff.image0.tifftag.tile_length: 64
* tiff.image0.tifftag.tile_width: 64
* image_handler_type:
* number_of_directories: 1
* type: ossim::TiffHandlerState
......@@ -151,7 +151,7 @@ namespace ossim
* Convenience method to return the value of a key given the
* directory. It will construct a new key from the directory. If
* the directory is 0 and the key is sub_file_type then the key that
* is actually queried internally is "dir0.sub_file_type"
* is actually queried internally is "tiff.image0.sub_file_type"
*
* @param value returns the value
* @param directory is the directory to return the key
......@@ -199,6 +199,8 @@ namespace ossim
*/
void loadDefaults(TIFF* tiffPtr);
void loadDefaults(std::shared_ptr<ossim::istream> &str,
const std::string &connectionString);
/**
* Will load only value for the current directory
*
......@@ -311,6 +313,13 @@ namespace ossim
*/
ossim_int32 getLinearUnits(ossim_int32 directory=0)const;
/**
* Convenience method to get tile height.
*
* This does not supply a way to check if a value existed or not.
*/
ossim_int64 getTileLength(ossim_int32 directory = 0) const;
/**
* Convenience method to get image length.
*
......@@ -318,6 +327,13 @@ namespace ossim
*/
ossim_int64 getImageLength(ossim_int32 directory = 0) const;
/**
* Convenience method to get tile width.
*
* This does not supply a way to check if a value existed or not.
*/
ossim_int64 getTileWidth(ossim_int32 directory = 0) const;
/**
* Convenience method to get image width.
*
......@@ -374,6 +390,28 @@ namespace ossim
*/
ossim_float64 getScaleFactor(ossim_int32 directory=0)const;
ossim_int32 getPlanarConfig(ossim_int32 directory = 0) const;
ossim_int32 getPhotoInterpretation(ossim_int32 directory = 0) const;
ossim_int32 getCompressionType(ossim_int32 directory = 0) const;
ossim_uint16 getBitsPerSample(ossim_int32 directory = 0) const;
ossim_uint16 getSamplesPerPixel(ossim_int32 directory = 0) const;
ossim_uint16 getSampleFormat(ossim_int32 directory = 0) const;
ossim_uint32 getRowsPerStrip(ossim_int32 directory = 0) const;
bool getMinSampleValue(ossim_float64 &minSampleValue, ossim_int32 directory = 0) const;
bool getMaxSampleValue(ossim_float64 &maxSampleValue, ossim_int32 directory = 0) const;
bool hasColorMap(ossim_int32 dir)const;
bool isReduced(ossim_int32 directory = 0) const;
bool isPage(ossim_int32 directory = 0) const;
bool isMask(ossim_int32 directory = 0) const;
ossim_int32 getSubFileType(ossim_int32 directory = 0) const;
ossim_uint32 getNumberOfDirectories()const;
bool getColorMap(std::vector<ossim_uint16> &red,
std::vector<ossim_uint16> &green,
std::vector<ossim_uint16> &blue,
ossim_int32 directory = 0) const;
/**
* Convenience method to get a double array.
*
......@@ -412,6 +450,7 @@ namespace ossim
bool getGeoTiePoints(std::vector<ossim_float64>& result,
ossim_int32 directory)const;
bool getCitation(ossimString& citation, ossim_int32 directory)const;
/**
* Convenience method to get a Geo trans matrix array.
*
......
......@@ -224,6 +224,9 @@ private:
//! Resets the PCS code to 0 if invalid.
bool parsePcsCode();
bool parseGcsCode();
//! Initializes data members given a projection. Returns TRUE if successful.
bool parseProjection(ossimMapProjection* map_proj);
......
......@@ -22,6 +22,32 @@ public:
{
return theSpecId.contains("B");
}
bool isQuickbird() const
{
return theSatId.upcase().contains("QB");
}
bool isWorldView() const
{
return theSatId.upcase().contains("WV");
}
bool isWorldView1() const
{
return theSatId.upcase().contains("WV01");
}
bool isWorldView2() const
{
return theSatId.upcase().contains("WV02");
}
bool isWorldView3() const
{
return theSatId.upcase().contains("WV03");
}
bool isWorldView4() const
{
return theSatId.upcase().contains("WV04");
}
bool isGlobal()const;
ossimString theFilename;
ossimString theSatId;
......
......@@ -87,4 +87,3 @@ popd # out of $OSSIM_BUILD_DIR
exit 0
......@@ -1081,7 +1081,7 @@ void ossimImageGeometry::getImageEdgePoints(std::vector<ossimDpt>& result, ossim
}
// Make edge to edge.
imageRect.expand( ossimDpt(0.5, 0.5) );
//imageRect.expand( ossimDpt(0.5, 0.5) );
result.clear();
// First get the image points we will be transforming
......
......@@ -433,14 +433,14 @@ ossim_uint16 ossimImageRenderer::ossimRendererSubRectInfo::getSplitFlags()const
*/
if(result != SPLIT_ALL)
{
ossim_float64 bias = m_ImageToViewScale.length();
// ossim_float64 bias = m_ImageToViewScale.length();
//ossim_float64 bias = (m_ImageToViewScale.x+m_ImageToViewScale.y)/2.0;
//std::cout << "SCALE BIAS = " << bias << "\n";
if (bias < 1.0)
bias = 1.0 / bias;
bias = std::sqrt(bias);
// if (bias < 1.0)
// bias = 1.0 / bias;
// bias = std::sqrt(bias);
if(bias < 1) bias = 1.0;
// if(bias < 1) bias = 1.0;
// if((m_ulRoundTripError.length() > bias)||
// (m_urRoundTripError.length() > bias)||
......@@ -464,6 +464,7 @@ ossim_uint16 ossimImageRenderer::ossimRendererSubRectInfo::getSplitFlags()const
if(!canBilinearInterpolate())
{
// std::cout << "SPLITTING\n";
result = SPLIT_ALL;
}
else
......@@ -771,25 +772,13 @@ bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate() cons
// now check point placement
ossimDpt imageToViewScale = getAbsValueImageToViewScales();
// double testScale = imageToViewScale.length();
double testScale = ossim::max<ossim_float64>(imageToViewScale.x, imageToViewScale.y);
// ossimDpt errorUl = transform->getRoundTripErrorView(m_Vul);
// ossimDpt errorUr = transform->getRoundTripErrorView(m_Vur);
// ossimDpt errorLr = transform->getRoundTripErrorView(m_Vlr);
// ossimDpt errorLl = transform->getRoundTripErrorView(m_Vll);
// if((errorUl.length() > 2 )||
// (errorUr.length() > 2 )||
// (errorLr.length() > 2 )||
// (errorLl.length() > 2))
// {
// return result;
// }
// std::cout << "_______________________\n"
// << "errorUl: " << errorUl << "\n"
// << "errorUr: " << errorUr << "\n"
// << "errorLr: " << errorLr << "\n"
// << "errorLl: " << errorLl << "\n";
if(imageToViewScale.hasNans()) return true;
ossim_float64 bias = imageToViewScale.length();
// root average of 1x1 = sqrt(2)
const double ROOT_AVERAGE = 1.41421356237309504880;
double testScale = imageToViewScale.length()/ROOT_AVERAGE;
// if there is a large shrink or expansion then just return true.
// You are probably not worried about error in bilinear interpolation
......@@ -894,72 +883,48 @@ bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate() cons
double errorCheck3 = (testRight - iRight).length();
double errorCheck4 = (testBottom - iBottom).length();
double errorCheck5 = (testLeft - iLeft).length();
double error = 1.0;
if (testScale >= 1)
// This is crude but we will do a simple scale to find the R0 delta.
// If the R0 delta is within a pixel then we will return true
// for canBilinear
if (testScale <= FLT_EPSILON)
{
errorCheck1 = 0.0;
errorCheck2 = 0.0;
errorCheck3 = 0.0;
errorCheck4 = 0.0;
errorCheck5 = 0.0;
}
else if(testScale > 1.0)
{
// std::cout <<"testScale MUL: " << testScale << "\n";
// std::cout << "errorCheck1: " << errorCheck1 << "\n";
// std::cout << "errorCheck2: " << errorCheck2 << "\n";
// std::cout << "errorCheck3: " << errorCheck3 << "\n";
// std::cout << "errorCheck4: " << errorCheck4 << "\n";
// std::cout << "errorCheck5: " << errorCheck5 << "\n";
// std::cout << "AFTER\n";
// errorCheck1 *= testScale;
// errorCheck2 *= testScale;
// errorCheck3 *= testScale;
// errorCheck4 *= testScale;
// errorCheck5 *= testScale;
// error*=testScale;
// std::cout << "errorCheck1: " << errorCheck1 << "\n";
// std::cout << "errorCheck2: " << errorCheck2 << "\n";
// std::cout << "errorCheck3: " << errorCheck3 << "\n";
// std::cout << "errorCheck4: " << errorCheck4 << "\n";
// std::cout << "errorCheck5: " << errorCheck5 << "\n";
}
else if (testScale >= FLT_EPSILON)
else if(testScale > FLT_EPSILON)
{
// std::cout << "testScale DIV: " << testScale << "\n";
// std::cout << "errorCheck1: " << errorCheck1 << "\n";
// std::cout << "errorCheck2: " << errorCheck2 << "\n";
// std::cout << "errorCheck3: " << errorCheck3 << "\n";
// std::cout << "errorCheck4: " << errorCheck4 << "\n";
// std::cout << "errorCheck5: " << errorCheck5 << "\n";
// errorCheck1 /= testScale;
// errorCheck2 /= testScale;
// errorCheck3 /= testScale;
// errorCheck4 /= testScale;
// errorCheck5 /= testScale;
// std::cout << "AFTER\n";
// std::cout << "errorCheck1: " << errorCheck1 << "\n";
// std::cout << "errorCheck2: " << errorCheck2 << "\n";
// std::cout << "errorCheck3: " << errorCheck3 << "\n";
// std::cout << "errorCheck4: " << errorCheck4 << "\n";
// std::cout << "errorCheck5: " << errorCheck5 << "\n";
// error /= testScale;
}
else
{
errorCheck1 = 0.0;
errorCheck2 = 0.0;
errorCheck3 = 0.0;
errorCheck4 = 0.0;
errorCheck5 = 0.0;
}
// errorCheck1 = sqrt(errorCheck1);
// errorCheck2 = sqrt(errorCheck2);
// errorCheck3 = sqrt(errorCheck3);
// errorCheck4 = sqrt(errorCheck4);
// errorCheck5 = sqrt(errorCheck5);
//std::cout << "errorCheck1:" << errorCheck1 << " ?????? " << error << "\n";
//std::cout << "DIV:" << (errorCheck1 / error) << " ?????? " << error << "\n";
//std::cout << "MULT:" << (errorCheck1 * error) << " ?????? " << error << "\n";
// result = ((errorCheck1 < error) &&
// (errorCheck2 < error) &&
// (errorCheck3 < error) &&
// (errorCheck4 < error) &&
// (errorCheck5 < error));
// std::cout << "error: " << error << "\n";
result = ((errorCheck1 < error) &&
(errorCheck2 < error) &&
(errorCheck3 < error) &&
(errorCheck4 < error) &&
(errorCheck5 < error));
// std::cout << "SCALE BIAS: " << testScale << "\n";
// std::cout << "errorCheck1:" << errorCheck1 << "\n";
result = ((errorCheck1 < 1.0) &&
(errorCheck2 < 1.0) &&
(errorCheck3 < 1.0) &&
(errorCheck4 < 1.0) &&
(errorCheck5 < 1.0));
// std::cout <<"__________________________\n"
// << "ERROR1:" <<errorCheck1 << "\n"
// << "ERROR2:" <<errorCheck2 << "\n"
......
......@@ -224,7 +224,7 @@ void ossimNitfWriterBase::writeGeometry(ossimNitfImageHeaderV2_X* hdr,
if ( theEnableGeolobTagFlag )
{
addGeolobTag( mapProj, hdr );
addGeolobTag( mapInfo, hdr );
}
}
else
......@@ -298,25 +298,23 @@ void ossimNitfWriterBase::addBlockaTag(ossimMapProjectionInfo& mapInfo,
} // matches: if (hdr)
}
void ossimNitfWriterBase::addGeolobTag(const ossimMapProjection* mapProj,
void ossimNitfWriterBase::addGeolobTag(ossimMapProjectionInfo& mapInfo,
ossimNitfImageHeaderV2_X* hdr)
{
if (hdr && mapProj)
if ( hdr && mapInfo.getProjection() )
{
if ( mapProj->isGeographic() == true )
if ( mapInfo.getProjection()->isGeographic() == true )
{
ossimRefPtr<ossimNitfGeolobTag> geolobTag = new ossimNitfGeolobTag();
// This tag wants corners as area:
mapInfo.setPixelType(OSSIM_PIXEL_IS_AREA);
// Get the scale:
ossimDpt gsd = mapProj->getDecimalDegreesPerPixel();
ossimDpt gsd = mapInfo.getDecimalDegreesPerPixel();
if ( (gsd.hasNans() == false) && (gsd.x > 0.0) && (gsd.y > 0.0) )
{
ossimGpt tie = mapProj->getUlGpt();
ossimGpt tie = mapInfo.ulGroundPt();
if ( tie.hasNans() == false )
{
// Shift the tie to edge of pixel:
tie.lat = tie.lat + gsd.y*0.5;
tie.lon = tie.lon - gsd.x*0.5;
if ( (tie.lat <= 90.0) && (tie.lon >= -180.0) )
{
ossimRefPtr<ossimNitfGeolobTag> geolobTag = new ossimNitfGeolobTag();
......@@ -475,4 +473,3 @@ void ossimNitfWriterBase::initializeDefaultsFromConfigFile( ossimNitfFileHeaderV
}
}
}