Skip to content
Commits on Source (17)
......@@ -56,23 +56,15 @@ set( ossimDependentLibs )
# Find required and optional packages and add their include paths and libraries:
#---
# GEOS - Currently optional until it is actually called.:
find_package( GEOS QUIET)
# GEOS - Required:
find_package( GEOS )
if( GEOS_FOUND )
include_directories( ${GEOS_INCLUDE_DIR} )
set( ossimDependentLibs ${ossimDependentLibs} ${GEOS_LIBRARY} )
else( GEOS_FOUND )
message( FATAL_ERROR "Could not find geos package! Consider installing this as it will soon become a required package." )
message( FATAL_ERROR "Could not find required geos package!" )
endif( GEOS_FOUND )
find_package( JsonCpp QUIET)
if( JSONCPP_FOUND )
include_directories( ${JSONCPP_INCLUDE_DIR} )
set( ossimDependentLibs ${ossimDependentLibs} ${JSONCPP_LIBRARY} )
else( JSONCPP_FOUND )
message("Could not find JSONCPP package! Consider installing this as it will soon become a required package." )
endif( JSONCPP_FOUND )
# GEOFIFF - Required:
set( OSSIM_HAS_GEOTIFF 0 )
find_package( GEOTIFF )
......@@ -111,6 +103,16 @@ else( TIFF_FOUND )
message( FATAL_ERROR "Could not find required tiff package!" )
endif( TIFF_FOUND )
# JSONCPP - Required:
find_package( JsonCpp )
if( JSONCPP_FOUND )
include_directories( ${JSONCPP_INCLUDE_DIR} )
set( ossimDependentLibs ${ossimDependentLibs} ${JSONCPP_LIBRARY} )
message("Found JsonCpp" )
else( JSONCPP_FOUND )
message( FATAL_ERROR "Could not find required JsonCpp package!" )
endif( JSONCPP_FOUND )
# This caused a core dump on ossim executables running in jenins pipeline (ossim-test-dev)
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
find_library( DL_LIBRARY dl )
......@@ -132,6 +134,17 @@ endif() # if (CMAKE_SYSTEM_NAME MATCHES "Linux")
# endif( DL_LIBRARY )
#endif( UNIX )
# JSONCPP - Optional:
set( OSSIM_HAS_JSONCPP 0 )
find_package( JsonCpp )
if( JSONCPP_FOUND )
include_directories( ${JSONCPP_INCLUDE_DIR} )
set( ossimDependentLibs ${ossimDependentLibs} ${JSONCPP_LIBRARY} )
set( OSSIM_HAS_JSONCPP 1 )
else( JSONCPP_FOUND )
message("Could not find optional JSONCPP package! Consider installing this as it will soon become a required package." )
endif( JSONCPP_FOUND )
# FREETYPE - Optional:
set( OSSIM_HAS_FREETYPE 0 )
if( BUILD_OSSIM_FREETYPE_SUPPORT )
......@@ -169,7 +182,7 @@ else ( ZLIB_FOUND )
message( WARNING "Could not find optional zlib package!" )
endif ( ZLIB_FOUND )
# HDF5 - Optional
# HDF5 - Optional:
set( OSSIM_HAS_HDF5 0 )
if (BUILD_OSSIM_HDF5_SUPPORT)
message( STATUS "Native HDF5 support requested. Searching for HDF5 library..." )
......@@ -201,8 +214,6 @@ if ( NOT ${Project_WC_REVISION} EQUAL 0 )
set( OSSIM_GIT_REVISION_NUMBER ${Project_WC_REVISION} )
endif()
#####################################################################################
# Call the configure files for ossimConfig and ossimVersion setup
#####################################################################################
......@@ -265,6 +276,7 @@ MESSAGE( STATUS "JPEG_LIBRARY = ${JPEG_LIBRARIES}" )
MESSAGE( STATUS "JPEG_INCLUDE = ${JPEG_INCLUDE_DIR}" )
MESSAGE( STATUS "OSSIM DEPENDENT LIBRARIES = ${ossimDependentLibs}" )
MESSAGE( STATUS "OSSIM_HAS_HDF5 = ${OSSIM_HAS_HDF5}" )
MESSAGE( STATUS "OSSIM_HAS_JSONCPP = ${OSSIM_HAS_JSONCPP}" )
#-----------------------------------------------------------------------------
......@@ -272,8 +284,6 @@ MESSAGE( STATUS "OSSIM_HAS_HDF5 = ${OSSIM_HAS_HDF5}" )
#-----------------------------------------------------------------------------
#OSSIM_ADD_COMMON_MAKE_UNINSTALL()
message("################## end of OSSIM core library setup #########################")
IF(BUILD_OSSIM_APPS)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/apps ${CMAKE_CURRENT_BINARY_DIR}/apps)
ENDIF()
......@@ -288,3 +298,5 @@ endif()
IF(BUILD_OSSIM_TESTS)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/src ${CMAKE_CURRENT_BINARY_DIR}/test/src)
ENDIF()
message("################## end of OSSIM core library setup #########################\n")
......@@ -16,30 +16,33 @@ using namespace std;
#include <ossim/base/ossimStdOutProgress.h>
#include <ossim/base/ossimTimer.h>
#include <ossim/base/ossimKeywordlist.h>
#include <ossim/base/ossimString.h>
#include <ossim/util/ossimToolRegistry.h>
#include <ossim/base/ossimException.h>
#define CINFO ossimNotify(ossimNotifyLevel_INFO)
#define CWARN ossimNotify(ossimNotifyLevel_WARN)
#define CFATAL ossimNotify(ossimNotifyLevel_FATAL)
void showAvailableCommands()
{
ossimToolFactoryBase* factory = ossimToolRegistry::instance();
map<string, string> capabilities;
factory->getCapabilities(capabilities);
map<string, string>::iterator iter = capabilities.begin();
cout<<"\nAvailable commands:\n"<<endl;
CINFO<<"\nAvailable commands:\n"<<endl;
for (;iter != capabilities.end(); ++iter)
cout<<" "<<iter->first<<" -- "<<iter->second<<endl;
cout<<endl;
CINFO<<" "<<iter->first<<" -- "<<iter->second<<endl;
CINFO<<endl;
}
void usage(char* appName)
{
cout << "\nUsages: "<<endl;
cout << " "<<appName<<" <command> [command options and parameters]"<<endl;
cout << " "<<appName<<" --spec <command-spec-file>"<<endl;
cout << " "<<appName<<" --version"<<endl;
cout << " "<<appName<<" help <command> -- To get help on specific command."<<endl;
CINFO << "\nUsages: \n"
<< " "<<appName<<" <command> [command options and parameters]\n"
<< " "<<appName<<" --spec <command-spec-file>\n"
<< " "<<appName<<" --version\n"
<< " "<<appName<<" help <command> -- To get help on specific command."<<endl;
showAvailableCommands();
}
......@@ -53,14 +56,17 @@ bool runCommand(ossimArgumentParser& ap)
if (!utility.valid())
{
cout << "\nDid not understand command <"<<command<<">"<<endl;
CWARN << "\nDid not understand command <"<<command<<">"<<endl;
showAvailableCommands();
return false;
}
ossimTimer* timer = ossimTimer::instance();
timer->setStartTick();
if (!utility->initialize(ap))
{
cout << "\nCould not execute command <"<<command<<"> with arguments and options "
CWARN << "\nCould not execute command <"<<command<<"> with arguments and options "
"provided."<<endl;
return false;
}
......@@ -70,10 +76,11 @@ bool runCommand(ossimArgumentParser& ap)
if (!utility->execute())
{
cout << "\nAn error was encountered executing the command. Check options."<<endl;
CWARN << "\nAn error was encountered executing the command. Check options."<<endl;
return false;
}
//CINFO << "\nElapsed time after initialization: "<<timer->time_s()<<" s.\n"<<endl;
return true;
}
......@@ -105,7 +112,7 @@ int main(int argc, char *argv[])
ifstream ifs (argv[2]);
if (ifs.fail())
{
cout<<"\nCould not open the spec file at <"<<argv[2]<<">\n"<<endl;
CWARN<<"\nCould not open the spec file at <"<<argv[2]<<">\n"<<endl;
status_ok = false;
break;
}
......@@ -151,15 +158,11 @@ int main(int argc, char *argv[])
} while (false);
}
catch (const ossimException& e)
catch (const exception& e)
{
ossimNotify(ossimNotifyLevel_FATAL)<<e.what()<<endl;
CFATAL<<e.what()<<endl;
exit(1);
}
catch( ... )
{
cerr << "Caught unknown exception!" << endl;
}
if (status_ok)
exit(0);
......
......@@ -2,16 +2,12 @@
#include <ossim/base/ossimNotifyContext.h>
#include <ossim/base/ossimArgumentParser.h>
#include <ossim/base/ossimApplicationUsage.h>
#include <ossim/base/ossimTrace.h>
#include <ossim/base/ossimKeywordNames.h>
#include <ossim/base/ossimRefPtr.h>
#include <ossim/imaging/ossimImageGeometry.h>
#include <ossim/imaging/ossimImageHandler.h>
#include <ossim/imaging/ossimImageHandlerRegistry.h>
#include <ossim/projection/ossimProjectionFactoryRegistry.h>
#include <ossim/projection/ossimProjection.h>
#include <ossim/projection/ossimRpcSolver.h>
#include <sstream>
#include <ossim/base/ossimXmlDocument.h>
using namespace std;
......@@ -182,8 +178,6 @@ int main(int argc, char* argv[])
ossimNotify(ossimNotifyLevel_INFO) << "\nSolving for RPC coefficients..." << std::endl;
ossimRefPtr<ossimRpcSolver> solver = new ossimRpcSolver(true, false);
bool converged = solver->solve(imageRect, geom.get(), error);
double meanResidual = solver->getRmsError();
double maxResidual = solver->getMaxError();
rpc = solver->getRpcModel();
}
......
......@@ -122,8 +122,8 @@ IF(BUILD_OSSIM_VIDEO AND EXISTS ${OSSIM_DEV_HOME}/ossim-video)
add_subdirectory(${OSSIM_DEV_HOME}/ossim-video ${CMAKE_CURRENT_BINARY_DIR}/ossim-video)
ENDIF()
IF(BUILD_ISA_PLUGIN AND EXISTS ${OSSIM_DEV_HOME}/ossim-isa-plugin)
add_subdirectory(${OSSIM_DEV_HOME}/ossim-isa-plugin ${CMAKE_CURRENT_BINARY_DIR}/ossim-isa-plugin)
IF(BUILD_MSP_PLUGIN AND EXISTS ${OSSIM_DEV_HOME}/ossim-msp-plugin)
add_subdirectory(${OSSIM_DEV_HOME}/ossim-msp-plugin ${CMAKE_CURRENT_BINARY_DIR}/ossim-msp-plugin)
ENDIF()
IF(BUILD_CSM_PLUGIN AND EXISTS ${OSSIM_DEV_HOME}/ossim-csm-plugin)
......@@ -188,6 +188,10 @@ IF(BUILD_DSMG AND EXISTS ${OSSIM_DEV_HOME}/ossim-dsmg)
add_subdirectory(${OSSIM_DEV_HOME}/ossim-dsmg ${CMAKE_CURRENT_BINARY_DIR}/ossim-dsmg)
ENDIF()
IF(BUILD_OSSIM_ISA AND EXISTS ${OSSIM_DEV_HOME}/ossim-isa)
add_subdirectory(${OSSIM_DEV_HOME}/ossim-isa ${CMAKE_CURRENT_BINARY_DIR}/ossim-isa)
ENDIF()
############################## Doxygen installation for current ossim core module ###########################################
FIND_PACKAGE(Doxygen)
......@@ -365,6 +369,6 @@ MESSAGE( STATUS "BUILD_OSSIM_WMS = ${BUILD_OSSIM_WMS}" )
MESSAGE( STATUS "BUILD_LIBRARY_DIR = ${BUILD_LIBRARY_DIR}" )
MESSAGE( STATUS "BUILD_RUNTIME_DIR = ${BUILD_RUNTIME_DIR}" )
MESSAGE( STATUS "BUILD_DSMG = ${BUILD_DSMG}" )
MESSAGE( STATUS "BUILD_ISA_PLUGIN = ${BUILD_ISA_PLUGIN}" )
MESSAGE( STATUS "BUILD_MSP_PLUGIN = ${BUILD_MSP_PLUGIN}" )
MESSAGE( STATUS "BUILD_CSM_PLUGIN = ${BUILD_CSM_PLUGIN}" )
MESSAGE( STATUS "Use OSSIM_BUILD_ADDITIONAL_DIRECTORIES to add other cmake builds." )
......@@ -34,14 +34,13 @@ find_path(OPENCV_INCLUDE_DIR opencv/cv.hpp PATHS ${OPENCV_HOME}/include)
macro(FIND_OPENCV_LIBRARY MYLIBRARY MYLIBRARYNAME)
find_library( ${MYLIBRARY}
NAMES "${MYLIBRARYNAME}${OPENCV_RELEASE_POSTFIX}"
PATHS ${OPENCV_HOME}/lib)
PATHS ${OPENCV_HOME}/lib ${OPENCV_HOME}/share/OpenCV/3rdparty/lib )
endmacro(FIND_OPENCV_LIBRARY MYLIBRARY MYLIBRARYNAME)
# Required
FIND_OPENCV_LIBRARY(OPENCV_CORE_LIBRARY opencv_core)
FIND_OPENCV_LIBRARY(OPENCV_FEATURES2D_LIBRARY opencv_features2d)
FIND_OPENCV_LIBRARY(OPENCV_FLANN_LIBRARY opencv_flann)
FIND_OPENCV_LIBRARY(OPENCV_HIGHGUI_LIBRARY opencv_highgui)
FIND_OPENCV_LIBRARY(OPENCV_IMGPROC_LIBRARY opencv_imgproc)
FIND_OPENCV_LIBRARY(OPENCV_ML_LIBRARY opencv_ml)
FIND_OPENCV_LIBRARY(OPENCV_OBJDETECT_LIBRARY opencv_objdetect)
......@@ -49,22 +48,16 @@ FIND_OPENCV_LIBRARY(OPENCV_XFEATURES2D_LIBRARY opencv_xfeatures2d)
FIND_OPENCV_LIBRARY(OPENCV_PHOTO_LIBRARY opencv_photo)
FIND_OPENCV_LIBRARY(OPENCV_VIDEO_LIBRARY opencv_video)
# Optional
FIND_OPENCV_LIBRARY(OPENCV_IMGCODECS_LIBRARY opencv_imgcodecs)
FIND_OPENCV_LIBRARY(OPENCV_CUDAARITHM_LIBRARY opencv_cudaarithm)
FIND_OPENCV_LIBRARY(OPENCV_CUDAIMGPROC_LIBRARY opencv_cudaimgproc)
FIND_OPENCV_LIBRARY(OPENCV_CUDEV_LIBRARY opencv_cudev)
set(OPENCV_LIBRARIES ${OPENCV_OBJDETECT_LIBRARY}
${OPENCV_CORE_LIBRARY}
${OPENCV_VIDEO_LIBRARY}
${OPENCV_PHOTO_LIBRARY}
${OPENCV_ML_LIBRARY}
${OPENCV_IMGPROC_LIBRARY}
${OPENCV_FLANN_LIBRARY}
${OPENCV_FEATURES2D_LIBRARY}
${OPENCV_XFEATURES2D_LIBRARY}
${OPENCV_FLANN_LIBRARY}
${OPENCV_HIGHGUI_LIBRARY}
${OPENCV_IMGPROC_LIBRARY}
${OPENCV_ML_LIBRARY}
${OPENCV_PHOTO_LIBRARY}
${OPENCV_VIDEO_LIBRARY})
${OPENCV_CORE_LIBRARY}
)
set(OPENCV_FOUND "NO")
if ( OPENCV_INCLUDE_DIR AND
......@@ -72,7 +65,6 @@ if ( OPENCV_INCLUDE_DIR AND
OPENCV_FEATURES2D_LIBRARY AND
OPENCV_XFEATURES2D_LIBRARY AND
OPENCV_FLANN_LIBRARY AND
OPENCV_HIGHGUI_LIBRARY AND
OPENCV_IMGPROC_LIBRARY AND
OPENCV_ML_LIBRARY AND
OPENCV_OBJDETECT_LIBRARY AND
......@@ -84,11 +76,35 @@ else()
message( "${OPENCV_LIBRARIES}" )
endif()
if (OPENCV_FOUND)
FIND_OPENCV_LIBRARY(OPENCV_IPPICV_LIBRARY ippicv)
if ( OPENCV_IPPICV_LIBRARY )
set( OPENCV_LIBRARIES ${OPENCV_LIBRARIES} ${OPENCV_IPPICV_LIBRARY} )
else()
message( WARNING "Could not find libippicv needed by OpenCV." )
endif()
FIND_OPENCV_LIBRARY(OPENCV_ILMIMF_LIBRARY IlmImf)
if ( OPENCV_ILMIMF_LIBRARY )
set( OPENCV_LIBRARIES ${OPENCV_LIBRARIES} ${OPENCV_ILMIMF_LIBRARY} )
else()
message( WARNING "Could not find IlmImf needed by OpenCV." )
endif()
FIND_OPENCV_LIBRARY(OPENCV_LIBTIFF_LIBRARY libtiff)
if ( OPENCV_LIBTIFF_LIBRARY )
set( OPENCV_LIBRARIES ${OPENCV_LIBRARIES} ${OPENCV_LIBTIFF_LIBRARY} )
else()
message( WARNING "Could not find libtiff needed by OpenCV." )
endif()
# Optional
FIND_OPENCV_LIBRARY(OPENCV_IMGCODECS_LIBRARY opencv_imgcodecs)
FIND_OPENCV_LIBRARY(OPENCV_CUDAARITHM_LIBRARY opencv_cudaarithm)
FIND_OPENCV_LIBRARY(OPENCV_CUDAIMGPROC_LIBRARY opencv_cudaimgproc)
FIND_OPENCV_LIBRARY(OPENCV_CUDEV_LIBRARY opencv_cudev)
FIND_OPENCV_LIBRARY(OPENCV_HIGHGUI_LIBRARY opencv_highgui)
set(OPENCV_GPU_FOUND "NO")
if ( OPENCV_FOUND AND
OPENCV_CUDAARITHM_LIBRARY AND
OPENCV_CUDAIMGPROC_LIBRARY AND
OPENCV_CUDEV_LIBRARY)
if ( OPENCV_CUDAARITHM_LIBRARY AND OPENCV_CUDAIMGPROC_LIBRARY AND OPENCV_CUDEV_LIBRARY)
set(OPENCV_GPU_FOUND "YES")
set(OPENCV_LIBRARIES ${OPENCV_LIBRARIES}
${OPENCV_CUDAARITHM_LIBRARY}
......@@ -99,13 +115,25 @@ else()
endif()
set(OPENCV_IMGCODECS_FOUND "NO")
if(OPENCV_FOUND AND OPENCV_IMGCODECS_LIBRARY)
if(OPENCV_IMGCODECS_LIBRARY)
set(OPENCV_IMGCODECS_FOUND "YES")
set(OPENCV_LIBRARIES ${OPENCV_LIBRARIES} ${OPENCV_IMGCODECS_LIBRARY})
else()
message( "Could not find optional OpenCV Image Codecs Library" )
endif()
set(OPENCV_HIGHGUI_FOUND 0)
if(OPENCV_HIGHGUI_LIBRARY)
set(OPENCV_HIGHGUI_FOUND 1)
set(OPENCV_LIBRARIES ${OPENCV_LIBRARIES} ${OPENCV_HIGHGUI_LIBRARY})
else()
message( "Could not find optional OpenCV HighGui Library" )
endif()
# Unfortunately, OpenCV inter-library dependency is so complicated, we just list the libs twice:
set(OPENCV_LIBRARIES ${OPENCV_LIBRARIES} ${OPENCV_LIBRARIES} )
endif()
if(OPENCV_FOUND)
message( STATUS "OPENCV_INCLUDE_DIR = ${OPENCV_INCLUDE_DIR}" )
message( STATUS "OPENCV_LIBRARIES = ${OPENCV_LIBRARIES}" )
......
......@@ -147,6 +147,9 @@ if [ -z $BUILD_OSSIM_ISA ] ; then
fi
# Plugins:
if [ -z $BUILD_ATP_PLUGIN ]; then
BUILD_ATP_PLUGIN=OFF
fi
if [ -z $BUILD_CNES_PLUGIN ]; then
BUILD_CNES_PLUGIN=OFF
fi
......@@ -165,8 +168,8 @@ fi
if [ -z $BUILD_HDF5_PLUGIN ]; then
BUILD_HDF5_PLUGIN=OFF
fi
if [ -z $BUILD_ISA_PLUGIN ]; then
BUILD_ISA_PLUGIN=OFF
if [ -z $BUILD_MSP_PLUGIN ]; then
BUILD_MSP_PLUGIN=OFF
fi
if [ -z $BUILD_KAKADU_PLUGIN ]; then
BUILD_KAKADU_PLUGIN=OFF
......@@ -251,10 +254,10 @@ cmake -G "$CMAKE_G_ARG" \
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DCMAKE_OSX_SYSROOT=$CMAKE_OSX_SYSROOT \
-DCMAKE_OSX_DEPLOYMENT_TARGET=$CMAKE_OSX_DEPLOYMENT_TARGET \
-DCMAKE_ECLIPSE_VERSION=$CMAKE_ECLIPSE_VERSION \
-DBUILD_OSSIM_FRAMEWORKS=${BUILD_OSSIM_FRAMEWORKS} \
-DBUILD_OMS=$BUILD_OMS \
-DBUILD_OSSIM_PLANET_GUI=${BUILD_OSSIM_PLANET_GUI} \
-DBUILD_ATP_PLUGIN=$BUILD_ATP_PLUGIN \
-DBUILD_CNES_PLUGIN=$BUILD_CNES_PLUGIN \
-DBUILD_CSM_PLUGIN=$BUILD_CSM_PLUGIN \
-DBUILD_DSMG=$BUILD_DSMG \
......@@ -263,7 +266,7 @@ cmake -G "$CMAKE_G_ARG" \
-DBUILD_GEOPDF_PLUGIN=$BUILD_GEOPDF_PLUGIN \
-DBUILD_GDAL_PLUGIN=$BUILD_GDAL_PLUGIN \
-DBUILD_HDF5_PLUGIN=$BUILD_HDF5_PLUGIN \
-DBUILD_ISA_PLUGIN=$BUILD_ISA_PLUGIN \
-DBUILD_MSP_PLUGIN=$BUILD_MSP_PLUGIN \
-DBUILD_KAKADU_PLUGIN=$BUILD_KAKADU_PLUGIN \
-DBUILD_JPEG12_PLUGIN=$BUILD_JPEG12_PLUGIN \
-DKAKADU_ROOT_SRC=$KAKADU_ROOT_SRC \
......
ossim (2.2.0-1~exp2) UNRELEASED; urgency=medium
ossim (2.3.0-1~exp1) experimental; urgency=medium
* Team upload.
* New upstream release.
* Refresh patches.
-- Bas Couwenberg <sebastic@debian.org> Mon, 05 Mar 2018 19:46:24 +0100
ossim (2.2.2-1) unstable; urgency=medium
* Team upload.
* New upstream release.
-- Bas Couwenberg <sebastic@debian.org> Wed, 07 Feb 2018 18:43:33 +0100
ossim (2.2.1-1) unstable; urgency=medium
* Team upload.
* New upstream release.
* Bump Standards-Version to 4.1.3, no changes.
-- Bas Couwenberg <sebastic@debian.org> Tue, 09 Jan 2018 18:37:52 +0100
ossim (2.2.0-1) unstable; urgency=medium
* Team upload.
* Override dh_makeshlibs to use -V.
* Add strict binary version dependency on libossim to ossim-core.
* Add manpages for new utilities.
* Move from experimental to unstable.
-- Bas Couwenberg <sebastic@debian.org> Sun, 10 Dec 2017 11:52:50 +0100
-- Bas Couwenberg <sebastic@debian.org> Wed, 27 Dec 2017 19:46:25 +0100
ossim (2.2.0-1~exp1) experimental; urgency=medium
......
......@@ -14,7 +14,7 @@ Build-Depends: cmake (>= 2.8),
libpng-dev,
libtiff-dev,
zlib1g-dev
Standards-Version: 4.1.2
Standards-Version: 4.1.3
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-grass/ossim.git
Vcs-Git: https://anonscm.debian.org/git/pkg-grass/ossim.git -b experimental
Homepage: https://trac.osgeo.org/ossim/
......
......@@ -143,7 +143,7 @@ Author: Bas Couwenberg <sebastic@debian.org>
<< "\n Example:"
--- a/apps/ossim-rpcgen/ossim-rpcgen.cpp
+++ b/apps/ossim-rpcgen/ossim-rpcgen.cpp
@@ -42,7 +42,7 @@ int main(int argc, char* argv[])
@@ -38,7 +38,7 @@ int main(int argc, char* argv[])
argumentParser.getApplicationName() + " takes an input image and generates a "
"corresponding RPC geometry in a variety of formats. If a bounding box is specified, the "
"default output filename (based on the input filename) will be appended with the bbox spec"
......
//**************************************************************************************************
//
// OSSIM Open Source Geospatial Data Processing Library
// See top level LICENSE.txt file for license information
//
//**************************************************************************************************
#ifndef JsonInterface_HEADER
#define JsonInterface_HEADER 1
#include <json/json.h>
namespace ossim {
/**
* Pure virtual interface for classes implementing JSON-based load/save state..
* Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
* for JSON formats used.
*/
class JsonInterface
{
public:
JsonInterface() {}
virtual ~JsonInterface() {}
virtual void loadJSON(const Json::Value& jsonNode) = 0;
virtual void saveJSON(Json::Value& jsonNode) const = 0;
};
}
#endif
......@@ -339,7 +339,7 @@ public:
* or an empty string if the key was not found.
* @param key e.g. "number_line"
* @param prefix e..g "image0."
* @return Reference to string. This will be emptry if not found or
* @return Reference to string. This will be empty if not found or
* if value is empty.
*/
const std::string& findKey(const std::string& key) const;
......@@ -390,6 +390,20 @@ public:
virtual void writeToStream(std::ostream &out)const;
/**
* Outputs in xml format.
* @param out Stream to write to.
* @param rootTag name of the root XML element/tag
*/
void toXML(std::ostream &out, const std::string& rootTag="info")const;
/**
* Outputs in json format.
* @param out Stream to write to.
* @param rootTag name of the root json element/tag
*/
void toJSON(std::ostream &out, const std::string& rootTag="info")const;
virtual std::ostream& print(std::ostream& os) const;
OSSIMDLLEXPORT friend std::ostream& operator<<(std::ostream& os,
const ossimKeywordlist& kwl);
......@@ -566,6 +580,17 @@ protected:
KeywordMap::iterator getMapEntry(const ossimString& key);
KeywordMap::iterator getMapEntry(const char* key);
// For toXML method lifted from oms::DataInfo.
bool isSpecialXmlCharacters(const ossimString& value) const;
bool isValidTag(const std::string& value)const;
void replaceSpecialCharacters(ossimString& value)const;
/**
* @return true if a == b, false if not.
*/
bool isSame( const std::vector<ossimString>& a,
const std::vector<ossimString>& b ) const;
KeywordMap m_map;
char m_delimiter;
......
......@@ -2,8 +2,6 @@
//
// License: MIT
//
// See LICENSE.txt file in the top level directory for more details.
//
// Author: David Burken
//
// Description: Generic image writer class.
......@@ -14,10 +12,14 @@
#define ossimWriter_HEADER 1
#include <ossim/base/ossimConstants.h>
#include <ossim/base/ossimIpt.h>
#include <ossim/imaging/ossimImageFileWriter.h>
#include <iosfwd>
#include <vector>
class ossimKeywordlist;
class ossimProperty;
/**
* @brief ossimWriter - Generic image writer.
*
......@@ -101,6 +103,56 @@ public:
*/
virtual bool setOutputStream(std::ostream& str);
/**
* @brief Sets the output tile size for tiled formats.
* @param tileSize Must be a multiple of 16.
*/
virtual void setTileSize(const ossimIpt& tileSize);
/**
* @brief Gets the tile size.
* @return Reference to tile size.
*/
virtual const ossimIpt& getOutputTileSize() const;
/**
* @brief Saves the state of the object.
*/
virtual bool saveState(ossimKeywordlist& kwl,
const char* prefix=0)const;
/**
* Method to the load (recreate) the state of an object from a keyword
* list. Return true if ok or false on error.
*/
virtual bool loadState(const ossimKeywordlist& kwl,
const char* prefix=0);
/**
* Will set the property whose name matches the argument
* "property->getName()".
*
* @param property Object containing property to set.
*/
virtual void setProperty(ossimRefPtr<ossimProperty> property);
/**
* @param name Name of property to return.
*
* @returns A pointer to a property object which matches "name". Returns
* NULL if no match is found.
*/
virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name) const;
/**
* Pushes this's names onto the list of property names.
*
* @param propertyNames array to add this's property names to.
*/
virtual void getPropertyNames(std::vector<ossimString>& propertyNames) const;
protected:
/**
......@@ -140,13 +192,9 @@ private:
* @brief Writes tags TIFFTAG_MINSAMPLEVALUE(280) and
* TIFFTAG_MAXSAMPLEVALUE(281). Only written if scalar type is an unsigned
* byte or short.
* @param minBands Array of min values from image write.
* @param maxBands Array of max values from image write.
* @return true on success, false on error.
*/
bool writeMinMaxTiffTags( const std::vector<ossim_float64>& minBands,
const std::vector<ossim_float64>& maxBands,
std::streamoff& arrayWritePos );
bool writeMinMaxTiffTags( std::streamoff& arrayWritePos );
/**
......@@ -155,7 +203,9 @@ private:
* unsigned byte or short.
* @param minBands Array of min values from image write.
* @param maxBands Array of max values from image write.
* @return true on success, false on error.
* @return true if tags are written, false if not.
* A false return is not necessarily an error, just means the
* tags were not written due to the scalar type.
*/
bool writeSMinSMaxTiffTags( const std::vector<ossim_float64>& minBands,
const std::vector<ossim_float64>& maxBands,
......@@ -200,9 +250,50 @@ private:
*/
ossim_uint16 getTiffSampleFormat() const;
/**
* @return true if the output type is tiled, false if not.
*/
bool isTiled() const;
/**
* @return Value of options key: "align_tiles".
* If true, aligns tile addresses to 4096 boundary.
* default=true
*/
bool getAlignTilesFlag() const;
/**
* @return Value of options key: "flush_tiles".
* If true, aligns tile addresses to block boundary.
* default=true
*/
ossim_int64 getBlockSize() const;
/**
* @return Value of options key: "flush_tiles".
* If true, ostream::flush() is called after each tile write.
* default=true
*/
bool getFlushTilesFlag() const;
/**
* @return Value of options key: "include_blank_tiles".
* If true, empty/blank tiles will be written; if false, the tile will not
* be written, the tile offset and byte count will be set to zero.
* default=true (write blanks).
*/
bool getWriteBlanksFlag() const;
bool needsMinMax() const;
std::ostream* m_str;
bool m_ownsStreamFlag;
/** Hold all options. */
ossimRefPtr<ossimKeywordlist> m_kwl;
ossimIpt m_outputTileSize;
}; // End: class ossimWriter
#endif /* End of "#ifndef ossimWriter_HEADER" */
//**************************************************************************************************
//
// OSSIM Open Source Geospatial Data Processing Library
// See top level LICENSE.txt file for license information
//
//**************************************************************************************************
#pragma once
#include <ostream>
#include <ossim/plugin/ossimPluginConstants.h>
#include <ossim/base/JsonInterface.h>
#include <ossim/base/ossimFilename.h>
#include <vector>
#include <map>
namespace ossim
{
// Forward decl defined after JsonParam
class JsonParam;
/**
* Base class for maintaining parameters affecting the runtime configuration of OSSIM executables.
* The state is imported and exported via JSON. There are default configuration files that should
* be part of the install, that are accessed by this class. Custom settings can also be loaded.
*
* There are two functionally equivalent forms for specifying parameters: long and short.
* Parameters are initially declared via the long form with descriptions and default values. These
* values must be supplied in default JSON files as part of the OSSIM install.
*
* Once the parameters are declared via the long form, the short form can be used to supply runtime
* overrides.
*
* The long form format is
*
* { "parameters": [
* {
* "name": "<param_name>",
* "descr": "<param description",
* "type": "string"|"float"|"uint"|"int"|"bool",
* "value": <value>
* }, ...
* ]
* }
*
* The short form is:
*
* { "parameters": [
* "<param_name>": <value>, ...
* ]
* }
*
* The short form parameter is only accepted if it has previously been loaded via the long form so
* that the data type is known.
*
* Parameters are usually accessed knowing the data type ahead of time. For example, a string
* parameter is accessed as:
*
* string paramVal = jsonConfig.getParameter("param_name").asSTring();
*
* If the parameter is not found, the special null-parameter is returned from getParameter(), and
* casting to a tye will return 0, false, or empty string.
*/
class OSSIM_DLL JsonConfig : public ossim::JsonInterface
{
public:
JsonConfig();
/** Default Ctor loads all default .json files in the share/ossim system dir */
JsonConfig(const ossimFilename& configFile);
//! Destructor
virtual ~JsonConfig();
//! Opens and parses JSON file. The "parameters" keyword is expected in the root node
bool open(const ossimFilename& configFile);
//! Reads the params controlling the process from the JSON node named "parameters".
virtual void loadJSON(const Json::Value& params_json_node);
//! Reads the params controlling the process from the JSON node named "parameters".
virtual void saveJSON(Json::Value& params_json_node) const;
//! Returns a parameter (might be a null parameter if paramName not found in the configuration.
JsonParam& getParameter(const char* paramName);
/** Adds parameter to the configuration. Any previous parameter of the same name is replaced. */
void setParameter(const JsonParam& p);
//! Convenience method returns TRUE if the currently set diagnostic level is <= level
bool diagnosticLevel(unsigned int level) const;
//! Outputs JSON to output stream provided.
friend std::ostream& operator<<(std::ostream& out, const JsonConfig& obj);
bool paramExists(const char* paramName) const;
protected:
JsonConfig(const JsonConfig& /*hide_this*/) {}
bool getBoolValue(bool& rtn_val, const std::string& json_value) const;
std::map<std::string, JsonParam> m_paramsMap;
static JsonParam s_nullParam;
};
/**
* Represents a single configuration parameter. This class provides for packing and unpacking the
* parameter from JSON payload, and provides for handling all datatypes of parameters.
*/
class JsonParam
{
public:
enum ParamType {
UNASSIGNED=0,
BOOL=1,
INT=2,
UINT=3,
FLOAT=4,
STRING=5,
VECTOR=6
};
JsonParam() : _type(UNASSIGNED), _value(0) {}
JsonParam(const ossimString& argname,
const ossimString& arglabel,
const ossimString& argdescr,
ParamType argparamType,
void* value);
JsonParam(const JsonParam& copy);
~JsonParam() { resetValue(); }
/** Initializes from a JSON node. Return true if successful */
bool loadJSON(const Json::Value& json_node);
void saveJSON(Json::Value& json_node) const;
const ossimString& name() const { return _name; }
const ossimString& label() const { return _label; }
const ossimString& descr() const { return _descr; }
ParamType type() const { return _type; }
bool isBool() const {return (_type == BOOL); }
bool asBool() const;
bool isUint() const {return (_type == UINT); }
unsigned int asUint() const;
bool isInt() const {return (_type == INT);}
int asInt() const;
bool isFloat() const {return (_type == FLOAT);}
double asFloat() const;
bool isString() const {return (_type == STRING);}
std::string asString() const;
bool isVector() const {return (_type == VECTOR);}
void asVector(std::vector<double>& v) const;
bool operator==(const JsonParam& p) const { return (p._name == _name); }
/** Outputs JSON to output stream provided */
friend std::ostream& operator<<(std::ostream& out, const JsonParam& obj);
private:
void setValue(void* value);
void resetValue();
ossimString _name;
ossimString _label;
ossimString _descr;
ParamType _type;
void* _value;
std::vector<ossimString> _allowedValues; // only used for multiple-choice string parameters
};
}
......@@ -26,9 +26,9 @@ class OSSIMDLLEXPORT ossimPointBlock: public ossimDataObject
public:
typedef std::vector< ossimRefPtr<ossimPointRecord> > PointList;
ossimPointBlock(ossimSource* owner=0, ossim_uint32 fields=0);
explicit ossimPointBlock(ossimSource* owner=0, ossim_uint32 fields=0);
virtual ~ossimPointBlock();
~ossimPointBlock();
/** Returns allocated size. The pointList may contain only null points if not assigned */
virtual ossim_uint32 size() const { return (ossim_uint32)m_pointList.size(); }
......@@ -80,7 +80,7 @@ public:
virtual void initialize() {};
protected:
ossimPointBlock(const ossimPointBlock& rhs);
ossimPointBlock(const ossimPointBlock& rhs) {}
void scanForMinMax() const;
ossimPointRecord m_nullPCR;
......
......@@ -69,8 +69,8 @@ public:
* corner of the tile to grab from the image.
* Satisfies pure virtual from TileSource class.
*/
virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
ossim_uint32 resLevel=0);
ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
ossim_uint32 resLevel=0) override;
/**
* Method to get a tile.
......@@ -82,14 +82,14 @@ public:
* is undefined so caller should handle appropriately with makeBlank or
* whatever.
*/
virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
bool getTile(ossimImageData* result, ossim_uint32 resLevel=0) override;
/**
* @brief Gets bands.
* Satisfies ossimImageSource::getNumberOfInputBands pure virtual.
* @retrun Number of bands.
*/
virtual ossim_uint32 getNumberOfInputBands() const;
ossim_uint32 getNumberOfInputBands() const override;
/**
* @brief Gets lines.
......@@ -98,7 +98,7 @@ public:
* Default = 0
* @return The number of lines for specified reduced resolution level.
*/
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const override;
/**
* @brief Gets samples.
......@@ -107,7 +107,7 @@ public:
* Default = 0
* @return The number of samples for specified reduced resolution level.
*/
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const override;
/**
* @brief Gets tile width.
......@@ -117,7 +117,7 @@ public:
* returns the output tile width which can be different than the internal
* image tile width on disk.
*/
virtual ossim_uint32 getImageTileWidth() const;
ossim_uint32 getImageTileWidth() const override;
/**
* @brief Gets tile height.
......@@ -127,16 +127,16 @@ public:
* returns the output tile width which can be different than the internal
* image tile width on disk.
*/
virtual ossim_uint32 getImageTileHeight() const;
ossim_uint32 getImageTileHeight() const override;
/** @return The width of the output tile. */
virtual ossim_uint32 getTileWidth() const;
ossim_uint32 getTileWidth() const override;
/** @returns The height of the output tile. */
virtual ossim_uint32 getTileHeight() const;
ossim_uint32 getTileHeight() const override;
/** @return The output pixel type of the tile source. */
ossimScalarType getOutputScalarType() const;
ossimScalarType getOutputScalarType() const override;
/**
* @brief Gets entry list.
......@@ -146,51 +146,51 @@ public:
* will be needed to rasterize that data channel as well.
* @param entryList This is the list to initialize with entry indexes.
*/
virtual void getEntryList(std::vector<ossim_uint32>& entryList) const;
void getEntryList(std::vector<ossim_uint32>& entryList) const override;
virtual void getEntryNames(std::vector<ossimString>& entryNames) const;
void getEntryNames(std::vector<ossimString>& entryNames) const override;
/** @return The current entry number. */
virtual ossim_uint32 getCurrentEntry() const;
ossim_uint32 getCurrentEntry() const override;
/**
* @param entryIdx Entry number to select.
* @return true if it was able to set the current entry and false otherwise.
*/
virtual bool setCurrentEntry(ossim_uint32 entryIdx);
bool setCurrentEntry(ossim_uint32 entryIdx) override;
/** @return "point-cloud" */
virtual ossimString getShortName() const;
ossimString getShortName() const override;
/** @return "ossim point cloud to image renderer" */
virtual ossimString getLongName() const;
ossimString getLongName() const override;
/**
* Returns the image geometry object associated with this tile source or
* NULL if non defined. The geometry contains full-to-local image
* transform as well as projection (image-to-world).
*/
virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
ossimRefPtr<ossimImageGeometry> getImageGeometry() override;
/** @return Min pixel value. */
virtual double getMinPixelValue(ossim_uint32 band=0) const;
double getMinPixelValue(ossim_uint32 band) const override;
/** @return Min pixel value. */
virtual double getMaxPixelValue(ossim_uint32 band=0) const;
double getMaxPixelValue(ossim_uint32 band) const override;
/** @return Min pixel value. */
virtual double getNullPixelValue(ossim_uint32 band=0) const;
double getNullPixelValue(ossim_uint32 band) const override;
/** @return The total number of decimation levels. */
virtual ossim_uint32 getNumberOfDecimationLevels() const;
ossim_uint32 getNumberOfDecimationLevels() const override;
virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
bool saveState(ossimKeywordlist& kwl, const char* prefix) const override;
virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
bool loadState(const ossimKeywordlist& kwl, const char* prefix) override;
virtual void getValidImageVertices(std::vector<ossimIpt>& validVertices,
ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
ossim_uint32 resLevel=0) const;
void getValidImageVertices(std::vector<ossimIpt>& validVertices,
ossimVertexOrdering ordering,
ossim_uint32 resLevel) const override;
/**
* The reader properties are:
......@@ -201,8 +201,8 @@ public:
* -- the active component ("component") as string with possible values
* "intensity", "highest", "lowest", "returns", or "rgb", respectively (case insensitive)
*/
void setProperty(ossimRefPtr<ossimProperty> property);
ossimRefPtr<ossimProperty> getProperty(const ossimString& name) const;
void setProperty(ossimRefPtr<ossimProperty> property) override;
ossimRefPtr<ossimProperty> getProperty(const ossimString& name) const override;
/**
* Permits backdoor for setting the input point cloud handler object. Useful for debug
......@@ -223,7 +223,9 @@ protected:
PcrBucket() : m_bucket(0), m_numSamples(0) {}
PcrBucket(const ossim_float32* init_value, ossim_uint32 numBands);
PcrBucket(const ossim_float32& R, const ossim_float32& G, const ossim_float32& B);
PcrBucket(const ossim_float32& init_value);
explicit PcrBucket(const ossim_float32& init_value);
~PcrBucket();
ossim_float32* m_bucket;
int m_numSamples;
......
......@@ -20,46 +20,24 @@
#include <vector>
class ossimImageData;
class ossimPointCloudUtil;
class ossimPointCloudTool;
class OSSIMDLLEXPORT ossimPointCloudUtilityFilter : public ossimImageSourceFilter
{
public:
ossimPointCloudUtilityFilter( ossimPointCloudUtil* pc_util);
ossimPointCloudUtilityFilter( ossimPointCloudTool* pc_util);
virtual ~ossimPointCloudUtilityFilter() {}
virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel);
ossimScalarType getOutputScalarType() const { return OSSIM_FLOAT32; }
;
virtual ossim_uint32 getNumberOfOutputBands() const { return 1; }
virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
protected:
class PcrBucket
{
public:
PcrBucket() : m_bucket(0), m_numSamples(0) {}
PcrBucket(const ossim_float32* init_value, ossim_uint32 numBands);
PcrBucket(const ossim_float32& R, const ossim_float32& G, const ossim_float32& B);
PcrBucket(const ossim_float32& init_value);
~PcrBucket();
ossim_float32* m_bucket;
int m_numSamples;
};
void initTile();
void addSample(std::map<ossim_int32, PcrBucket*>& accumulator,
ossim_int32 index,
const ossimPointRecord* sample);
void normalize(std::map<ossim_int32, PcrBucket*>& accumulator);
ossim_uint32 componentToFieldCode() const;
ossimRefPtr<ossimPointCloudUtil> m_util;
ossimRefPtr<ossimPointCloudTool> m_util;
TYPE_DATA
};
......
......@@ -107,8 +107,14 @@ public:
virtual ossimDpt getRoundTripErrorImage(const ossimDpt& imagePt)const;
/** Computes the bounding rect in view space of the quad formed by the transformed image points
* of the input rect corners. */
virtual ossimDrect getImageToViewBounds(const ossimDrect& imageRect) const;
/** Computes the bounding rect in image space of the quad formed by the transformed view points
* of the input rect corners. */
virtual ossimDrect getViewToImageBounds(const ossimDrect& viewRect) const;
virtual bool loadState(const ossimKeywordlist& kwl,
const char* prefix =0);
......
......@@ -8,6 +8,7 @@
#define ossimRpcSolver_HEADER
#include <vector>
#include <ossim/base/ossimConstants.h>
#include <ossim/base/ossimRefPtr.h>
#include <ossim/base/ossimDpt.h>
#include <ossim/base/ossimGpt.h>
......@@ -16,10 +17,8 @@
#include <ossim/matrix/newmat.h>
#include <ossim/projection/ossimRpcModel.h>
#include <ossim/projection/ossimRpcProjection.h>
class ossimProjection;
class ossimImageGeometry;
class ossimNitfRegisteredTag;
#include <ossim/support_data/ossimNitfRegisteredTag.h>
#include <ossim/imaging/ossimImageGeometry.h>
/**
* This currently only support Rational poilynomial B format. This can be
......@@ -84,6 +83,7 @@ public:
ossimRpcSolver(bool useElevation=false,
bool useHeightAboveMSLFlag=false);
virtual ~ossimRpcSolver(){}
/**
* This will convert any projector to an RPC model
......@@ -113,6 +113,13 @@ public:
ossimImageGeometry* geom,
const double& pixel_tolerance=0.5);
/**
* Performs iterative solve using the other solve method, but uses an image filename to
* initialize, and computes RPC over entire image rect.
*/
bool solve(const ossimFilename& imageFilename,
const double& pixel_tolerance=0.5);
/**
* takes associated image points and ground points
* and solves the coefficents for the rational polynomial for
......@@ -146,8 +153,6 @@ public:
void setValidImageRect(const ossimIrect& imageRect);
protected:
virtual ~ossimRpcSolver(){}
virtual void solveInitialCoefficients(NEWMAT::ColumnVector& coeff,
const std::vector<double>& f,
const std::vector<double>& x,
......@@ -190,7 +195,6 @@ protected:
ossimRefPtr<ossimImageGeometry> theRefGeom;
ossimRefPtr<ossimRpcModel> theRpcModel;
};
#endif
......@@ -253,7 +253,7 @@ public:
*/
virtual ossimSensorModel::CovMatStatus getObsCovMat(
const ossimDpt& ipos, NEWMAT::SymmetricMatrix& Cov,
const ossim_float64 defPointingSigma = 0.5);
const ossim_float64 defPointingSigma = 0.5) const;
/**
* @brief Implementation of pure virtual
......