Skip to content
Commits on Source (4)
......@@ -103,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 )
......
......@@ -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." )
......@@ -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.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.
......
//**************************************************************************************************
//
// 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); }
void setValue(const Json::Value& json_node);
void setValue(void* value);
void resetValue();
/** Outputs JSON to output stream provided */
friend std::ostream& operator<<(std::ostream& out, const JsonParam& obj);
private:
ossimString _name;
ossimString _label;
ossimString _descr;
ParamType _type;
void* _value;
};
}
......@@ -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
......
......@@ -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
......
......@@ -143,7 +143,7 @@ public:
void getRpcPqeInputs(ossimRpcPqeInputs& obj) const;
private:
std::vector<ossimSensorModel*> theImages;
mutable std::vector<ossimRefPtr<ossimSensorModel> > theImages;
ossim_int32 theNumImages;
......
//**************************************************************************************************
//
// OSSIM Open Source Geospatial Data Processing Library
// See top level LICENSE.txt file for license information
//
//**************************************************************************************************
#ifndef GroundControlPoint_HEADER
#define GroundControlPoint_HEADER 1
#include <ossim/base/JsonInterface.h>
#include <ossim/base/ossimEcefPoint.h>
#include <ossim/matrix/newmat.h>
#include <memory>
namespace ossim
{
/**
* Class for representing a ground control point.
* TODO: mplement cross-correlation between GCPs
*/
class GroundControlPoint : public ossim::JsonInterface,
public std::enable_shared_from_this<GroundControlPoint>
{
public:
/**
* Creates new GCP from JSON object.
* The ground point (GCP) coordinates are specified in either ECF or geographic.
* The associated covariance must be in the same coordinate system. If correlations exist to
* other GCPs, those GCPs must share the same coordinate system. TBD: Perhaps the GCP
* information, including coordinates, covariances and cross-covariances can be ingested prior
* and accessed from the database with only GCP ID. Id so, the remainder of this message is not
* needed.
*
* The JSON Format:
* {
* "id": <string>,
* "ecf": [ <X>, <Y>, <Z> ], OR
* "geo": [ <lat>, <lon>, <hgt_msl> ],
* "covariance": [ c11, c22, c33, c12, c13, c23 ],
* "crossCovariances": [ (Can be excluded if no correlation information available)
* {
* "id": <string>, The other GCP’s ID
* "crossCovariance": [ c11, c22, c33, c12, c13, c23 ]
* }
* ]
* }
*
*/
GroundControlPoint(const Json::Value& image_json_node);
virtual ~GroundControlPoint();
const std::string& getId() const { return m_id; }
const ossimEcefPoint& getECF() const { return m_gcp; }
const NEWMAT::SymmetricMatrix& getCovariance() const {return m_covariance;}
/*
* Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
* for JSON format used.
*/
virtual void loadJSON(const Json::Value& json);
/*
* Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
* for JSON format used.
*/
virtual void saveJSON(Json::Value& json) const;
private:
GroundControlPoint();
std::string m_id;
ossimEcefPoint m_gcp;
NEWMAT::SymmetricMatrix m_covariance; //> X, Y, Z (ECF)
};
typedef std::vector< std::shared_ptr<GroundControlPoint> > GcpList;
} // end namespace ossimMsp
#endif /* #ifndef GroundControlPoint_HEADER */
//**************************************************************************************************
//
// OSSIM Open Source Geospatial Data Processing Library
// See top level LICENSE.txt file for license information
//
//**************************************************************************************************
#ifndef Image_HEADER
#define Image_HEADER 1
#include <map>
#include <memory>
#include <string>
#include <ossim/base/ossimGpt.h>
#include <ossim/base/ossimConstants.h>
#include <ossim/base/ossimFilename.h>
#include <ossim/matrix/newmat.h>
#include <ossim/base/JsonInterface.h>
#include <ossim/projection/ossimSensorModel.h>
#include <string>
namespace ossim
{
/**
* Class representing an Image as used by ossim-msp services.
*/
class OSSIM_DLL Image : public ossim::JsonInterface,
public std::enable_shared_from_this<Image>
{
public:
static unsigned int UNASSIGNED_PHOTOBLOCK_INDEX;
Image(const std::string& imageId,
const std::string& filename,
const std::string& modelName="",
unsigned int entryIndex=0,
unsigned int band=1);
Image(const Json::Value& image_json_node);
~Image();
std::string getImageId() const { return m_imageId; }
std::string getFilename() const { return m_filename; }
std::string getModelName() const { return m_modelName; }
unsigned int getEntryIndex() const { return m_entryIndex; }
unsigned int getActiveBand() const { return m_activeBand; }
void setImageId(const std::string& id) { m_imageId = id; }
void setFilename(const std::string& f) { m_filename = f; }
void setEntryIndex(unsigned int i) { m_entryIndex = i; }
/**
* Returns all available sensor model plugins and model names for this image:
* @param availableModels List of <plugin-name, model-name> pairs.
*/
virtual void getAvailableModels(std::vector< pair<std::string, std::string> >& availableModels) const;
/**
* Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
* for JSON format used.
*/
virtual void loadJSON(const Json::Value& json);
/**
* Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
* for JSON format used.
*/
virtual void saveJSON(Json::Value& json) const;
protected:
std::string m_imageId;
ossimFilename m_filename;
unsigned int m_entryIndex;
unsigned int m_activeBand;
std::string m_modelName;
std::vector< pair<std::string, std::string> > m_availableModel;
ossimRefPtr<ossimSensorModel> m_sensorModel;
};
typedef std::vector< std::shared_ptr<Image> > ImageList;
} // End namespace ATP
#endif
//**************************************************************************************************
//
// OSSIM Open Source Geospatial Data Processing Library
// See top level LICENSE.txt file for license information
//
//**************************************************************************************************
#ifndef PhotoBlock_HEADER
#define PhotoBlock_HEADER 1
#include <string>
#include <vector>
#include <memory>
#include <ossim/base/ossimConstants.h>
#include <ossim/reg/GroundControlPoint.h>
#include <ossim/reg/Image.h>
#include <ossim/reg/TiePoint.h>
#include <ossim/base/JsonInterface.h>
namespace ossim
{
/**
* Class for representing MSP PhotoBlock.
*/
class PhotoBlock : public JsonInterface,
public std::enable_shared_from_this<PhotoBlock>
{
public:
/**
* Initialize the photoblock from a prior saved session. If none found, assumes a new, blank
* session is being started.
*/
PhotoBlock();
PhotoBlock(const Json::Value& pb_json_node);
PhotoBlock(const PhotoBlock& copyThis);
~PhotoBlock();
PhotoBlock& operator=(const PhotoBlock& copythis);
std::shared_ptr<Image> getImage(const std::string& imageId);
std::shared_ptr<TiePoint> getTiePoint(unsigned int tpId);
std::shared_ptr<GroundControlPoint> getGroundPoint(const std::string& gpId);
ImageList& getImageList() { return m_imageList; }
TiePointList& getTiePointList() { return m_tiePointList; }
std::vector<std::shared_ptr<GroundControlPoint> >& getGroundPointList() { return m_gcpList; }
// TODO: Add of individual components not valid until proper management of the JCM can be
// provided
/**
* Adds the image to the photoblock at last position. Sets the image's pb index member.
* @param images To be added to PB
* @return The PB index of the image in the photoblock.
*/
unsigned int addImage(std::shared_ptr<Image> image);
/**
* Adds the image to the photoblock at last position. Sets the image's pb index member.
* @param images To be added to PB
* @return The PB index of the image in the photoblock.
*/
unsigned int addGroundPoint(std::shared_ptr<GroundControlPoint> groundPoint);
/**
* Adds the tiepoint to the PB
* @param tiepoint To be added to PB
* @return The index of the TP in the photoblock (should be same as TP ID)
*/
unsigned int addTiePoint(std::shared_ptr<TiePoint> tiepoint);
/**
* Adds the list of tiepoints to the PB
* @param tiepointList To be added to PB
*/
void addTiePoints(TiePointList& tiepointList);
/*
* Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
* for JSON format used.
*/
virtual void loadJSON(const Json::Value& json);
/*
* Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
* for JSON format used.
*/
virtual void saveJSON(Json::Value& json) const;
protected:
std::vector<std::shared_ptr<Image> > m_imageList;
std::vector<std::shared_ptr<TiePoint> > m_tiePointList;
std::vector<std::shared_ptr<GroundControlPoint> > m_gcpList;
};
} // End namespace ISA
#endif
//**************************************************************************************************
//
// OSSIM Open Source Geospatial Data Processing Library
// See top level LICENSE.txt file for license information
//
//**************************************************************************************************
#ifndef TiePoint_HEADER
#define TiePoint_HEADER 1
#include <ossim/base/JsonInterface.h>
#include <ossim/reg/Image.h>
#include <ossim/base/ossimDpt.h>
#include <ossim/imaging/ossimImageHandler.h>
#include <ossim/matrix/newmat.h>
#include <vector>
#include <memory>
namespace ossim
{
class TiePoint;
typedef std::vector< std::shared_ptr<TiePoint> > TiePointList;
/**
* Class for representing a single tiepoint on two or more images. It also represents image-points
* associated with a ground control point.
*/
class TiePoint : public ossim::JsonInterface,
public std::enable_shared_from_this<TiePoint>
{
public:
enum Type {
UNASSIGNED,
MANUAL, //> The point was created or edited manually and contains at least a pair of image points
AUTO, //> Result of auto tie point generation and contains at least a pair of image points
GCP //> point is associated with a manually-entered ground control. Possibly multiple image points
};
TiePoint();
TiePoint(const TiePoint& copy);
/**
* Creates new tiepoint from JSON object formatted as:
* {
* "id": <unsigned int>, // may be ignored if not valid
* "type": "M"|"A"|"G" For “manual”, “auto”, or “GCP-associated”
* "imagePoints: [
* {
* "imageId": <string>,
* "x": <double>,
* "y": <double>,
* "covariance": [ cxx, cyy, cxy ],
* "gcpId": <string> Only if associated with a GCP
* }
* ]
* }
*/
TiePoint(const Json::Value& tp_json_node);
virtual ~TiePoint();
unsigned int getImageCount() const { return m_images.size(); }
const std::string& getTiePointId() const { return m_tiePointId; }
void setTiePointId(const std::string& id);
/**
* Fetches the image point coordinates along with image ID and GCP ID if available.
* @param index Inout index into the list of images containing this tiepoint
* @param imageId Output image ID for the ccorresponding image point
* @param imagePoint image coordinates
* @param cov image point measurement covariance in (x, y) coordinates
*/
void getImagePoint(unsigned int index,
std::string& imageId,
ossimDpt& imagePoint,
NEWMAT::SymmetricMatrix& cov) const;
/**
* Sets image point value and associated measurement covariance for specified image ID.
* If the image ID is not found, it will be added as new observation.
*/
void setImagePoint(std::shared_ptr<Image> image,
const ossimDpt& imagePoint,
const NEWMAT::SymmetricMatrix& cov);
Type getType() const { return m_type; }
void setType(Type t) { m_type = t; }
const std::string& getGcpId() const { return m_gcpId; }
void setGcpId(const std::string& id);
/*
* Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
* for JSON format used.
*/
virtual void loadJSON(const Json::Value& json);
/*
* Refer to <a href="https://docs.google.com/document/d/1DXekmYm7wyo-uveM7mEu80Q7hQv40fYbtwZq-g0uKBs/edit?usp=sharing">3DISA API document</a>
* for JSON format used.
*/
virtual void saveJSON(Json::Value& json) const;
virtual std::ostream& print(std::ostream& out) const;
friend std::ostream& operator << (std::ostream& out, const TiePoint& tp)
{ return tp.print(out); }
protected:
Type m_type;
std::string m_tiePointId;
std::vector< std::shared_ptr<Image> > m_images; //> List of images containing common feature
std::vector<ossimDpt> m_imagePoints; //> List of image point measurements for common feature
std::vector<NEWMAT::SymmetricMatrix> m_covariances; //> List of measurement covariances corresponding to image points vector
double m_gsd; //> image scale (meters/pixel) at which matching was performed
std::string m_gcpId; //> Cross reference to GCP record associated with this TP.
static int s_runningId;
};
typedef std::vector< std::shared_ptr<TiePoint> > TiePointList;
} // end namespace ATP
#endif /* #ifndef TiePoint_HEADER */
......@@ -12,13 +12,15 @@
#include <ossim/base/ossimObject.h>
#include <ossim/base/ossimArgumentParser.h>
#include <ossim/base/ossimKeywordlist.h>
#include <ossim/base/JsonInterface.h>
#include <iostream>
/*!
* Base class for all OSSIM tool applications. These are utilities providing high-level
* functionality via the OSSIM library.
*/
class OSSIM_DLL ossimTool : public ossimObject
class OSSIM_DLL ossimTool : public ossimObject, public ossim::JsonInterface
{
public:
ossimTool();
......@@ -43,12 +45,18 @@ public:
virtual void initialize(const ossimKeywordlist& kwl);
/**
* Reads processing params from string provided (usually JSON-formatted, though that's up to the
* derived class to implement and contract with consumer). If all good, the object is ready for
* Reads processing params from JSON object provided. If all good, the object is ready for
* subsequent call to execute().
* @note Throws ossimException on error.
*/
virtual void initialize(const std::string& request);
virtual void loadJSON(const Json::Value& json_request) {};
/**
* Fetch product as JSON object when applicable
* Always returns true since using exception on error.
* @param json Returns non-empty object if valid response available.
*/
virtual void saveJSON(Json::Value& json) const { json.clear(); }
/**
* Writes product to output file if applicable. The product may also beAlways returns true since using exception on error.
......
......@@ -7,7 +7,7 @@
# This script will create a tarball, e.g. ossim-1.9.0.tar.gz
# from a the top level set of ossim git modules, i.e. ossim_labs_dev_root.
#---
pushd `dirname $0` >/dev/null
pushd `dirname ${BASH_SOURCE[0]}` >/dev/null
export SCRIPT_DIR=$PWD
popd >/dev/null
pushd $SCRIPT_DIR/../.. > /dev/null
......
......@@ -23,13 +23,8 @@
# Uncomment following line to debug script line by line:
#set -x; trap read debug
# Working directory must be top-level dir:
#SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
#pushd $SCRIPT_DIR/../..
#OSSIM_DEV_HOME=$PWD
#CMAKE_CONFIG_SCRIPT=$OSSIM_DEV_HOME/ossim/cmake/scripts/ossim-cmake-config.sh
pushd `dirname $0` >/dev/null
pushd `dirname ${BASH_SOURCE[0]}` >/dev/null
export SCRIPT_DIR=`pwd -P`
popd >/dev/null
# source variables used during the builds
......
#!/bin/bash
pushd `dirname $0` >/dev/null
pushd `dirname ${BASH_SOURCE[0]}` >/dev/null
export SCRIPT_DIR=`pwd -P`
popd >/dev/null
......