[Git][debian-gis-team/ossim][master] 5 commits: New upstream version 2.6.2

Bas Couwenberg gitlab at salsa.debian.org
Thu Jan 17 06:27:08 GMT 2019


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


Commits:
bf8434b8 by Bas Couwenberg at 2019-01-17T06:00:28Z
New upstream version 2.6.2
- - - - -
f4c1c55a by Bas Couwenberg at 2019-01-17T06:00:35Z
Merge tag 'upstream/2.6.2'

Upstream version 2.6.2

- - - - -
195f2df3 by Bas Couwenberg at 2019-01-17T06:00:57Z
New upstream release.

- - - - -
1c8fee5f by Bas Couwenberg at 2019-01-17T06:01:32Z
Refresh patches.

- - - - -
3c106d7f by Bas Couwenberg at 2019-01-17T06:01:52Z
Set distribution to experimental.

- - - - -


14 changed files:

- apps/ossim-image-synth/ossim-image-synth.cpp
- apps/ossim-rpcgen/ossim-rpcgen.cpp
- debian/changelog
- debian/patches/spelling-errors.patch
- include/ossim/base/ossimMatrix4x4.h
- include/ossim/projection/ossimMapProjection.h
- src/elevation/ossimDtedElevationDatabase.cpp
- src/elevation/ossimGeneralRasterElevationDatabase.cpp
- src/elevation/ossimSrtmElevationDatabase.cpp
- src/elevation/ossimTiledElevationDatabase.cpp
- src/projection/ossimEquDistCylProjection.cpp
- src/projection/ossimMapProjection.cpp
- src/projection/ossimRpcSolver.cpp
- src/support_data/ossimNitfFileHeader.cpp


Changes:

=====================================
apps/ossim-image-synth/ossim-image-synth.cpp
=====================================
@@ -21,10 +21,11 @@
 #include <cmath>
 #include <sstream>
 #include <iostream>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
 
 using namespace std;
 
-#define USE_UINT8 false
+#define USE_UINT8 true
 
 int main(int argc, char *argv[])
 {
@@ -34,19 +35,16 @@ int main(int argc, char *argv[])
    ossimInit::instance()->addOptions(ap);
    ossimInit::instance()->initialize(ap);
    
-   if ( (ap.argc() < 4) || ap.read("-h") || ap.read("--help") )
+   if ( (ap.argc() < 2) || ap.read("-h") || ap.read("--help") )
    {
-      cout << "\nUsage: "<<ap[0]<<" <dx> <dy> <filename>\n"<<endl;
+      cout << "\nUsage: "<<ap[0]<<" <filename>\n"<<endl;
       return 0;
    }
 
-   int dx = atoi(ap[1]);
-   int dy = atoi(ap[2]);
-   ossimFilename filename = ap[3];
-   filename.setExtension(".tif");
+   ossimFilename filename = ap[1];
 
    // Establish the image geometry's map projection:
-   ossimIpt image_size (256, 256);
+   ossimIpt image_size (32, 32);
    ossimGpt observerGpt (0, 0, 0);
    ossimDpt gsd (1.0, 1.0); // must be same value in both directions
    ossimRefPtr<ossimEquDistCylProjection> mapProj = new ossimEquDistCylProjection();
@@ -80,46 +78,47 @@ int main(int argc, char *argv[])
       outImage->initialize();
    else
       return -1;
-   double A = (max - min)/2.0;
+
    outImage->fill(min);
+
+   PIXEL_TYPE step = 8;
+   PIXEL_TYPE value = 0;
    PIXEL_TYPE* buffer = ( PIXEL_TYPE*) outImage->getBuf(0);
 
-   if ((dx != 0) || (dy != 0))
+   ossim_uint32 i = 0;
+   for (int y=0; y<image_size.y; y++)
    {
-      // Allocate image buffer:
-      ossim_uint32 i = 0;
-      double phase = 0;
-
-      double dpx = 0;
-      if (dx != 0)
-         dpx = 2*M_PI/dx; // phase rate (radians per pixel)
-      double dpy = 0;
-      if (dy != 0)
-         dpy = 2*M_PI/dy; // phase rate (radians per pixel)
-
-      for (int y=0; y<image_size.y; y++)
+      for (int x=0; x<image_size.x; x++)
       {
-         phase = y*dpy;
-         for (int x=0; x<image_size.x; x++)
-         {
-            // Loops to fill one n x n chip with a single freq (1/lambda) component:
-            buffer[i++] = (PIXEL_TYPE) (A * (cos(phase) + 1.0));
-            phase += dpx;
-         }
+         buffer[i++] = value;
+         if (value == 248)
+            value = 0;
+         else
+            value += step;
       }
    }
 
+   outImage->write("tile.tif");
+   
    // Create output image chain:
    ossimRefPtr<ossimMemoryImageSource> memSource = new ossimMemoryImageSource;
    memSource->setImage(outImage);
    memSource->setImageGeometry(geometry.get());
 
-   ossimRefPtr<ossimTiffWriter> writer = new ossimTiffWriter();
+   // Create TIFF writer:
+   ossimRefPtr<ossimImageFileWriter> writer =
+      ossimImageWriterFactoryRegistry::instance()->createWriterFromExtension(filename.ext());
+   if (!writer)
+      throw runtime_error( "Unable to create writer given filename extension." );
    writer->connectMyInputTo(0, memSource.get());
    writer->setFilename(filename);
-   writer->setGeotiffFlag(true);
    bool success = writer->execute();
    //writer->writeExternalGeometryFile();
 
-   return 0;
+   if (success)
+      cout<<"Wrote "<<filename<<"\n"<<endl;
+   else
+      cout<<"Error encountered writing "<<filename<<"\n"<<endl;
+
+   return (int)success;
 }


=====================================
apps/ossim-rpcgen/ossim-rpcgen.cpp
=====================================
@@ -23,8 +23,11 @@ int main(int argc, char* argv[])
    ossimArgumentParser::ossimParameter tempParam3(tempString3);
    ossimArgumentParser::ossimParameter tempParam4(tempString4);
    ossimArgumentParser argumentParser(&argc, argv);
-   ossimInit::instance()->addOptions(argumentParser);
-   ossimInit::instance()->initialize(argumentParser);
+   ossimInit* init = ossimInit::instance();
+   init->addOptions(argumentParser);
+   init->initialize(argumentParser);
+   bool useElevation = init->getElevEnabledFlag();
+
    bool rpcFlag       = false;
    bool cgFlag       = false;
    ossimDrect imageRect;
@@ -176,7 +179,7 @@ int main(int argc, char* argv[])
    {
       // Solve for replacement RPC:
       ossimNotify(ossimNotifyLevel_INFO) << "\nSolving for RPC coefficients..." << std::endl;
-      ossimRefPtr<ossimRpcSolver> solver = new ossimRpcSolver(true, false);
+      ossimRefPtr<ossimRpcSolver> solver = new ossimRpcSolver(useElevation, false);
       bool converged = solver->solve(imageRect, geom.get(), error);
       rpc = solver->getRpcModel();
    }


=====================================
debian/changelog
=====================================
@@ -1,8 +1,11 @@
-ossim (2.6.1-2) UNRELEASED; urgency=medium
+ossim (2.6.2-1~exp1) experimental; urgency=medium
 
+  * Team upload.
+  * New upstream release.
   * Bump Standards-Version to 4.3.0, no changes.
+  * Refresh patches.
 
- -- Bas Couwenberg <sebastic at debian.org>  Tue, 25 Dec 2018 22:51:03 +0100
+ -- Bas Couwenberg <sebastic at debian.org>  Thu, 17 Jan 2019 07:01:36 +0100
 
 ossim (2.6.1-1) unstable; urgency=medium
 


=====================================
debian/patches/spelling-errors.patch
=====================================
@@ -187,7 +187,7 @@ Author: Bas Couwenberg <sebastic at debian.org>
        << "\n Example:"
 --- a/apps/ossim-rpcgen/ossim-rpcgen.cpp
 +++ b/apps/ossim-rpcgen/ossim-rpcgen.cpp
-@@ -38,7 +38,7 @@ int main(int argc, char* argv[])
+@@ -41,7 +41,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"


=====================================
include/ossim/base/ossimMatrix4x4.h
=====================================
@@ -57,14 +57,22 @@ class OSSIM_DLL ossimMatrix4x4
      void setRotate( const ossim::Quaternion& quat);
      ossim::Quaternion getRotate()const;
      void getRotate(ossim::Quaternion& quat)const;
-     
-  ossimMatrix4x4 operator+ (const ossimMatrix4x4& rhs)const
-    {
+
+   ossimMatrix4x4 operator=(const ossimMatrix4x4& rhs)
+   {
+      theData[0][0]=rhs.theData[0][0]; theData[0][1]=rhs.theData[0][1]; theData[0][2]=rhs.theData[0][2]; theData[0][3]=rhs.theData[0][3];
+      theData[1][0]=rhs.theData[1][0]; theData[1][1]=rhs.theData[1][1]; theData[1][2]=rhs.theData[1][2]; theData[1][3]=rhs.theData[1][3];
+      theData[2][0]=rhs.theData[2][0]; theData[2][1]=rhs.theData[2][1]; theData[2][2]=rhs.theData[2][2]; theData[2][3]=rhs.theData[2][3];
+      theData[3][0]=rhs.theData[3][0]; theData[3][1]=rhs.theData[3][1]; theData[3][2]=rhs.theData[3][2]; theData[3][3]=rhs.theData[3][3];
+      return *this;
+   }
+   ossimMatrix4x4 operator+ (const ossimMatrix4x4& rhs)const
+   {
       return ossimMatrix4x4(theData[0][0] + rhs.theData[0][0], theData[0][1] + rhs.theData[0][1], theData[0][2] + rhs.theData[0][2], theData[0][3] + rhs.theData[0][3],
                             theData[1][0] + rhs.theData[1][0], theData[1][1] + rhs.theData[1][1], theData[1][2] + rhs.theData[1][2], theData[1][3] + rhs.theData[1][3],
                             theData[2][0] + rhs.theData[2][0], theData[2][1] + rhs.theData[2][1], theData[2][2] + rhs.theData[2][2], theData[2][3] + rhs.theData[2][3],
                             theData[3][0] + rhs.theData[3][0], theData[3][1] + rhs.theData[3][1], theData[3][2] + rhs.theData[3][2], theData[3][3] + rhs.theData[3][3]);
-    }
+   }
   ossimMatrix4x4 operator- (const ossimMatrix4x4& rhs)const
     {
       return ossimMatrix4x4(theData[0][0] - rhs.theData[0][0], theData[0][1] - rhs.theData[0][1], theData[0][2] - rhs.theData[0][2], theData[0][3] - rhs.theData[0][3],


=====================================
include/ossim/projection/ossimMapProjection.h
=====================================
@@ -249,6 +249,7 @@ public:
    bool getElevationLookupFlag()const;
 
    const ossimMatrix4x4& getModelTransform() const { return theModelTransform; }
+   void setModelTransform(const ossimMatrix4x4& transform);
 
    /**
     * @brief Implementation of pure virtual


=====================================
src/elevation/ossimDtedElevationDatabase.cpp
=====================================
@@ -62,7 +62,7 @@ double ossimDtedElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt)
 double ossimDtedElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
 {
    double h = getHeightAboveMSL(gpt);
-   if(h != ossim::nan())
+   if(!ossim::isnan(h))
    {
       double offset = getOffsetFromEllipsoid(gpt);
       


=====================================
src/elevation/ossimGeneralRasterElevationDatabase.cpp
=====================================
@@ -21,7 +21,7 @@ double ossimGeneralRasterElevationDatabase::getHeightAboveMSL(const ossimGpt& gp
 double ossimGeneralRasterElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
 {
    double h = getHeightAboveMSL(gpt);
-   if(h != ossim::nan())
+   if(!ossim::isnan(h))
    {
       h += getOffsetFromEllipsoid(gpt);
    }


=====================================
src/elevation/ossimSrtmElevationDatabase.cpp
=====================================
@@ -57,7 +57,7 @@ double ossimSrtmElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt)
 double ossimSrtmElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
 {
    double h = getHeightAboveMSL(gpt);
-   if(h != ossim::nan())
+   if(!ossim::isnan(h))
    {
       h += getOffsetFromEllipsoid(gpt);
    }


=====================================
src/elevation/ossimTiledElevationDatabase.cpp
=====================================
@@ -342,7 +342,7 @@ double ossimTiledElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt)
 double ossimTiledElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
 {
    double h = getHeightAboveMSL(gpt);
-   if(h != ossim::nan())
+   if(!ossim::isnan(h))
    {
       h += getOffsetFromEllipsoid(gpt);
    }


=====================================
src/projection/ossimEquDistCylProjection.cpp
=====================================
@@ -655,12 +655,16 @@ long ossimEquDistCylProjection::Convert_Equidistant_Cyl_To_Geodetic(double Easti
   {
     dy = Northing - Eqcy_False_Northing;
     dx = Easting - Eqcy_False_Easting;
-    *Latitude = dy / Ra;
+    double RaInv = 1.0/Ra;
+    *Latitude = dy *RaInv;
 
     if (Ra_Cos_Eqcy_Std_Parallel == 0)
       *Longitude = 0;
     else
-      *Longitude = Eqcy_Origin_Long + dx / Ra_Cos_Eqcy_Std_Parallel;
+    {
+       double RaCosLatInv = 1.0/Ra_Cos_Eqcy_Std_Parallel;
+      *Longitude = Eqcy_Origin_Long + dx*RaCosLatInv;
+    }
 
 //     if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
 //       *Latitude = PI_OVER_2;


=====================================
src/projection/ossimMapProjection.cpp
=====================================
@@ -271,6 +271,14 @@ void ossimMapProjection::update()
    updateTransform();
 }
 
+void ossimMapProjection::setModelTransform (const ossimMatrix4x4& transform)
+{
+   theModelTransform = transform;
+   theInverseModelTransform = theModelTransform;
+   theInverseModelTransform.i();
+   updateFromTransform();
+}
+
 void ossimMapProjection::updateTransform()
 {
    // Assumes model coordinates in meters:


=====================================
src/projection/ossimRpcSolver.cpp
=====================================
@@ -400,6 +400,9 @@ bool ossimRpcSolver::solve(const ossimDrect& imageBounds,
             <<theMaxResidual<<") is larger than the desired error tolerance ("<<tolerance<<" p)."
             << std::endl;
    }
+
+   // Initialize metadata:
+   theRpcModel->setMetersPerPixel(geom->getMetersPerPixel());
    return converged;
 }
 


=====================================
src/support_data/ossimNitfFileHeader.cpp
=====================================
@@ -79,6 +79,7 @@ bool ossimNitfFileHeader::getDesInformation(ossimNitfDesInformation &desInfo,
          }
       }
    }
+   return false;
 }
 
 bool  ossimNitfFileHeader::hasImages()const



View it on GitLab: https://salsa.debian.org/debian-gis-team/ossim/compare/4c524c785ec9f7255304da7c9f0d53984c7a8435...3c106d7f3e0a0b7abce02229c88908fad070b7c8

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/ossim/compare/4c524c785ec9f7255304da7c9f0d53984c7a8435...3c106d7f3e0a0b7abce02229c88908fad070b7c8
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/20190117/59efaa3d/attachment-0001.html>


More information about the Pkg-grass-devel mailing list