Skip to content
Commits on Source (6)
FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
OSSIM_SETUP_APPLICATION(ossim-header-crawl INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
//*******************************************************************
// Copyright (C) 2000 ImageLinks Inc.
//
// License: See top level LICENSE.txt file.
//
// Author: Ken Melero
// Originally written by Oscar Kramer.
//
// Description: This app displays a binary file in a nice
// formatted view. Very helpful for finding offsets of
// binary headers.
//
//********************************************************************
#include <iostream>
#include <vector>
#include <map>
#include <fstream>
#include <ossim/base/ossimString.h>
#include <ossim/base/ossimFilename.h>
#include <memory>
#include <sstream>
using namespace std;
// first: header file name only, second: header file's "namespace" or full path if relative
typedef map<ossimFilename, ossimFilename> HeaderMap;
typedef vector<ossimFilename> FileList;
class CppHeaderCrawler
{
public:
CppHeaderCrawler();
// Mines the CMake output files for include paths and home directory
bool loadBuild(const ossimFilename &buildDir);
// Opens each source and header to determine external header dependencies
bool scanForHeaders();
// Copies all external headers to the sandbox output directory, preserving the relative namespace
bool copyHeaders(const ossimFilename &outDir);
private:
// Scans specified file for include files to record:
bool scanFile(const ossimFilename &file);
// Finds the path needed to prepend to the includeSpec to locate the existing include file.
// Returns empty string if not found:
ossimFilename findPath(const ossimFilename &includeSpec);
ossimFilename m_ossimDevHome; // = $OSSIM_DEV_HOME as specified in CMakeCache.txt
FileList m_includeDirs; // List of all include paths searched in build
FileList m_sourceNames; // List of all OSSIM source and header files accessed in build
HeaderMap m_includePathMap; // Contains existing include path for every header file
};
void usage(char* appname)
{
cout<<"\nUsage: " << appname << " <path/to/OSSIM_BUILD_DIR> <path-to-output-dir>\n" << endl;
cout<<" Utility app to copy all external header files on a system that are referenced by the \n"
<<" OSSIM build. The headers are copied into a \"sandbox\" directory (usually appended with \n"
<<" \"include\"), preserving namespaces. This is to enable sandbox builds. See the script in\n"
<<" ossim/scripts/ocpld.sh for copying the external libraries needed.\n"<<endl;
return;
}
int main(int argc, char** argv)
{
if (argc < 3)
{
usage(argv[0]);
return 1;
}
ossimFilename buildPath = argv[1];
ossimFilename destDir = argv[2];
CppHeaderCrawler crawler;
if (!crawler.loadBuild(buildPath))
return -1;
if (!crawler.scanForHeaders())
return -1;
if (!crawler.copyHeaders(destDir))
return -1;
return 0;
}
CppHeaderCrawler::CppHeaderCrawler()
{
}
bool CppHeaderCrawler::loadBuild(const ossimFilename &build_dir)
{
static const string OSSIM_DEV_HOME_STR = "OSSIM_DEV_HOME:";
ossimString line;
// Check environment for OSSIM_DEV_HOME:
const char* envVar = getenv("OSSIM_DEV_HOME");
if (envVar)
{
m_ossimDevHome = envVar;
}
else
{
// Checkout the CMakeCache.txt to mine it for OSSIM_DEV_HOME:
ossimFilename cmakeCacheFile = build_dir + "/CMakeCache.txt";
ifstream f(cmakeCacheFile.string());
if (f.fail())
{
cout << "Failed file open for CMake file: " << cmakeCacheFile << endl;
return false;
}
// Loop to read read one line at a time to find OSSIM_DEV_HOME:
while (getline(f, line))
{
if (!line.contains(OSSIM_DEV_HOME_STR))
continue;
m_ossimDevHome = line.after("=");
break;
}
f.close();
}
if (m_ossimDevHome.empty())
{
cout << "Could not determine OSSIM_DEV_HOME. This should not happen!" << endl;
return false;
}
// Now read the cmake-generated list files. First the include directories:
ossimFilename cmakeIncludeDirs (build_dir.dirCat("CMakeIncludeDirs.txt"));
ifstream f(cmakeIncludeDirs.string());
if (f.fail())
{
cout << "Failed file open for CMake file: " << cmakeIncludeDirs << endl;
return false;
}
while (getline(f, line))
{
if (!line.contains(m_ossimDevHome))
{
cout << "Adding include path <" << line << ">" << endl;
m_includeDirs.emplace_back(line);
}
}
f.close();
// Read list of sources and headers included in the build:
ossimFilename cmakeFilenames (build_dir.dirCat("CMakeFileNames.txt"));
f.open(cmakeFilenames.string());
if (f.fail())
{
cout << "Failed file open for CMake file: " << cmakeFilenames << endl;
return false;
}
while (getline(f, line))
{
cout << "Adding source/header file <" << line << ">" << endl;
m_sourceNames.emplace_back(line);
}
f.close();
return true;
}
bool CppHeaderCrawler::scanForHeaders()
{
// First find all files that match pattern:
for (auto &sourceName : m_sourceNames)
{
scanFile(sourceName);
}
return true;
}
bool CppHeaderCrawler::scanFile(const ossimFilename& sourceName)
{
static const ossimString INCLUDE_STRING = "#include ";
static const size_t SIZE_INCLUDE_STRING = INCLUDE_STRING.length();
// The file may be an absolute path or may need to be searched among include paths:
// Open one file:
ifstream f(sourceName.string());
if (f.fail())
{
cout << "Failed file open for: " << sourceName << endl;
return false;
}
cout << "Scanning file: " << sourceName << endl;
bool foundInclude = false;
int noIncludeCount = 0;
ossimString lineOfCode;
// Loop to read read one line at a time to check for includes:
while (getline(f, lineOfCode) && (noIncludeCount < 10))
{
ossimString substring(lineOfCode.substr(0, SIZE_INCLUDE_STRING));
if (substring != INCLUDE_STRING)
{
if (foundInclude)
noIncludeCount++;
continue;
}
foundInclude = true;
noIncludeCount = 0;
// Get the include file path/name. Determine if relative or "namespaced". Truly relative
// include spec need not be copied to destination directory since the shall be present with
// the source build anyway.
ossimString includeSpec = lineOfCode.after(INCLUDE_STRING);
includeSpec.trim();
if (includeSpec.empty())
continue;
if (includeSpec[0] == '"')
{
// Relative. Some people are sloppy and use quoted header file spec even when it is really
// namespaced, so need to search relative first:
includeSpec = includeSpec.after("\"").before("\""); // stop before second quote (in case comments follow)
ossimFilename pathFile = sourceName.path().dirCat(includeSpec);
if (pathFile.exists())
continue;
}
else
{
includeSpec = includeSpec.after("<").before(">"); // stop before second quote (in case comments follow)
}
// Search the namespaced include spec list if already entered:
auto entry = m_includePathMap.find(includeSpec);
if (entry != m_includePathMap.end())
continue;
// Exclude copying headers that are in the source tree (not external):
auto sourcePath = m_sourceNames.begin();
for (; sourcePath != m_sourceNames.end(); ++sourcePath)
{
if (sourcePath->contains(includeSpec))
break;
}
if (sourcePath!=m_sourceNames.end())
continue;
// First time this external header has been encountered, Find it on the system and save the
// associated include path and namespace portion:
ossimFilename path = findPath(includeSpec);
if (!path.empty())
{
cout << "Inserting " << includeSpec << endl;
m_includePathMap.emplace(includeSpec, path);
}
// Now recursion into the rabbit hole of header dependencies:
ossimFilename fullPathFile = path.dirCat(includeSpec);
if (fullPathFile.ext().empty())
continue; // System include should be on target already
scanFile(fullPathFile);
}
f.close();
return true;
}
bool CppHeaderCrawler::copyHeaders(const ossimFilename& outputDir)
{
ossimFilename path, existingLocation, newLocation;
for (auto &header : m_includePathMap)
{
// Check existence of header on system:
existingLocation = header.second.dirCat(header.first);
if (!existingLocation.isFile())
{
cout << "ERROR: Could not find <" << existingLocation << ">. Header was not copied." << endl;
continue;
}
// Copy the file to the output directory:
newLocation = outputDir.dirCat(header.first);
ossimFilename newDir (newLocation.path());
ossimFilename newFile(newLocation.file());
if (!newDir.createDirectory())
{
cout << "ERROR: Could not create directory <" << newDir << ">. Check permissions." << endl;
return false;
}
existingLocation.copyFileTo(newLocation);
cout << "Copied <" << header.first << ">"<< endl;
}
return true;
}
ossimFilename CppHeaderCrawler::findPath(const ossimFilename &file)
{
ossimFilename fullPath, result;
for (auto &path: m_includeDirs)
{
fullPath = path.dirCat(file);
if (fullPath.exists())
{
result = path;
break;
}
}
return result;
}
......@@ -35,6 +35,9 @@ INCLUDE(OssimVersion)
INCLUDE(OssimUtilities)
INCLUDE(OssimCommonVariables)
FILE(REMOVE ${CMAKE_INCLUDE_DIRS_FILE})
FILE(REMOVE ${CMAKE_FILENAMES_FILE})
IF(NOT APPLE)
cmake_minimum_required(VERSION 2.6)
ELSE(NOT APPLE)
......
......@@ -218,7 +218,6 @@ MACRO(OSSIM_ADD_COMMON_SETTINGS)
SET(INSTALL_FRAMEWORK_DIR "Frameworks")
SET(INSTALL_RUNTIME_DIR "bin")
SET(INSTALL_INCLUDE_DIR "include")
set(INSTALL_LIBRARY_DIR lib${LIBSUFFIX} CACHE PATH "Installation directory for libraries")
set(INSTALL_ARCHIVE_DIR lib${LIBSUFFIX} CACHE PATH "Installation directory for archive")
mark_as_advanced(LIBSUFFIX)
......@@ -280,6 +279,8 @@ MACRO(OSSIM_ADD_COMMON_SETTINGS)
OPTION(BUILD_OMS "Set to ON to build the oms api library." ON)
OPTION(BUILD_OSSIM_WMS "Set to ON to build the wms api library." ON)
SET(CMAKE_INCLUDE_DIRS_FILE "${CMAKE_BINARY_DIR}/CMakeIncludeDirs.txt")
SET(CMAKE_FILENAMES_FILE "${CMAKE_BINARY_DIR}/CMakeFileNames.txt")
ENDMACRO(OSSIM_ADD_COMMON_SETTINGS)
......
......@@ -200,6 +200,9 @@ MACRO(OSSIM_SETUP_APPLICATION)
SETUP_LINK_LIBRARIES()
OSSIM_SAVE_INCLUDE_DIRECTORIES()
OSSIM_SAVE_FILENAMES()
IF(APPLICATION_INSTALL)
IF(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} BUNDLE DESTINATION ${INSTALL_RUNTIME_DIR} COMPONENT ${APPLICATION_COMPONENT_NAME})
......@@ -211,6 +214,7 @@ MACRO(OSSIM_SETUP_APPLICATION)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${BUILD_RUNTIME_DIR}")
ENDMACRO(OSSIM_SETUP_APPLICATION)
#####################################################################################################
......@@ -337,6 +341,10 @@ MACRO(OSSIM_LINK_LIBRARY)
ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR} COMPONENT ${LINK_COMPONENT_NAME}-dev)
ENDIF(LINK_INSTALL_HEADERS)
ENDIF(LINK_INSTALL_LIB)
OSSIM_SAVE_INCLUDE_DIRECTORIES()
OSSIM_SAVE_FILENAMES()
ENDMACRO(OSSIM_LINK_LIBRARY)
MACRO(OSSIM_ADD_COMMON_MAKE_UNINSTALL)
......@@ -358,3 +366,33 @@ MACRO(OSSIM_ADD_COMMON_MAKE_UNINSTALL)
ENDIF(EXISTS ${OSSIM_CMAKE_UNINSTALL_CONFIG})
# ENDIF(NOT TEST_UNINSTALL)
ENDMACRO(OSSIM_ADD_COMMON_MAKE_UNINSTALL)
####################################################################################################
# Writes all include directory paths to a central file for later parsing dependencies
####################################################################################################
MACRO(OSSIM_SAVE_INCLUDE_DIRECTORIES)
GET_DIRECTORY_PROPERTY(include_dir_list INCLUDE_DIRECTORIES)
FOREACH(item ${include_dir_list})
FILE(APPEND ${CMAKE_INCLUDE_DIRS_FILE} "${item}\n" )
ENDFOREACH()
ENDMACRO(OSSIM_SAVE_INCLUDE_DIRECTORIES)
####################################################################################################
# Caches all source file names to a central file for later parsing dependencies
####################################################################################################
MACRO(OSSIM_SAVE_FILENAMES)
#GET_DIRECTORY_PROPERTY(lib_sources LINK_SOURCES)
FOREACH(item ${LINK_SOURCE_FILES})
FILE(APPEND ${CMAKE_FILENAMES_FILE} "${item}\n" )
ENDFOREACH()
#GET_DIRECTORY_PROPERTY(app_sources APPLICATION_SOURCES)
FOREACH(item ${APPLICATION_SOURCE_FILES})
FILE(APPEND ${CMAKE_FILENAMES_FILE} "${CMAKE_CURRENT_SOURCE_DIR}/${item}\n" )
ENDFOREACH()
FOREACH(item ${LINK_HEADERS})
FILE(APPEND ${CMAKE_FILENAMES_FILE} "${item}\n" )
ENDFOREACH()
ENDMACRO(OSSIM_SAVE_FILENAMES)
ossim (2.3.1-2) UNRELEASED; urgency=medium
ossim (2.3.2-1) unstable; urgency=medium
* Team upload.
* New upstream release.
* Bump Standards-Version to 4.1.4, no changes.
* Refresh patches.
* Update spelling-errors.patch for new typos.
-- Bas Couwenberg <sebastic@debian.org> Wed, 18 Apr 2018 20:37:51 +0200
-- Bas Couwenberg <sebastic@debian.org> Tue, 01 May 2018 16:44:41 +0200
ossim (2.3.1-1) unstable; urgency=medium
......
......@@ -88,8 +88,8 @@ ossimImageMosaic. Default: ossimImageMosaic.
Example \fB\-\-combiner\-type\fR ossimImageMosaic
.TP
\fB\-\-contrast\fR
<constrast>
Apply constrast to input image(s). Valid range:
<contrast>
Apply contrast to input image(s). Valid range:
\fB\-1\fR.0 to 1.0
.TP
\fB\-\-cut\-bbox\-ll\fR
......
......@@ -9,6 +9,8 @@ Description: Fix spelling errors.
* prefered -> preferred
* repaced -> replaced
* explicitely -> explicitly
* constrast -> contrast
* seperated -> separated
Author: Bas Couwenberg <sebastic@debian.org>
--- a/src/base/ossimDatumFactory.inc
......@@ -99,7 +101,7 @@ Author: Bas Couwenberg <sebastic@debian.org>
return outStr;
--- a/src/util/ossimChipperUtil.cpp
+++ b/src/util/ossimChipperUtil.cpp
@@ -207,7 +207,7 @@ void ossimChipperUtil::addArguments(ossi
@@ -208,11 +208,11 @@ void ossimChipperUtil::addArguments(ossi
au->addCommandLineOption("--central-meridian","<central_meridian_in_decimal_degrees>\nNote if set this will be used for the central meridian of the projection. This can be used to lock the utm zone.");
......@@ -108,6 +110,38 @@ Author: Bas Couwenberg <sebastic@debian.org>
au->addCommandLineOption("--color-table","<color-table.kwl>\nhillshade or color-relief option - Keyword list containing color table for color-relief option.");
- au->addCommandLineOption( "--contrast", "<constrast>\nApply constrast to input image(s). Valid range: -1.0 to 1.0" );
+ au->addCommandLineOption( "--contrast", "<contrast>\nApply contrast to input image(s). Valid range: -1.0 to 1.0" );
au->addCommandLineOption("--cut-bbox-xywh", "<x>,<y>,<width>,<height>\nSpecify a comma separated bounding box.");
@@ -245,7 +245,7 @@ void ossimChipperUtil::addArguments(ossi
au->addCommandLineOption("--exaggeration", "<factor>\nMultiplier for elevation values when computing surface normals. Has the effect of lengthening shadows for oblique lighting.\nRange: .0001 to 50000, Default = 1.0");
- au->addCommandLineOption("--fullres-xys", "<full res center x>,<full res center y>,<scale>[,<scale>]\nSpecify a full resolution x,y point (Used as pivot and center cut) and scale, comma seperated with no spaces. If two scales are specified then first is x and second is y else x and y are set to equal scales");
+ au->addCommandLineOption("--fullres-xys", "<full res center x>,<full res center y>,<scale>[,<scale>]\nSpecify a full resolution x,y point (Used as pivot and center cut) and scale, comma separated with no spaces. If two scales are specified then first is x and second is y else x and y are set to equal scales");
au->addCommandLineOption("-h or --help", "Display this help and exit.");
@@ -1881,7 +1881,7 @@ ossimRefPtr<ossimSingleImageChain> ossim
setupChainHistogram( ic );
}
- // Brightness constrast setup:
+ // Brightness contrast setup:
if ( hasBrightnesContrastOperation() )
{
// Assumption bright contrast filter in chain:
@@ -2066,7 +2066,7 @@ ossimRefPtr<ossimSingleImageChain> ossim
setupChainHistogram( ic , std::make_shared<ossimSrcRecord>(rec));
}
- // Brightness constrast setup:
+ // Brightness contrast setup:
if ( hasBrightnesContrastOperation() )
{
// Assumption bright contrast filter in chain:
--- a/src/util/ossimHillshadeTool.cpp
+++ b/src/util/ossimHillshadeTool.cpp
@@ -233,7 +233,7 @@ void ossimHillshadeTool::setUsage(ossimA
......@@ -174,3 +208,27 @@ Author: Bas Couwenberg <sebastic@debian.org>
ossimGpt origin;
if (!getProjectionOrigin(origin))
origin = m_aoiGroundRect.midPoint();
--- a/include/ossim/imaging/ossimSingleImageChain.h
+++ b/include/ossim/imaging/ossimSingleImageChain.h
@@ -473,7 +473,7 @@ public:
void setBrightnessContrastFlag(bool flag);
/**
- * @brief Get the brightness constrast flag.
+ * @brief Get the brightness contrast flag.
* @return true or false.
*/
bool getBrightnessContrastFlag() const;
--- a/share/ossim/templates/ossim_preferences_template
+++ b/share/ossim/templates/ossim_preferences_template
@@ -687,8 +687,8 @@ tfrd_iamp_file: $(OSSIM_INSTALL_PREFIX)/
// allows on to specify configuration options and parsing for the hdf5 plugin
// In this example we have only the Radiance file supported for VIIRS data
// to get a listing of dataset use the ossim-info -d on any hdf5 dataset file
-// and look at the top for the dataset comma seperated list of dataset paths.
-// You can add a comma seperated list for renderable_datasets and only those will show
+// and look at the top for the dataset comma separated list of dataset paths.
+// You can add a comma separated list for renderable_datasets and only those will show
// up in an ossim-info
//
hdf5.options.max_recursion_level: 8
//----------------------------------------------------------------------------
//---
//
// License: MIT
//
// See LICENSE.txt file in the top level directory for more details.
//
// Author: David Burken
//
// Description: OSSIM nitf writer base class to hold methods common to
// all nitf writers.
//
//----------------------------------------------------------------------------
// $Id: ossimNitfWriterBase.h 2981 2011-10-10 21:14:02Z david.burken $
//---
// $Id$
#ifndef ossimNitfWriterBase_HEADER
#define ossimNitfWriterBase_HEADER
#define ossimNitfWriterBase_HEADER 1
#include <ossim/imaging/ossimImageFileWriter.h>
#include <ossim/support_data/ossimNitfRegisteredTag.h>
......@@ -147,6 +145,19 @@ protected:
void addBlockaTag(ossimMapProjectionInfo& mapInfo,
ossimNitfImageHeaderV2_X* hdr);
/**
* @brief Adds the GEOLOB tag.
*
* This will only be added if projection is geographic.
*
* @param mapInfo ossimMapProjectionInfo to use to set tag with.
* @param hdr The header to write to.
*
* @note Currently only used with map projected images.
*/
void addGeolobTag(const ossimMapProjection* mapProj,
ossimNitfImageHeaderV2_X* hdr);
/**
* @brief Adds the RPC00B tag.
*
......@@ -185,6 +196,11 @@ protected:
*/
bool theEnableBlockaTagFlag;
/**
* @brief If true user wants to set GEOLOG tag. (DEFAULT = true)
* This will only be set if a geographic projection.
*/
bool theEnableGeolobTagFlag;
private:
......
//----------------------------------------------------------------------------
//
// License: See top level LICENSE.txt file.
//---
// License: MIT
//
// Author: Matt Revelle
// David Burken
......@@ -8,9 +7,9 @@
// Description:
//
// Contains class declaration for ossimNitfProjectionFactory.
//
// $Id: ossimNitfProjectionFactory.h 18905 2011-02-16 13:30:11Z dburken $
//----------------------------------------------------------------------------
//---
// $Id$
#ifndef ossimNitfProjectionFactory_HEADER
#define ossimNitfProjectionFactory_HEADER 1
......@@ -236,8 +235,18 @@ private:
* @return true if BLOCKA tag was parsed.
*/
bool getBlockaPoints(const ossimNitfImageHeader* hdr,
std::vector<ossimGpt>& gpts)const;//,
//const ossimFilename& filename) const;
std::vector<ossimGpt>& gpts)const;
/**
* @param hdr The nitf image header from the currently opened nitf file.
*
* @param gpts Ground points to initialize from GEOLOB tag. This should
* be an empty vector.
*
* @return true if GEOLOB tag was parsed.
*/
bool getGeolobPoints(const ossimNitfImageHeader* hdr,
std::vector<ossimGpt>& gpts)const;
/**
* Private constructor, users must go through instance() method.
......
//---
//
// License: MIT
//
// Author: David Burken
//
// Description: GEOLOB tag class declaration.
//
// References:
//
// 1) DIGEST 2.1 Part 2 - Annex D
// Appendix 1 - NSIF Standard Geospatial Support Data Extension
//
// 2) STDI-0006
//---
// $Id$
#ifndef ossimNitfGeolobTag_HEADER
#define ossimNitfGeolobTag_HEADER 1
#include <ossim/support_data/ossimNitfRegisteredTag.h>
#include <ossim/base/ossimConstants.h>
#include <string>
class OSSIM_DLL ossimNitfGeolobTag : public ossimNitfRegisteredTag
{
public:
enum
{
ARV_SIZE = 9,
BRV_SIZE = 9,
LSO_SIZE = 15,
PSO_SIZE = 15,
TAG_SIZE = 48
// -----
// 48
};
/** default constructor */
ossimNitfGeolobTag();
/**
* Parse method.
*
* @param in Stream to parse.
*/
virtual void parseStream(ossim::istream& in);
/**
* Write method.
*
* @param out Stream to write to.
*/
virtual void writeStream(ossim::ostream& out);
/**
* @brief Print method that outputs a key/value type format
* adding prefix to keys.
* @param out Stream to output to.
* @param prefix Prefix added to key like "image0.";
*/
virtual std::ostream& print(std::ostream& out,
const std::string& prefix) const;
/**
* @brief Gets the ARV field.
*
* Longitude density:
* This field shall contain the pixel ground spacing in E/W direction that
* is the number of pixels or elements intervals in 360°
*
* Pixel size in decimal degree = 360.0 / AVR
*
* @return ARV field as a string.
*/
std::string getArvString() const;
/**
* @brief Gets the ARV field.
* @return ARV field as a positive integer.
**/
ossim_uint32 getArv() const;
/**
* @brief Gets degrees per pixel in lonitude direction from BRV field.
*
* Pixel size in decimal degree = 360.0 / AVR
*
* @return Degrees per pixel in lonitude direction.
*/
ossim_float64 getDegreesPerPixelLon() const;
/**
* @brief Sets the ARV field. Valid range: 000000002 to 999999999
* @pararm arv
*/
void setArv(ossim_uint32 arv);
/**
* @brief Sets the ARV field from decimal degrees per pixel longitude.
* @pararm deltaLon
*/
void setDegreesPerPixelLon(const ossim_float64& deltaLon);
/**
* @brief Gets the BRV field.
*
* Latitude density:
* This field shall contain the pixel ground spacing in N/S direction that
* is the number of pixels or elements intervals in 360°.
*
* Pixel size in decimal degree = 360.0 / BVR
*
* @return BRV field as a string.
*/
std::string getBrvString() const;
/**
* @brief Gets the BRV field.
* @return BRV field as a positive integer.
**/
ossim_uint32 getBrv() const;
/**
* @brief Gets degrees per pixel in latitude direction from BRV field.
*
* Pixel size in decimal degree = 360.0 / BVR
*
* @return Degrees per pixel in latitude direction.
*/
ossim_float64 getDegreesPerPixelLat() const;
/**
* @brief Sets the BRV field. Valid range: 000000002 to 999999999
* @pararm brv
*/
void setBrv(ossim_uint32 brv);
/**
* @brief Sets the BRV field from decimal degrees per pixel latitude.
* @pararm deltaLon
*/
void setDegreesPerPixelLat(const ossim_float64& deltaLat);
/**
* @brief Gets the LSO field.
*
* Longitude of Reference Origin:
* This field shall contain the longitude of the origin pixel
* (row number 0, column number 0) in the absolute coordinate system.
*
* @return LSO field as a string.
*/
std::string getLsoString() const;
/**
* @brief Gets the LSO field(Longitude Origin).
* @return LSO field as a positive integer.
**/
ossim_float64 getLso() const;
/**
* @brief Sets the LSO field(Longitude Origin).
* Valid range: -180.0 to +180.0
* @pararm lso
*/
void setLso(const ossim_float64& lso);
/**
* @brief Gets the PSO field.
*
* Latitude of Reference Origin:
* This field shall contain the latitude of the origin pixel
* (row number 0, column number 0) in the absolute coordinate system.
*
* @return PSO field as a string.
*/
std::string getPsoString() const;
/**
* @brief Gets the PSO field(Latitude Origin).
* @return PSO field as a positive integer.
**/
ossim_float64 getPso() const;
/**
* @brief Sets the PSO field(Latitude Origin).
* Valid range: -90.0 to +90.0
* @pararm pso
*/
void setPso(const ossim_float64& pso);
protected:
std::string m_tagData;
TYPE_DATA
};
#endif /* End of "#ifndef ossimNitfGeolobTag_HEADER" */
//*******************************************************************
// Copyright (C) 2004 Intelligence Data Systems.
//
// LICENSE: MIT
//
// see top level LICENSE.txt
//
// Author: Garrett Potts
// Description: Nitf support class
//
//********************************************************************
// $Id: ossimNitfLocalGeographicTag.h 22013 2012-12-19 17:37:20Z dburken $
#ifndef ossimNitfLocalGeographicTag_HEADER
#define ossimNitfLocalGeographicTag_HEADER
#include <ossim/support_data/ossimNitfRegisteredTag.h>
class OSSIM_DLL ossimNitfLocalGeographicTag : public ossimNitfRegisteredTag
{
public:
ossimNitfLocalGeographicTag();
virtual ~ossimNitfLocalGeographicTag();
virtual void parseStream(std::istream& in);
virtual void writeStream(std::ostream& out);
virtual void clearFields();
virtual void setDegreesPerPixelLat(double deltaLat);
virtual void setDegreesPerPixelLon(double deltaLon);
virtual void setLatOrigin(double origin);
virtual void setLonOrigin(double origin);
protected:
/**
* FIELD: ARV
*
* required 9 byte field
*
* Longitude density
*
* This field shall contain the pixel ground spacing in E/W direction that is
* the number of pixels or elements intervals in 360 degrees.
* 9 BCS-N positive integer 000000002 to 999999999.
*/
char theLonDensity[10];
/**
* FIELD: BRV
*
* required 9 byte field
*
* Latitude density
*
* This field shall contain the pixel ground spacing in N/S direction that is the number of
* pixels or elements intervals in 360 degrees. 9 BCS-N positive integer 000000002 to 999999999 R
*/
char theLatDensity[10];
/**
* FIELD: LSO
*
* required 15 byte field
*
* Longitude of Reference Origin This field shall contain the longitude of the origin pixel
* (row number 0, column number 0) in the absolute coordinate system. 15 BCS-N R
*/
char theLonOrigin[16];
/**
* FIELD: PSO
*
* required 15 byte field
*
* Latitude of Reference Origin This field shall contain the latitude of the origin
* pixel (row number 0, column number 0) in the absolute coordinate system. 15 BCS-N R
*/
char theLatOrigin[15];
TYPE_DATA
};
#endif
......@@ -646,11 +646,25 @@ private:
* Keys:
* IMAGE_SPACE_SCALE_X_KW
* IMAGE_SPACE_SCALE_Y_KW
* FULLRES_XYS
*
* Scale will be 1.0, 1.0 if keys not found.
*/
void getImageSpaceScale(ossimDpt &imageSpaceScale) const;
/**
* @brief Gets the image space pivot.
*
* This is a "chip" operation only. Will extract the center
* from the FULLRES keyword
*
* Keys:
* FULLRES_XYS
*
* This will return NaN if not set
*/
void getImageSpacePivot(ossimDpt &imageSpacePivot) const;
/**
* @brief Gets rotation.
*
......
#!/bin/bash
# OCPLD -- Ossim CoPy Library Dependencies
# Adapted from code written by Hemanth.HM
# Uncomment to step/debug
#set -x; trap read debug
pushd `dirname ${BASH_SOURCE[0]}` >/dev/null
export SCRIPT_DIR=`pwd -P`
popd >/dev/null
if [ $# -ne 2 ]
then
echo "Usage: `basename $0` <ossim_build_dir> <sandbox_dir>"
exit 1
fi
OSSIM_BUILD_DIR=$1
SANDBOX_DIR=$2
echo "Copying libraries..."
$SCRIPT_DIR/ocpld.sh $OSSIM_BUILD_DIR/lib $SANDBOX_DIR/lib
if [ $? -ne 0 ]; then
echo; echo "Error encountered during ocpld."
popd>/dev/null
exit 1
fi
echo "Copying headers..."
ossim-header-crawl $OSSIM_BUILD_DIR $SANDBOX_DIR/include
if [ $? -ne 0 ]; then
echo; echo "Error encountered during ossim-header-crawl."
popd>/dev/null
exit 1
fi
echo; echo "Sandbox of dependencies has been successfully created in $SANDBOX_DIR."; echo
\ No newline at end of file
#!/bin/bash
# OCPLD -- Ossim CoPy Library Dependencies
# Adapted from code written by Hemanth.HM
# Uncomment to step/debug
#set -x; trap read debug
function do_cpld {
echo; echo "Scanning dependencies of $1"
deps=$(ldd $1 | awk 'BEGIN{ORS=" "}$1~/^\//{print $1}$3~/^\//{print $3}' | sed 's/,$/\n/')
for dep in $deps
do
b=$(basename $dep)
if [ -e $2/$b ]; then
echo " $b already there."
else
echo " copying $dep to $2"
cp -n $dep $2
fi
done
}
export -f do_cpld
if [[ $# < 2 ]]; then
s=$(basename $0)
echo; echo "Usage: $s <path to OSSIM libraries> <destination path for dependencies>"; echo
exit 1
fi
if [ ! -d $1 ]; then
echo; echo "<$1> is not a valid input directory. Aborting..."; echo
exit 1
fi
if [ ! -d $2 ]; then
echo; echo "Output directory <$2> does not exist. Creating..."; echo
mkdir -p $2
fi
find $1 -type f -name "*.so" -exec bash -c "do_cpld {} $2" \;
echo; echo "All dependencies were copied to $2. Done!"; echo
\ No newline at end of file
......@@ -394,9 +394,22 @@ plugin55.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_geopdf_plugi
//---
// Always put gdal last as it has duplicate readers and need to pick ours up
// first.
//---
//plugin85.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_gdal_plugin.so
// plugin85.options:
//
// The enable and disable is a regular expression. a REgular expression with
// the value of ".*" will match all and a regular expression with the value of
// "NITF|HFA" will match HFA or NITF drivers.
//
// The plugin also support environment variables:
// GDAL_ENABLE_DRIVERS=
// GDAL_DISABLE_DRIVERS=
//---
plugin85.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_gdal_plugin.so
plugin85.options:"""
reader_factory.location:back
writer_factory.location:back
enable_drivers: .*
//disable_drivers:
"""
//---
// Old style with no options keyword:
......
......@@ -283,6 +283,7 @@ void ossimImageRenderer::ossimRendererSubRectInfo::splitView(std::vector<ossimRe
return;
}
// just do horizontal split for test
ossimIrect vrect(m_Vul,
m_Vur,
......@@ -294,8 +295,6 @@ void ossimImageRenderer::ossimRendererSubRectInfo::splitView(std::vector<ossimRe
ossim_int32 h2 = h>>1;
if((w2 <2)&&(h2<2))
{
if(splitFlags)
{
ossimRendererSubRectInfo rect(m_transform.get(),m_Vul,
m_Vul,
......@@ -311,18 +310,6 @@ void ossimImageRenderer::ossimRendererSubRectInfo::splitView(std::vector<ossimRe
result.push_back(rect);
}
}
// if(rect.imageIsNan())
// {
// if(rect.m_viewBounds->intersects(rect.getViewRect()))
// {
// result.push_back(rect);
// }
// }
// else
// {
// result.push_back(rect);
// }
}
}
// horizontal split if only the upper left and lower left
// vertices need splitting
......@@ -393,6 +380,7 @@ bool ossimImageRenderer::ossimRendererSubRectInfo::tooBig()const
ossim_uint16 ossimImageRenderer::ossimRendererSubRectInfo::getSplitFlags()const
{
#if 0
ossim_uint16 result = SPLIT_NONE;
ossimDrect vRect = getViewRect();
......@@ -401,7 +389,7 @@ ossim_uint16 ossimImageRenderer::ossimRendererSubRectInfo::getSplitFlags()const
// very small rectangles in canBilinearInterpolate(...) method.
// DRB 05 Dec. 2017
//---
if ( vRect.width() < 8 && vRect.height() < 8 )
if ( imageHasNans()||(vRect.width() < 8 && vRect.height() < 8) )
{
return result;
}
......@@ -484,6 +472,88 @@ ossim_uint16 ossimImageRenderer::ossimRendererSubRectInfo::getSplitFlags()const
}
return result;
#else
ossim_uint16 result = SPLIT_NONE;
ossimDrect vRect = getViewRect();
if(imageHasNans()||tooBig())
{
if(m_viewBounds->intersects(getViewRect()))
{
result = SPLIT_ALL;
}
else
{
return result;
}
}
/*
if(result != SPLIT_ALL)
{
if(m_ulRoundTripError.hasNans()&&m_urRoundTripError.hasNans()&&
m_lrRoundTripError.hasNans()&&m_llRoundTripError.hasNans())
{
if(m_viewBounds->intersects(getViewRect()))
{
result = SPLIT_ALL;
}
return result;
}
else if(tooBig())
{
result = SPLIT_ALL;
}
}
if(result != SPLIT_ALL)
{
if(m_ulRoundTripError.hasNans()) result |= UPPER_LEFT_SPLIT_FLAG;
if(m_urRoundTripError.hasNans()) result |= UPPER_RIGHT_SPLIT_FLAG;
if(m_lrRoundTripError.hasNans()) result |= LOWER_RIGHT_SPLIT_FLAG;
if(m_llRoundTripError.hasNans()) result |= LOWER_LEFT_SPLIT_FLAG;
}
*/
if(result != SPLIT_ALL)
{
ossim_float64 sensitivityScale = m_ImageToViewScale.length();
//std::cout << sensitivityScale << std::endl;
if(sensitivityScale < 1.0) sensitivityScale = 1.0/sensitivityScale;
// if((m_ulRoundTripError.length() > sensitivityScale)||
// (m_urRoundTripError.length() > sensitivityScale)||
// (m_lrRoundTripError.length() > sensitivityScale)||
// (m_llRoundTripError.length() > sensitivityScale))
// {
// std::cout << "________________\n";
// std::cout << "Sens: " << sensitivityScale << "\n"
// << "View: " << getViewRect() << "\n"
// << "UL: " << m_ulRoundTripError.length() << "\n"
// << "UR: " << m_urRoundTripError.length() << "\n"
// << "LR: " << m_lrRoundTripError.length() << "\n"
// << "LL: " << m_llRoundTripError.length() << "\n";
// }
// if(m_ulRoundTripError.length() > sensitivityScale) result |= UPPER_LEFT_SPLIT_FLAG;
// if(m_urRoundTripError.length() > sensitivityScale) result |= UPPER_RIGHT_SPLIT_FLAG;
// if(m_lrRoundTripError.length() > sensitivityScale) result |= LOWER_RIGHT_SPLIT_FLAG;
// if(m_llRoundTripError.length() > sensitivityScale) result |= LOWER_LEFT_SPLIT_FLAG;
// std::cout << result << " == " << SPLIT_ALL << "\n";
if((result!=SPLIT_ALL)&&!canBilinearInterpolate(sensitivityScale))
{
// std::cout << "TESTING BILINEAR!!!!\n";
result = SPLIT_ALL;
}
else
{
// std::cout << "CAN BILINEAR!!!!\n";
}
}
return result;
#endif
}
void ossimImageRenderer::ossimRendererSubRectInfo::transformViewToImage()
......@@ -737,7 +807,6 @@ bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate(double
// << "lrScale: " << m_VlrScale << "\n"
// << "llScale: " << m_VllScale << "\n";
// check overage power of 2 variance
// If there is a variance of 1 resolution level
// then we must split further
......@@ -753,7 +822,6 @@ bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate(double
// std::cout << log(averageLrScale)/(log(2)) << "\n";
// std::cout << log(averageLlScale)/(log(2)) << "\n";
ossim_float64 ratio1 = averageUlScale / averageUrScale;
ossim_float64 ratio2 = averageUlScale / averageLrScale;
ossim_float64 ratio3 = averageUlScale / averageLlScale;
......@@ -763,7 +831,6 @@ bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate(double
// std::cout << "ratio2: " << ratio2 << "\n";
// std::cout << "ratio3: " << ratio3 << "\n";
// make sure all are within a power of 2 shrink or expand
// which means the range of each ratio should be
// between .5 and 2
......@@ -776,7 +843,6 @@ bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate(double
//std::cout << "DIFF2: " << diff2 << std::endl;
//std::cout << "DIFF3: " << diff3 << std::endl;
if (result)
{
#if 1
......@@ -784,36 +850,19 @@ bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate(double
ossimDpt iUpper, iRight, iBottom, iLeft, iCenter;
ossimDpt testUpper, testRight, testBottom, testLeft, testCenter;
ossim2dBilinearTransform viewToImageTransform(m_Vul, m_Vur, m_Vlr, m_Vll
,m_Iul, m_Iur, m_Ilr, m_Ill);
// std::cout << "vMid: " << testMid << "\n";
// std::cout << "testMid: " << testMid << "\n";
// std::cout << "testCenter: " << testCenter << "\n";
getViewMids(vUpper, vRight, vBottom, vLeft, vCenter);
// do a bilinear transform of some test points
viewToImageTransform.forward(vUpper, iUpper);
viewToImageTransform.forward(vRight, iRight);
viewToImageTransform.forward(vBottom, iBottom);
viewToImageTransform.forward(vLeft, iLeft);
viewToImageTransform.forward(vCenter, iCenter);
// viewToImageTransform.forward(vMid, iTestMid);
//m_transform->viewToImage(vMid, testCenter);
//getImageMids(iUpper, iRight, iBottom, iLeft, iCenter);
getImageMids(iUpper, iRight, iBottom, iLeft, iCenter);
// get the model centers for the mid upper left right bottom
m_transform->viewToImage(vCenter, testCenter);
if (testCenter.hasNans())
{
return false;
}
m_transform->viewToImage(vUpper, testUpper);
if(testUpper.hasNans())
if (testCenter.hasNans())
{
return false;
}
......@@ -844,8 +893,6 @@ bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate(double
(errorCheck3 < error) &&
(errorCheck4 < error) &&
(errorCheck5 < error));
// if(!result)
// {
// std::cout <<"__________________________\n"
// << "ERROR1:" <<errorCheck1 << "\n"
// << "ERROR2:" <<errorCheck2 << "\n"
......@@ -854,9 +901,6 @@ bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate(double
// << "ERROR5:" <<errorCheck5 << "\n"
// << "SENS: " << error << "\n";
// std::cout << "Can't bilinear!!\n";
// }
#else
ossimDpt vUpper, vRight, vBottom, vLeft, vCenter;
ossimDpt iUpper, iRight, iBottom, iLeft, iCenter;
......@@ -940,7 +984,6 @@ bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate(double
#endif
}
return result;
}
void ossimImageRenderer::ossimRendererSubRectInfo::getViewMids(ossimDpt& upperMid,
......@@ -1063,7 +1106,6 @@ ossimRefPtr<ossimImageData> ossimImageRenderer::getTile(
<< MODULE << " Requesting view rect = "
<< tileRect << endl;
}
// long w = tileRect.width();
// long h = tileRect.height();
// ossimIpt origin = tileRect.ul();
......
......@@ -30,12 +30,12 @@
#include <ossim/base/ossimBooleanProperty.h>
#include <ossim/base/ossimVisitor.h>
#include <ossim/support_data/ossimNitfCommon.h>
#include <ossim/support_data/ossimNitfGeoPositioningTag.h>
#include <ossim/support_data/ossimNitfLocalGeographicTag.h>
#include <ossim/support_data/ossimNitfLocalCartographicTag.h>
#include <ossim/support_data/ossimNitfProjectionParameterTag.h>
#include <ossim/support_data/ossimNitfNameConversionTables.h>
#include <ossim/support_data/ossimNitfBlockaTag.h>
// #include <ossim/support_data/ossimNitfGeoPositioningTag.h>
// #include <ossim/support_data/ossimNitfLocalGeographicTag.h>
// #include <ossim/support_data/ossimNitfLocalCartographicTag.h>
// #include <ossim/support_data/ossimNitfProjectionParameterTag.h>
// #include <ossim/support_data/ossimNitfNameConversionTables.h>
// #include <ossim/support_data/ossimNitfBlockaTag.h>
#include <tiffio.h>
#include <fstream>
#include <algorithm>
......
......@@ -62,7 +62,9 @@ ossimNitfWriter::ossimNitfWriter(const ossimFilename& filename,
// geometry out as default behavior. Users can disable this via the
// property interface or keyword list.
//---
setWriteExternalGeometryFlag(true);
// Added GEOLOB tag for geographic output. UTM is good with BLOCKA.
// No longer needed. (drb - 30 March 2018)
// setWriteExternalGeometryFlag(true);
m_fileHeader = new ossimNitfFileHeaderV2_1;
m_imageHeader = new ossimNitfImageHeaderV2_1;
......@@ -887,10 +889,10 @@ void ossimNitfWriter::addDataExtensionSegment(const ossimNitfDataExtensionSegmen
if (allowTreOverflow == false)
{
ossimRefPtr<ossimProperty> pId = des.getProperty(ossimNitfDataExtensionSegmentV2_1::DESID_KW);
if ( !pId ||
(pId->valueToString() == "TRE_OVERFLOW") ||
(pId->valueToString() == "REGISTERED EXTENSIONS") ||
(pId->valueToString() == "CONTROLLED EXTENSIONS"))
if ( !pId.valid() ||
pId->valueToString() == "TRE_OVERFLOW" ||
pId->valueToString() == "REGISTERED EXTENSIONS" ||
pId->valueToString() == "CONTROLLED EXTENSIONS")
{
return;
}
......