/usr/include/ossim/projection/ossimMapProjection.h is in libossim-dev 1.7.21-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 | //*******************************************************************
//
// License: See top level LICENSE.txt file.
//
// Author: Garrett Potts
//
// Description:
//
// Base class for all map projections.
//
//*******************************************************************
// $Id: ossimMapProjection.h 13823 2008-10-31 17:21:22Z dburken $
#ifndef ossimMapProjection_HEADER
#define ossimMapProjection_HEADER
#include <ossim/projection/ossimProjection.h>
#include <ossim/base/ossimConstants.h>
#include <ossim/base/ossimGpt.h>
#include <ossim/base/ossimKeyword.h>
#include <ossim/base/ossimString.h>
#include <ossim/base/ossimEllipsoid.h>
#include <ossim/base/ossimDatum.h>
#include <ossim/base/ossimDrect.h>
#include <iostream>
#include <ossim/base/ossimMatrix4x4.h>
class ossimKeywordlist;
class OSSIMDLLEXPORT ossimMapProjection : public ossimProjection
{
public:
ossimMapProjection(const ossimEllipsoid& ellipsoid = ossimEllipsoid(),
const ossimGpt& origin=ossimGpt());
ossimMapProjection(const ossimMapProjection& src);
virtual ~ossimMapProjection();
virtual ossimGpt origin()const;
/**
* All map projections will convert the world coordinate to an easting
* northing (Meters).
*/
virtual ossimDpt forward(const ossimGpt &worldPoint) const = 0;
/**
* Will take a point in meters and convert it to ground.
*/
virtual ossimGpt inverse(const ossimDpt &projectedPoint)const = 0;
virtual ossimDpt worldToLineSample(const ossimGpt &worldPoint)const;
virtual void worldToLineSample(const ossimGpt &worldPoint,
ossimDpt& lineSample)const;
virtual ossimGpt lineSampleToWorld(const ossimDpt &projectedPoint)const;
virtual void lineSampleToWorld(const ossimDpt &projectedPoint,
ossimGpt& gpt)const;
/**
* This is the pure virtual that projects the image point to the given
* elevation above ellipsoid, thereby bypassing reference to a DEM. Useful
* for projections that are sensitive to elevation.
*/
virtual void lineSampleHeightToWorld(const ossimDpt& lineSampPt,
const double& heightAboveEllipsoid,
ossimGpt& worldPt) const;
virtual void lineSampleToEastingNorthing(const ossimDpt& liineSample,
ossimDpt& eastingNorthing)const;
virtual void eastingNorthingToLineSample(const ossimDpt& eastingNorthing,
ossimDpt& lineSample)const;
virtual void eastingNorthingToWorld(const ossimDpt& eastingNorthing,
ossimGpt& worldPt)const;
/** @return The false easting. */
virtual double getFalseEasting() const;
/** @return The false northing. */
virtual double getFalseNorthing() const;
/**
* Derived classes should implement as needed.
* This implementation returns 0.0.
*
* @return The first standard parallel.
*/
virtual double getStandardParallel1() const;
/**
* Derived classes should implement as needed.
* This implementation returns 0.0.
*
* @return The second standard parallel.
*/
virtual double getStandardParallel2() const;
virtual void update();
virtual void setPcsCode(ossim_uint16 pcsCode);
virtual ossim_uint16 getPcsCode()const;
/**
* Returns the projection name.
*/
virtual ossimString getProjectionName() const;
/**
* ACCESS METHODS:
*/
virtual double getA() const;
virtual double getB() const;
virtual double getF() const;
virtual ossimDpt getMetersPerPixel() const;
/**
* Returns decimal degrees per pixel as an ossimDpt with
* "x" representing longitude and "y" representing latitude.
*/
virtual ossimDpt getDecimalDegreesPerPixel() const;
virtual const ossimDpt& getUlEastingNorthing() const;
virtual const ossimGpt& getUlGpt() const;
virtual const ossimDatum* getDatum() const;
virtual bool isGeographic()const;
/**
* Applies scale to theDeltaLonPerPixel, theDeltaLatPerPixel and
* theMetersPerPixel data members (eg: theDeltaLonPerPixel *= scale.x).
*
* @param scale Multiplier to be applied to theDeltaLonPerPixel,
* theDeltaLatPerPixel and theMetersPerPixel
*
* @param recenterTiePoint If true the will adjust the tie point by
* shifting the original tie to the upper left corner, applying scale,
* then shifting back by half of either the new
* theDeltaLat/lon or theMetersPerPixel depending on if projection
* isGeographic.
*/
virtual void applyScale(const ossimDpt& scale, bool recenterTiePoint);
/**
* SET METHODS:
*/
virtual void setEllipsoid(const ossimEllipsoid& ellipsoid);
virtual void setAB(double a, double b);
/**
* Sets theDatum to datum.
* Sets theEllipsiod to datum's ellipsiod.
* Calls update().
*/
virtual void setDatum(const ossimDatum* datum);
/**
* Sets theOrigin to origin.
* Sets theDatum to origin's datum.
* Sets theEllipsiod to datum's ellipsiod.
* Calls update().
*
* @param origin The projection origin.
*/
virtual void setOrigin(const ossimGpt& origin);
virtual void setMetersPerPixel(const ossimDpt& gsd);
virtual void setDecimalDegreesPerPixel(const ossimDpt& gsd);
virtual void setUlTiePoints(const ossimGpt& gpt);
virtual void setUlTiePoints(const ossimDpt& eastingNorthing);
virtual void setUlEastingNorthing(const ossimDpt& ulEastingNorthing);
virtual void setUlGpt(const ossimGpt& ulGpt);
virtual void assign( const ossimProjection &aProjection);
/**
* Method to save the state of an object to a keyword list.
* Return true if ok or false on error.
*/
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);
/**
* Prints data members to stream. Returns stream&.
*/
virtual std::ostream& print(std::ostream& out) const;
virtual bool operator==(const ossimProjection& projection) const;
/**
* This will go from the ground point and give
* you an approximate lat and lon per pixel. the Delta Lat
* and delta lon will be in degrees.
*/
virtual void computeDegreesPerPixel(const ossimGpt& ground,
const ossimDpt& metersPerPixel,
double &deltaLat,
double &deltaLon);
/**
* This will go from the ground point and give
* you an approximate meters per pixel. the Delta Lat
* and delta lon will be in degrees.
*/
virtual void computeMetersPerPixel(const ossimGpt& center,
double deltaDegreesPerPixelLat,
double deltaDegreesPerPixelLon,
ossimDpt &metersPerPixel);
/**
* This will go from its internal origin of latitude and longitude and give
* you an approximate meters per pixel. the Delta Lat
* and delta lon will be in degrees.
*/
virtual void computeMetersPerPixel(double deltaDegreesPerPixelLat,
double deltaDegreesPerPixelLon,
ossimDpt &metersPerPixel);
void setMatrix(double rotation,
const ossimDpt& scale,
const ossimDpt& translation);
void setMatrixScale(const ossimDpt& scale);
void setMatrixRotation(double rotation);
void setMatrixTranslation(const ossimDpt& translation);
/**
* Utility method to snap the tie point to some multiple.
*
* This is used to overcome inaccuracies in formats like NITF's rpc tag
* witch has a four digit decimal degree precision for the lat/lon offset.
*
* @param multiple Value to snap tie point to like 1.0.
*
* @param unitType OSSIM_METERS or OSSIM_DEGREES.
*
* EXAMPLE1:
* projection: ossimUtmProjection
* tie point is: 551634.88, 4492036.16
* multiple: 1.0
* unitType: OSSIM_METERS
* new tie point: 551635.00, 4492036.00
*
* EXAMPLE2:
* projection: ossimEquDistCylProjection
* tie point is: -90.3246343 42.0297589
* multiple: 0.0001
* unitType: OSSIM_DEGREES
* new tie point: -90.3246 42.0298
*/
void snapTiePointTo(ossim_float64 multiple, ossimUnitType unitType);
void snapTiePointToOrigin();
void setElevationLookupFlag(bool flag);
bool getElevationLookupFlag()const;
ossimUnitType getModelTransformUnitType()const
{
return theModelTransformUnitType;
}
void setModelTransformUnitType(ossimUnitType unit)
{
theModelTransformUnitType = unit;
}
bool hasModelTransform()const
{
return (theModelTransformUnitType != OSSIM_UNIT_UNKNOWN);
}
/**
* @brief Implementation of pure virtual
* ossimProjection::isAffectedByElevation method.
* @return false.
*/
virtual bool isAffectedByElevation() const { return false; }
protected:
/**
* This method verifies that the projection parameters match the current
* pcs code. If not this will set the pcs code to 0.
*
* @return true if match, false if not.
*/
bool verifyPcsCodeMatches() const;
ossimEllipsoid theEllipsoid;
ossimGpt theOrigin;
/**
* This is only set if we want to have built in datum shifting
*/
const ossimDatum* theDatum;
/**
* Holds the number of meters per pixel.
* x = easting
* y = northing
*/
ossimDpt theMetersPerPixel;
/**
* Hold the decimal degrees per pixel.
* x = longitude
* y = latitude
*/
ossimDpt theDegreesPerPixel;
/** Hold tie point in decimal degrees. */
ossimGpt theUlGpt;
/**
* Hold tie point as easting northing.
* x = easting,
* y = northing
*/
ossimDpt theUlEastingNorthing;
/**
* Hold the false easting northing.
* x = false easting,
* y = false northing
*/
ossimDpt theFalseEastingNorthing;
/** Projection Coordinate System(PCS) code. */
ossim_uint16 thePcsCode;
bool theElevationLookupFlag;
// Will always be a 4x4 matrix.
// note: only the first 2 dimensions will be used.
// if the size is 0 then it will not be used
//
ossimMatrix4x4 theModelTransform; // goes from image to model
ossimMatrix4x4 theInverseModelTransform; //goes from model back to image
// Output Units of the transform
//
ossimUnitType theModelTransformUnitType;
TYPE_DATA
};
#endif
|