[Git][debian-gis-team/ossim][master] 4 commits: New upstream version 2.4.1

Bas Couwenberg gitlab at salsa.debian.org
Fri Jun 29 06:51:39 BST 2018


Bas Couwenberg pushed to branch master at Debian GIS Project / ossim


Commits:
6fbca332 by Bas Couwenberg at 2018-06-29T07:22:44+02:00
New upstream version 2.4.1
- - - - -
57097616 by Bas Couwenberg at 2018-06-29T07:22:53+02:00
Merge tag 'upstream/2.4.1'

Upstream version 2.4.1

- - - - -
98de7a1a by Bas Couwenberg at 2018-06-29T07:23:12+02:00
New upstream release.

- - - - -
f27f6cab by Bas Couwenberg at 2018-06-29T07:24:35+02:00
Set distribution to unstable.

- - - - -


6 changed files:

- + apps/ossim-envi-cg/CMakeLists.txt
- + apps/ossim-envi-cg/ossim-envi-cg.cpp
- debian/changelog
- + include/ossim/projection/ossimEnviCgModel.h
- + sonar-project.properties
- + src/projection/ossimEnviCgModel.cpp


Changes:

=====================================
apps/ossim-envi-cg/CMakeLists.txt
=====================================
--- /dev/null
+++ b/apps/ossim-envi-cg/CMakeLists.txt
@@ -0,0 +1,2 @@
+FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
+OSSIM_SETUP_APPLICATION(ossim-envi-cg INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})


=====================================
apps/ossim-envi-cg/ossim-envi-cg.cpp
=====================================
--- /dev/null
+++ b/apps/ossim-envi-cg/ossim-envi-cg.cpp
@@ -0,0 +1,70 @@
+//---
+//
+// License: MIT
+//
+//---
+
+// System includes:
+#include <cmath>
+#include <memory>
+#include <sstream>
+#include <iostream>
+
+// ossim includes:  These are here just to save time/typing...
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimConnectableObject.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/Thread.h>
+#include <ossim/projection/ossimEnviCgModel.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+
+// Put your includes here:
+
+int main(int argc, char *argv[])
+{
+   int returnCode = 0;
+   if (argc < 2)
+   {
+      cout<<"\nUsage: "<<argv[0]<<" <filename.geoc>\n"<<endl;
+      return 1;
+   }
+   
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+
+   ossimFilename fname (argv[1]);
+
+   try
+   {
+      ossimRefPtr<ossimEnviCgModel> model = new ossimEnviCgModel;
+      if (model->loadEnviGeocFile(fname))
+      {
+         ossimFilename geomFname(fname);
+         geomFname.setExtension("geom");
+         model->saveCoarseGrid(geomFname);
+         ossimKeywordlist kwl;
+         ossimImageGeometry geom;
+         geom.setProjection(model.get());
+         geom.saveState(kwl);
+         kwl.write(geomFname);
+      }
+   }
+   catch(const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+      returnCode = 1;
+   }
+   catch( ... )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossim-foo caught unhandled exception!" << std::endl;
+      returnCode = 1;
+   }
+   
+   return returnCode;
+}


=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ossim (2.4.1-1) unstable; urgency=medium
+
+  * Team upload.
+  * New upstream release.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 29 Jun 2018 07:24:22 +0200
+
 ossim (2.4.0-1) unstable; urgency=medium
 
   * Team upload.


=====================================
include/ossim/projection/ossimEnviCgModel.h
=====================================
--- /dev/null
+++ b/include/ossim/projection/ossimEnviCgModel.h
@@ -0,0 +1,28 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+//*******************************************************************
+
+#ifndef ossimEnviCgModel_HEADER
+#define ossimEnviCgModel_HEADER
+
+#include <ossim/projection/ossimCoarseGridModel.h>
+#include <ossim/base/ossimFilename.h>
+
+class OSSIMDLLEXPORT ossimEnviCgModel : public ossimCoarseGridModel
+{
+public:
+   ossimEnviCgModel();
+   ossimEnviCgModel(const ossimFilename& geoc_file);
+
+   bool loadEnviGeocFile(const ossimFilename& geoc_file);
+   bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
+
+private:
+   double readValue(ifstream& s, bool bigEndian) const;
+
+TYPE_DATA
+};
+
+#endif


=====================================
sonar-project.properties
=====================================
--- /dev/null
+++ b/sonar-project.properties
@@ -0,0 +1,15 @@
+# must be unique in a given SonarQube instance
+sonar.projectKey=ossim
+sonar.projectVersion=1.0
+
+# source-code location folder
+sonar.sources=src
+
+# source-code language
+sonar.language=c++
+
+# Verbose output
+sonar.verbose=true
+
+# Encoding of the source code. Default is default system encoding
+sonar.sourceEncoding=UTF-8


=====================================
src/projection/ossimEnviCgModel.cpp
=====================================
--- /dev/null
+++ b/src/projection/ossimEnviCgModel.cpp
@@ -0,0 +1,149 @@
+//*****************************************************************************
+// FILE: ossimCoarseGridModel.cc
+//
+// License:  See LICENSE.txt file in the top level directory.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimCoarseGridModel. This is an
+//   implementation of an interpolation sensor model. 
+//
+//   IMPORTANT: The lat/lon grid is for ground points on the ellipsoid.
+//   The dLat/dHgt and dLon/dHgt partials therefore are used against
+//   elevations relative to the ellipsoid.
+//
+//*****************************************************************************
+//  $Id: ossimCoarseGridModel.cpp 22825 2014-07-07 23:14:52Z dburken $
+
+#include <ossim/projection/ossimEnviCgModel.h>
+
+RTTI_DEF1(ossimEnviCgModel, "ossimEnviCgModel", ossimCoarseGridModel);
+
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/support_data/ossimSupportFilesList.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+static const char* MODEL_TYPE = "ossimEnviCgModel";
+
+//*****************************************************************************
+ossimEnviCgModel::ossimEnviCgModel()
+      : ossimCoarseGridModel()
+{}
+
+//*****************************************************************************
+ossimEnviCgModel::ossimEnviCgModel(const ossimFilename& geoc_file)
+   : ossimCoarseGridModel()
+{
+   loadEnviGeocFile(geoc_file);
+}
+
+
+//*****************************************************************************
+bool ossimEnviCgModel::loadEnviGeocFile(const ossimFilename& geoc_file)
+{
+   theHeightEnabledFlag = false;
+   setErrorStatus();
+
+   ossimFilename geoc_hdr (geoc_file + ".hdr");
+
+   ifstream geocHdrStream (geoc_hdr.c_str());
+   if (geocHdrStream.fail())
+   {
+      cout << "ossimEnviCgModel:loadEnviGeocFile() Error encountered opening GEOC header file <"<<geoc_hdr<<">"<<endl;
+      return false;
+   }
+
+   char line[1024];
+   ossimIpt imageSize;
+   geocHdrStream.getline(line, 1024);
+   ossimString oline(line);
+   int bigEndian=0;
+   if (!oline.contains("ENVI"))
+   {
+      cout << "ossimEnviCgModel:loadEnviGeocFile() Error: GEOC header file <"<<geoc_hdr
+           <<"> missing \"ENVI\" magic number."<<endl;
+      return false;
+   }
+   while (!geocHdrStream.eof())
+   {
+      geocHdrStream.getline(line, 1024);
+      oline = line;
+      vector<ossimString> strSplit;
+      if (oline.contains("samples"))
+         imageSize.x = oline.after("=").trim().toInt();
+      else if (oline.contains("lines"))
+         imageSize.y = oline.after("=").trim().toInt();
+      else if (oline.contains("byte order"))
+         bigEndian = oline.after("=").trim().toInt();
+   }
+
+   ossimDpt gridOrigin(0,0);
+
+   ifstream geocStream (geoc_file.c_str(), ios_base::binary|ios_base::in);
+   if (geocStream.fail())
+   {
+      cout << "ossimEnviCgModel:Ctor Error encountered opening GEOC file <"<<geoc_file<<">"<<endl;
+      return false;
+   }
+
+   ossimDpt spacing (1,1);
+   theLatGrid.initialize(imageSize, gridOrigin, spacing);
+   theLonGrid.initialize(imageSize, gridOrigin, spacing);
+   theDlatDhGrid.initialize(imageSize, gridOrigin, spacing);
+   theDlonDhGrid.initialize(imageSize, gridOrigin, spacing);
+
+   double value;
+   for (int y=0; (y<imageSize.y) && !geocStream.eof() ; ++y)
+   {
+      for (int x=0; (x<imageSize.x) && !geocStream.eof() ; ++x)
+      {
+         value = readValue(geocStream, (bool) bigEndian);
+         theLonGrid.setNode(x, y, value);
+      }
+   }
+   for (int y=0; (y<imageSize.y) && !geocStream.eof() ; ++y)
+   {
+      for (int x=0; (x<imageSize.x) && !geocStream.eof() ; ++x)
+      {
+         value = readValue(geocStream, (bool) bigEndian);
+         theLatGrid.setNode(x, y, value);
+      }
+   }
+
+   theDlatDhGrid.fill(0.0);
+   theDlonDhGrid.fill(0.0);
+   theLatGrid.setDomainType(ossimDblGrid::SAWTOOTH_90);
+   theLonGrid.setDomainType(ossimDblGrid::WRAP_180);
+
+   ossimIrect imageBounds(0, 0, imageSize.x-1, imageSize.y-1);
+   initializeModelParams(imageBounds);
+
+   return true;
+}
+
+bool ossimEnviCgModel::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   bool status = ossimCoarseGridModel::saveState(kwl, prefix);
+   if (status)
+      kwl.add(prefix, "type", "ossimCoarseGridModel");
+   return status;
+}
+
+double ossimEnviCgModel::readValue(ifstream& s, bool bigEndian) const
+{
+   double value;
+   s.read( reinterpret_cast<char*>(&value) , sizeof(double) );
+   if (bigEndian)
+   {
+      char * pc = reinterpret_cast<char *>(&value);
+      std::swap(pc[0], pc[7]);
+      std::swap(pc[1], pc[6]);
+      std::swap(pc[2], pc[5]);
+      std::swap(pc[3], pc[4]);
+      cout<<endl;
+   }
+   return value;
+}



View it on GitLab: https://salsa.debian.org/debian-gis-team/ossim/compare/354173d5feb96270854eb145fc83b542cd25bb72...f27f6cab43e876c5e019bc48b4bdbd91a12758ef

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/ossim/compare/354173d5feb96270854eb145fc83b542cd25bb72...f27f6cab43e876c5e019bc48b4bdbd91a12758ef
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20180629/84399e51/attachment-0001.html>


More information about the Pkg-grass-devel mailing list