Skip to content
Commits on Source (7)
ossim (2.4.2-3) UNRELEASED; urgency=medium
ossim (2.5.0-1) unstable; urgency=medium
* Team upload.
* Move from experimental to unstable.
-- Bas Couwenberg <sebastic@debian.org> Sun, 26 Aug 2018 10:56:59 +0200
ossim (2.5.0-1~exp1) experimental; urgency=medium
* Team upload.
* New upstream release.
* Bump Standards-Version to 4.2.0, no changes.
* Update watch file to limit matches to archive path.
-- Bas Couwenberg <sebastic@debian.org> Sun, 05 Aug 2018 20:40:17 +0200
-- Bas Couwenberg <sebastic@debian.org> Fri, 24 Aug 2018 09:15:55 +0200
ossim (2.4.2-2) unstable; urgency=medium
......
......@@ -26,128 +26,136 @@
#include <ossim/base/ossimString.h>
#include <iosfwd>
class ossimDatum;
class ossimDatum;
class OSSIM_DLL ossimGpt
{
public:
/**
/**
* Constructor. The values are assumed to be in DEGREES.
*/
ossimGpt(const double alat=0, // degrees
const double alon=0, // degrees
const double ahgt=0,
const ossimDatum* aDatum=ossimDatumFactory::instance()->wgs84())
ossimGpt(const double alat = 0, // degrees
const double alon = 0, // degrees
const double ahgt = 0,
const ossimDatum *aDatum = ossimDatumFactory::instance()->wgs84())
: lat(alat),
lon(alon),
hgt(ahgt), // relative to the ellipsoid
theDatum(aDatum) {}//limitLonTo180();}
hgt(ahgt), // relative to the ellipsoid
theDatum(aDatum)
{
} //limitLonTo180();}
/**
/**
* Copy Constructor:
*/
ossimGpt(const ossimGpt& src);
/**
ossimGpt(const ossimGpt &src);
/**
* Constructor. Conversion from geocentric to ground.
*/
ossimGpt(const ossimEcefPoint &aPt,
const ossimDatum* aDatum=ossimDatumFactory::instance()->wgs84());
ossimGpt(const ossimEcefPoint &aPt,
const ossimDatum *aDatum = ossimDatumFactory::instance()->wgs84());
/**
/**
* Argument aPt (x, y, z) is understood to represent (lon, lat, hgt) relative to WGS84 datum.
*/
ossimGpt(const ossimDpt3d &aPt) :
lat(aPt.y), lon(aPt.x), hgt(aPt.z), theDatum(ossimDatumFactory::instance()->wgs84()) {}
ossimGpt(const ossimDpt3d &aPt) : lat(aPt.y), lon(aPt.x), hgt(aPt.z), theDatum(ossimDatumFactory::instance()->wgs84()) {}
/**
/**
* latr(). Returns the latitude in radian measure.
*/
double latr()const{return lat*RAD_PER_DEG;}
double latr() const { return lat * RAD_PER_DEG; }
/**
/**
* Returns the latitude in radian measure.
*/
void latr(double radianValue){lat = radianValue*DEG_PER_RAD;}
void latr(double radianValue) { lat = radianValue * DEG_PER_RAD; }
/**
/**
* Returns the longitude in radian measure.
*/
double lonr()const{return lon*RAD_PER_DEG;}
double lonr() const { return lon * RAD_PER_DEG; }
/**
/**
* Assumes the value being passed in is in radians.
*/
void lonr(double radianValue)
{lon = radianValue*DEG_PER_RAD; }//limitLonTo180();}
void lonr(double radianValue)
{
lon = radianValue * DEG_PER_RAD;
} //limitLonTo180();}
/**
/**
* Will convert the radian measure to degrees.
*/
double latd()const{return lat;}
double latd() const { return lat; }
/**
/**
* Assumes the passed in value is in degrees.
*/
void latd(double degreeValue){lat = degreeValue;}
void latd(double degreeValue) { lat = degreeValue; }
/**
/**
* Will convert the radian measure to degrees.
*/
double lond()const{return lon;}
double lond() const { return lon; }
/**
/**
* Assumes the passed in value is in degrees.
*/
void lond(double degreeValue){lon = degreeValue; }//limitLonTo180();}
void lond(double degreeValue) { lon = degreeValue; } //limitLonTo180();}
/**
/**
* @return Returns the height in meters above the ellipsoid.
*/
double height()const{return hgt;}
double height() const { return hgt; }
/**
/**
* @return Returns the height in meters above mean sea level (msl).
*
* @note This is the height above the ellipsoid minus any geoid offset.
*/
double heightMSL() const;
double heightMSL() const;
/**
/**
* Sets the "hgt" data member to height.
*
* @param height Height above the ellipsoid in meters.
*/
void height(double height){hgt = height;}
void height(double height) { hgt = height; }
/**
/**
* Sets the "hgt" data member to heightMsl adding any geiod offset.
*
* @param heightMSL Height in meters above msl.
*/
void heightMSL(double heightMSL);
void makeNan(){lat=ossim::nan(); lon=ossim::nan(); hgt=ossim::nan();}
bool isNan()const
{
return (ossim::isnan(lat)&&ossim::isnan(lon)&&ossim::isnan(hgt));
}
bool hasNans()const
{
return (ossim::isnan(lat)||ossim::isnan(lon)||ossim::isnan(hgt));
}
bool isLatNan()const{return ossim::isnan(lat);}
bool isLonNan()const{return ossim::isnan(lon);}
bool isLonLatNan()const{return (ossim::isnan(lat)||ossim::isnan(lon));}
bool isLatLonNan() const{return (ossim::isnan(lat)||ossim::isnan(lon));}
bool isHgtNan()const{return ossim::isnan(hgt);}
std::ostream& print(std::ostream& os, ossim_uint32 precision=15) const;
friend OSSIMDLLEXPORT std::ostream& operator<<(std::ostream& os,
const ossimGpt& pt);
/**
void heightMSL(double heightMSL);
void makeNan()
{
lat = ossim::nan();
lon = ossim::nan();
hgt = ossim::nan();
}
bool isNan() const
{
return (ossim::isnan(lat) && ossim::isnan(lon) && ossim::isnan(hgt));
}
bool hasNans() const
{
return (ossim::isnan(lat) || ossim::isnan(lon) || ossim::isnan(hgt));
}
bool isLatNan() const { return ossim::isnan(lat); }
bool isLonNan() const { return ossim::isnan(lon); }
bool isLonLatNan() const { return (ossim::isnan(lat) || ossim::isnan(lon)); }
bool isLatLonNan() const { return (ossim::isnan(lat) || ossim::isnan(lon)); }
bool isHgtNan() const { return ossim::isnan(hgt); }
std::ostream &print(std::ostream &os, ossim_uint32 precision = 15) const;
friend OSSIMDLLEXPORT std::ostream &operator<<(std::ostream &os,
const ossimGpt &pt);
/**
* @param precision Output floating point precision.
*
* @return ossimString representing point.
......@@ -156,9 +164,9 @@ public:
* ( 30.00000000000000, -90.00000000000000, 0.00000000000000, WGE )
* -----latitude---- -----longitude---- ------height---- datum
*/
ossimString toString(ossim_uint32 precision=15) const;
ossimString toString(ossim_uint32 precision = 15) const;
/**
/**
* Initializes this point from string. This method opens an istream to
* s and then calls operator>>.
*
......@@ -170,9 +178,9 @@ public:
*
* @see operator>>
*/
void toPoint(const std::string& s);
/**
void toPoint(const std::string &s);
/**
* Method to input the formatted string of the "operator<<".
*
* This method starts by doing a "makeNan" on aPt. So if anything goes
......@@ -186,174 +194,188 @@ public:
* ( 30.00000000000000, -90.00000000000000, 0.00000000000000, WGE )
* -----latitude---- -----longitude---- ------height---- datum
*/
friend OSSIMDLLEXPORT std::istream& operator>>(std::istream& is,
ossimGpt& pt);
friend OSSIMDLLEXPORT std::istream &operator>>(std::istream &is,
ossimGpt &pt);
/**
/**
* datum(). returns the datum associated with this ground.
*
*/
const ossimDatum* datum()const{return theDatum;}
const ossimDatum *datum() const { return theDatum; }
/**
/**
* Note: this will not do a shift. This just allows you to set the datum.
* If you want an automatic shift to occur then you must call the
* changeDatum method
*/
void datum(const ossimDatum* aDatum){theDatum = aDatum?aDatum:theDatum;}
void datum(const ossimDatum *aDatum) { theDatum = aDatum ? aDatum : theDatum; }
/**
/**
* This will actually perform a shift.
*/
void changeDatum(const ossimDatum *datum);
void changeDatum(const ossimDatum *datum);
const ossimGpt &operator=(const ossimGpt &aPt);
bool operator==(const ossimGpt &gpt) const;
const ossimGpt& operator = (const ossimGpt &aPt);
bool operator ==(const ossimGpt& gpt)const;
bool operator!=(const ossimGpt &gpt) const { return !(*this == gpt); }
bool operator != (const ossimGpt& gpt) const { return !(*this == gpt); }
/**
/**
* METHOD: limitLonTo180()
* Converts the lon data member to a value between -180 and +180:
*/
void limitLonTo180()
{ if (lon <= -180.0) lon += 360.0; else if (lon > 180.0) lon -= 360.0; }
/**
void limitLonTo180()
{
if (lon <= -180.0)
lon += 360.0;
else if (lon > 180.0)
lon -= 360.0;
}
/**
* @brief Wrap method to maintain longitude between -180 and +180 and latitude between
* -90 and +90. Inlined below.
*/
void wrap();
void clampLon(double low, double high)
{
if(lon < low) lon = low;
if(lon > high) lon = high;
}
void clampLat(double low, double high)
{
if(lat < low) lat = low;
if(lat > high) lat = high;
}
void clampHgt(double low, double high)
{
if(hgt < low) hgt = low;
if(hgt > high) hgt = high;
}
/**
void wrap();
void clampLon(double low, double high)
{
if (lon < low)
lon = low;
if (lon > high)
lon = high;
}
void clampLat(double low, double high)
{
if (lat < low)
lat = low;
if (lat > high)
lat = high;
}
void clampHgt(double low, double high)
{
if (hgt < low)
hgt = low;
if (hgt > high)
hgt = high;
}
/**
* METHOD: distanceTo(ossimGpt)
* Computes straight-line distance in meters between this and arg gpt:
*/
double distanceTo(const ossimGpt& arg_gpt) const;
double distanceTo(const ossimGpt &arg_gpt) const;
/**
/**
* METHOD: azimuthTo(ossimGpt)
* Computes the great-circle starting azimuth (i.e., at this gpt) to the argument gpt in degrees.
* In other words, what direction we would need to start walking in to travel the shortest
* distance to arg_gpt (assumes spherical earth)
*/
double azimuthTo(const ossimGpt& arg_gpt) const;
double azimuthTo(const ossimGpt &arg_gpt) const;
ossimDpt metersPerDegree() const;
ossimDpt metersPerDegree() const;
ossimString toDmsString()const;
ossimString toDmsString() const;
bool isEqualTo(const ossimGpt& rhs, ossimCompareType compareType=OSSIM_COMPARE_FULL)const;
ossim_float64 lat; //> latitude in degrees measure
ossim_float64 lon; //> longitude in degrees measure
bool isEqualTo(const ossimGpt &rhs, ossimCompareType compareType = OSSIM_COMPARE_FULL) const;
ossim_float64 lat; //> latitude in degrees measure
ossim_float64 lon; //> longitude in degrees measure
/**
/**
* Height in meters above the ellipsiod.
*
* @note This is NOT the same as "height msl". "Height msl" is above
* the geoid or better know as mean sea level.
*/
ossim_float64 hgt;
*/
ossim_float64 hgt;
private:
/**
/**
* Know reference location plus an implied ellipsoid.
*/
const ossimDatum* theDatum;
const ossimDatum *theDatum;
};
inline const ossimGpt& ossimGpt::operator=(const ossimGpt& aPt)
inline const ossimGpt &ossimGpt::operator=(const ossimGpt &aPt)
{
if ( this != &aPt )
{
lat = aPt.lat;
lon = aPt.lon;
hgt = aPt.hgt;
if(aPt.datum())
{
theDatum = aPt.datum();
}
if(!theDatum)
{
theDatum = ossimDatumFactory::instance()->wgs84();
}
}
return *this;
if (this != &aPt)
{
lat = aPt.lat;
lon = aPt.lon;
hgt = aPt.hgt;
if (aPt.datum())
{
theDatum = aPt.datum();
}
if (!theDatum)
{
theDatum = ossimDatumFactory::instance()->wgs84();
}
}
return *this;
}
inline void ossimGpt::wrap()
{
if ( lon > 180.0 )
{
// only wrap if values are not nan
// may want to change this to isbad because
// hey could be INF instead of NAN
if (ossim::isnan(lon) || ossim::isnan(lat))
return;
if (lon > 180.0)
{
do
{
lon = lon - 360.0;
} while (lon > 180.0);
}
else if (lon < -180.0)
{
do
{
lon = lon + 360.0;
} while (lon < -180.0);
}
if (lat > 90.0)
{
if (lat > 360.0) // Remove total wraps.
{
do
{
lon = lon - 360.0;
} while ( lon > 180.0 );
}
else if ( lon < -180.0 )
{
lat = lat - 360.0;
} while (lat > 360.0);
}
if (lat > 270.0) // Between 270 and 360.
{
lat = lat - 360.0;
}
else if (lat > 90) // Between 90 and 270.
{
lat = 180.0 - lat;
}
}
else if (lat < -90.0)
{
if (lat < -360.0) // Remove total wraps.
{
do
{
lon = lon + 360.0;
} while ( lon < -180.0 );
}
if ( lat > 90.0 )
{
if ( lat > 360.0 ) // Remove total wraps.
{
do
{
lat = lat - 360.0;
} while ( lat > 360.0);
}
if ( lat > 270.0 ) // Between 270 and 360.
{
lat = lat - 360.0;
}
else if ( lat > 90 ) // Between 90 and 270.
{
lat = 180.0 - lat;
}
}
else if ( lat < -90.0 )
{
if ( lat < -360.0 ) // Remove total wraps.
{
do
{
lat = lat + 360.0;
} while ( lat < -360.0);
}
if ( lat < -270.0 )
{
lat = 360.0 + lat; // Between -270 and -360;
}
else if ( lat < -90.0 )
{
lat = -180.0 - lat;
}
}
lat = lat + 360.0;
} while (lat < -360.0);
}
if (lat < -270.0)
{
lat = 360.0 + lat; // Between -270 and -360;
}
else if (lat < -90.0)
{
lat = -180.0 - lat;
}
}
}
#endif /* #ifndef ossimGpt_HEADER */
......@@ -165,6 +165,13 @@ public:
const ossimProjection* getProjection() const { return m_projection.get(); }
ossimProjection* getProjection() { return m_projection.get(); }
/**
* @brief Returns true if underlying projection is derived from
* ossimMapProjection.
* @return true if map projected; false, if not.
*/
bool isMapProjected() const;
/**
* @return const ossimMapProjection* or NULL if projection not set or not
* derived from ossimMapProjection.
......
......@@ -214,7 +214,8 @@ private:
ossimDpt computeRoundTripErrorViewPt(const ossimDpt& dpt)const;
bool isViewAPoint()const;
bool isIdentity()const;
bool canBilinearInterpolate(double error)const;
//bool canBilinearInterpolate(double error) const;
bool canBilinearInterpolate() const;
ossimDpt getParametricCenter(const ossimDpt& ul, const ossimDpt& ur,
const ossimDpt& lr, const ossimDpt& ll)const;
......@@ -321,7 +322,7 @@ private:
* renderers together. So if we have one
* renderer doing a scale and they pass an r-level
* down and we have another renderer within the
* chain he will be starting at a different r-level.
* chain we will be starting at a different r-level.
* The default will be r-level 0 request coming
* from the right.
*/
......@@ -338,8 +339,11 @@ private:
ossimPolyArea2d m_viewArea;
bool m_crossesDateline;
TYPE_DATA
double m_averageViewToImageScale;
double m_averageViewToImageRLevelScale;
TYPE_DATA
};
inline ossimImageRenderer::ossimRendererSubRectInfo::ossimRendererSubRectInfo(ossimImageViewTransform* transform)
......
......@@ -57,7 +57,7 @@ public:
*/
virtual void getImageToViewScale(ossimDpt& resultScale,
const ossimDpt& imagePoint,
const ossimDpt& deltaImagePointXY)const;
const ossimDpt& deltaImagePointXY=ossimDpt(1.0,1.0))const;
/*!
* If it needs to it will use the information passed in to get the
......@@ -70,10 +70,10 @@ public:
* of one. We have to see how this works before we actually keep this
* implementation.
*/
virtual void getViewToImageScale(ossimDpt& resultScale,
const ossimDpt& imagePoint,
const ossimDpt& deltaImagePointXY)const;
virtual void getViewToImageScale(ossimDpt &resultScale,
const ossimDpt &imagePoint,
const ossimDpt &deltaImagePointXY = ossimDpt(1.0, 1.0)) const;
virtual void imageToView(const ossimDpt& imagePoint,
ossimDpt& viewPoint)const;
......@@ -114,7 +114,7 @@ public:
/** 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);
......
......@@ -1079,6 +1079,10 @@ void ossimImageGeometry::getImageEdgePoints(std::vector<ossimDpt>& result, ossim
// error out
return;
}
// Make edge to edge.
imageRect.expand( ossimDpt(0.5, 0.5) );
result.clear();
// First get the image points we will be transforming
if(partitions > 2)
......@@ -1151,7 +1155,7 @@ void ossimImageGeometry::calculatePolyBounds(ossimPolyArea2d& result, ossim_uint
ossimDpt(180,90),
ossimDpt(180,-90));
getBoundingRect(imageRect);
bool affectedByElevation = isAffectedByElevation();
// bool affectedByElevation = isAffectedByElevation();
bool crossesDateline = getCrossesDateline();
result.clear();
if(imageRect.hasNans())
......@@ -1221,7 +1225,6 @@ void ossimImageGeometry::calculatePolyBounds(ossimPolyArea2d& result, ossim_uint
}
else
{
ossim_uint32 idx=0;
for(std::vector<ossimDpt>::const_iterator iter=points.begin();
iter != points.end();++iter)
{
......@@ -1674,3 +1677,9 @@ ossim_float64 ossimImageGeometry::northUpAngle()const
return result;
} // End: ossimImageGeometry::northUpAngle()
bool ossimImageGeometry::isMapProjected() const
{
return dynamic_cast<const ossimMapProjection*>( m_projection.get() ) != 0;
}
This diff is collapsed.
......@@ -211,55 +211,47 @@ void ossimImageViewTransform::getScaleChangeViewToImage(ossimDpt& result,
}
}
void ossimImageViewTransform::getImageToViewScale(ossimDpt& resultScale,
const ossimDpt& imagePoint,
const ossimDpt& deltaImagePointXY)const
ossimDrect ossimImageViewTransform::getImageToViewBounds(const ossimDrect& imageRect)const
{
ossimDpt p1 = imagePoint;
ossimDpt p2(imagePoint.x + deltaImagePointXY.x,
imagePoint.y);
ossimDpt p3(imagePoint.x,
imagePoint.y + deltaImagePointXY.y);
ossimDpt transformedP1;
ossimDpt transformedP2;
ossimDpt transformedP3;
ossimDpt p1;
ossimDpt p2;
ossimDpt p3;
ossimDpt p4;
imageToView(p1, transformedP1);
imageToView(p2, transformedP2);
imageToView(p3, transformedP3);
imageToView(imageRect.ul(), p1);
imageToView(imageRect.ur(), p2);
imageToView(imageRect.lr(), p3);
imageToView(imageRect.ll(), p4);
ossimDpt deltaP1P2 = transformedP1 - transformedP2;
ossimDpt deltaP1P3 = transformedP1 - transformedP3;
// now compute the distances.
double sumSquaredSqrtP1P2 = sqrt((deltaP1P2.x*deltaP1P2.x) +
(deltaP1P2.y*deltaP1P2.y));
double sumSquaredSqrtP1P3 = sqrt((deltaP1P3.x*deltaP1P3.x) +
(deltaP1P3.y*deltaP1P3.y));
return ossimDrect(p1, p2, p3, p4);
}
resultScale.x = 0;
resultScale.y = 0;
ossimDrect ossimImageViewTransform::getViewToImageBounds(const ossimDrect& viewRect)const
{
ossimDpt p1;
ossimDpt p2;
ossimDpt p3;
ossimDpt p4;
if(sumSquaredSqrtP1P2 > FLT_EPSILON)
{
resultScale.x = sumSquaredSqrtP1P2/deltaImagePointXY.x;
}
if(sumSquaredSqrtP1P3 > FLT_EPSILON)
{
resultScale.y = sumSquaredSqrtP1P3/deltaImagePointXY.y;
}
viewToImage(viewRect.ul(), p1);
viewToImage(viewRect.ur(), p2);
viewToImage(viewRect.lr(), p3);
viewToImage(viewRect.ll(), p4);
return ossimDrect(p1, p2, p3, p4);
}
void ossimImageViewTransform::getViewToImageScale(ossimDpt& resultScale,
const ossimDpt& viewPoint,
const ossimDpt& deltaViewPointXY)const
#if 0
void ossimImageViewTransform::getViewToImageScale(ossimDpt &resultScale,
const ossimDpt &viewPoint,
const ossimDpt &deltaViewPointXY) const
{
ossimDpt p1 = viewPoint;
ossimDpt p2(viewPoint.x + deltaViewPointXY.x,
viewPoint.y);
viewPoint.y);
ossimDpt p3(viewPoint.x,
viewPoint.y + deltaViewPointXY.y);
viewPoint.y + deltaViewPointXY.y);
ossimDpt transformedP1;
ossimDpt transformedP2;
......@@ -273,54 +265,192 @@ void ossimImageViewTransform::getViewToImageScale(ossimDpt& resultScale,
ossimDpt deltaP1P3 = transformedP1 - transformedP3;
// now compute the distances.
double sumSquaredSqrtP1P2 = sqrt((deltaP1P2.x*deltaP1P2.x) +
(deltaP1P2.y*deltaP1P2.y));
double sumSquaredSqrtP1P3 = sqrt((deltaP1P3.x*deltaP1P3.x) +
(deltaP1P3.y*deltaP1P3.y));
double sumSquaredSqrtP1P2 = sqrt((deltaP1P2.x * deltaP1P2.x) +
(deltaP1P2.y * deltaP1P2.y));
double sumSquaredSqrtP1P3 = sqrt((deltaP1P3.x * deltaP1P3.x) +
(deltaP1P3.y * deltaP1P3.y));
resultScale.x = 0;
resultScale.y = 0;
if(sumSquaredSqrtP1P2 > FLT_EPSILON)
if (sumSquaredSqrtP1P2 > FLT_EPSILON)
{
resultScale.x = sumSquaredSqrtP1P2 / deltaViewPointXY.x;
}
if (sumSquaredSqrtP1P3 > FLT_EPSILON)
{
resultScale.y = sumSquaredSqrtP1P3 / deltaViewPointXY.y;
}
}
#else
void ossimImageViewTransform::getViewToImageScale(ossimDpt &result,
const ossimDpt &viewSeedPoint,
const ossimDpt &dxdy) const
{
result.makeNan();
ossimDpt dxdyHalf(dxdy.x / 2.0, dxdy.y / 2.0);
ossimDpt iptdx1 = viewSeedPoint - ossimDpt(dxdyHalf.x, 0.0);
ossimDpt iptdx2 = iptdx1 + ossimDpt(dxdy.x, 0.0);
ossimDpt iptdy1 = viewSeedPoint - ossimDpt(dxdyHalf.y, 0.0);
ossimDpt iptdy2 = iptdx1 + ossimDpt(0.0, dxdy.y);
ossimDpt dx1;
ossimDpt dx2;
ossimDpt dy1;
ossimDpt dy2;
viewToImage(iptdx1, dx1);
viewToImage(iptdx2, dx2);
viewToImage(iptdy1, dy1);
viewToImage(iptdy2, dy2);
if (!(dx1.hasNans() || dx2.hasNans()))
{
ossimDpt delta = dx1 - dx2;
// now compute the distances.
ossim_float64 sumSquared = sqrt((delta.x * delta.x) +
(delta.y * delta.y));
if (sumSquared > FLT_EPSILON)
{
resultScale.x = sumSquaredSqrtP1P2/deltaViewPointXY.x;
result.x = sumSquared / dxdy.x;
}
if(sumSquaredSqrtP1P3 > FLT_EPSILON)
else
{
resultScale.y = sumSquaredSqrtP1P3/deltaViewPointXY.y;
result.x = ossim::nan();
}
}
}
if (!(dy1.hasNans() || dy2.hasNans()))
{
ossimDpt delta = dy1 - dy2;
ossimDrect ossimImageViewTransform::getImageToViewBounds(const ossimDrect& imageRect)const
{
ossimDpt p1;
ossimDpt p2;
ossimDpt p3;
ossimDpt p4;
// now compute the distances.
ossim_float64 sumSquared = sqrt((delta.x * delta.x) +
(delta.y * delta.y));
imageToView(imageRect.ul(), p1);
imageToView(imageRect.ur(), p2);
imageToView(imageRect.lr(), p3);
imageToView(imageRect.ll(), p4);
if (sumSquared > FLT_EPSILON)
{
result.y = sumSquared / dxdy.y;
}
else
{
result.y = ossim::nan();
}
}
return ossimDrect(p1, p2, p3, p4);
if (result.hasNans())
{
result.makeNan();
}
}
#endif
ossimDrect ossimImageViewTransform::getViewToImageBounds(const ossimDrect& viewRect)const
#if 0
void ossimImageViewTransform::getImageToViewScale(ossimDpt &resultScale,
const ossimDpt &imagePoint,
const ossimDpt &deltaImagePointXY) const
{
ossimDpt p1;
ossimDpt p2;
ossimDpt p3;
ossimDpt p4;
ossimDpt p1 = imagePoint;
ossimDpt p2(imagePoint.x + deltaImagePointXY.x,
imagePoint.y);
ossimDpt p3(imagePoint.x,
imagePoint.y + deltaImagePointXY.y);
viewToImage(viewRect.ul(), p1);
viewToImage(viewRect.ur(), p2);
viewToImage(viewRect.lr(), p3);
viewToImage(viewRect.ll(), p4);
ossimDpt transformedP1;
ossimDpt transformedP2;
ossimDpt transformedP3;
return ossimDrect(p1, p2, p3, p4);
imageToView(p1, transformedP1);
imageToView(p2, transformedP2);
imageToView(p3, transformedP3);
ossimDpt deltaP1P2 = transformedP1 - transformedP2;
ossimDpt deltaP1P3 = transformedP1 - transformedP3;
// now compute the distances.
double sumSquaredSqrtP1P2 = sqrt((deltaP1P2.x * deltaP1P2.x) +
(deltaP1P2.y * deltaP1P2.y));
double sumSquaredSqrtP1P3 = sqrt((deltaP1P3.x * deltaP1P3.x) +
(deltaP1P3.y * deltaP1P3.y));
resultScale.x = 0;
resultScale.y = 0;
if (sumSquaredSqrtP1P2 > FLT_EPSILON)
{
resultScale.x = sumSquaredSqrtP1P2 / deltaImagePointXY.x;
}
if (sumSquaredSqrtP1P3 > FLT_EPSILON)
{
resultScale.y = sumSquaredSqrtP1P3 / deltaImagePointXY.y;
}
}
#else
void ossimImageViewTransform::getImageToViewScale(ossimDpt &result,
const ossimDpt &imageSeedPoint,
const ossimDpt &dxdy) const
{
result.makeNan();
ossimDpt dxdyHalf(dxdy.x / 2.0, dxdy.y / 2.0);
ossimDpt iptdx1 = imageSeedPoint - ossimDpt(dxdyHalf.x, 0.0);
ossimDpt iptdx2 = iptdx1 + ossimDpt(dxdy.x,0.0);
ossimDpt iptdy1 = imageSeedPoint - ossimDpt(dxdyHalf.y, 0.0);
ossimDpt iptdy2 = iptdx1 + ossimDpt(0.0,dxdy.y);
ossimDpt dx1;
ossimDpt dx2;
ossimDpt dy1;
ossimDpt dy2;
imageToView(iptdx1, dx1);
imageToView(iptdx2, dx2);
imageToView(iptdy1, dy1);
imageToView(iptdy2, dy2);
if (!(dx1.hasNans() || dx2.hasNans()))
{
ossimDpt delta = dx1 - dx2;
// now compute the distances.
ossim_float64 sumSquared = sqrt((delta.x * delta.x) +
(delta.y * delta.y));
if (sumSquared > FLT_EPSILON)
{
result.x = sumSquared / dxdy.x;
}
else
{
result.x = ossim::nan();
}
}
if (!(dy1.hasNans() || dy2.hasNans()))
{
ossimDpt delta = dy1 - dy2;
// now compute the distances.
ossim_float64 sumSquared = sqrt((delta.x * delta.x) +
(delta.y * delta.y));
if (sumSquared > FLT_EPSILON)
{
result.y = sumSquared / dxdy.y;
}
else
{
result.y = ossim::nan();
}
}
if (result.hasNans())
{
result.makeNan();
}
}
#endif
std::ostream& ossimImageViewTransform::print(std::ostream& out) const
{
return out;
......
......@@ -338,11 +338,11 @@ void ossimRsmModel::lineSampleHeightToWorld(const ossimDpt& image_point,
gpt.lon = ossim::radiansToDegrees(nlon*m_pca[pcaIndex].m_xnrmsf + m_pca[pcaIndex].m_xnrmo);
gpt.hgt = (nhgt * m_pca[pcaIndex].m_znrmsf) + m_pca[pcaIndex].m_znrmo; //ellHeight;
gpt.wrap();
//---
// Note: See above note. Added in wrap call. Longitude was coming out 242
// when should have been -118. (drb - 22 May 2015)
//---
gpt.wrap();
} // End: ossimRsmModel::lineSampleHeightToWorld( ... )
......