35 static ossimTrace traceDebug(
"ossimMapProjection:debug");
42 :theEllipsoid(ellipsoid),
44 theDatum(origin.datum()),
46 theUlEastingNorthing(0, 0),
47 theFalseEastingNorthing(0, 0),
49 theElevationLookupFlag(false),
51 theInverseModelTransform(),
63 theEllipsoid(src.theEllipsoid),
64 theOrigin(src.theOrigin),
65 theDatum(src.theDatum),
66 theMetersPerPixel(src.theMetersPerPixel),
67 theDegreesPerPixel(src.theDegreesPerPixel),
68 theUlGpt(src.theUlGpt),
69 theUlEastingNorthing(src.theUlEastingNorthing),
70 theFalseEastingNorthing(src.theFalseEastingNorthing),
71 thePcsCode(src.thePcsCode),
72 theElevationLookupFlag(false),
73 theModelTransform(src.theModelTransform),
74 theInverseModelTransform(src.theInverseModelTransform),
75 theModelTransformUnitType(src.theModelTransformUnitType),
76 theProjectionUnits(src.theProjectionUnits)
182 if (!datum || (*
theDatum == *datum))
216 if(&aProjection!=
this)
292 ossimDpt mpt1(m[0][0]*ls1.
x + m[0][1]*ls1.
y + m[0][3],
293 m[1][0]*ls1.
x + m[1][1]*ls1.
y + m[1][3]);
294 ossimDpt mpt2(m[0][0]*ls2.
x + m[0][1]*ls2.
y + m[0][3],
295 m[1][0]*ls2.
x + m[1][1]*ls2.
y + m[1][3]);
296 ossimDpt mpt3(m[0][0]*ls3.
x + m[0][1]*ls3.
y + m[0][3],
297 m[1][0]*ls3.
x + m[1][1]*ls3.
y + m[1][3]);
309 len = (mpt1-mpt2).length();
310 len2 = (mpt1-mpt3).length();
321 len = (mpt1-mpt2).length();
322 len2 = (mpt1-mpt3).length();
341 bool recenterTiePoint)
345 if (recenterTiePoint)
366 if ( recenterTiePoint )
450 lineSample.
x = m[0][0]*modelPoint.
x + m[0][1]*modelPoint.
y + m[0][3];
451 lineSample.
y = m[1][0]*modelPoint.
x + m[1][1]*modelPoint.
y + m[1][3];
470 lineSample.
x = m[0][0]*modelPoint.
x + m[0][1]*modelPoint.
y + m[0][3];
471 lineSample.
y = m[1][0]*modelPoint.
x + m[1][1]*modelPoint.
y + m[1][3];
529 lineSample =
forward(worldPoint);
535 if(!lineSample.
isNan())
566 const double& hgtEllipsoid,
582 ossimDpt modelPoint(m[0][0]*lineSample.
x + m[0][1]*lineSample.
y + m[0][3],
583 m[1][0]*lineSample.
x + m[1][1]*lineSample.
y + m[1][3]);
627 gpt.
hgt = hgtEllipsoid;
653 gpt =
inverse(eastingNorthing);
666 gpt.
hgt = hgtEllipsoid;
762 if(!eastingNorthing.
isNan())
899 for(row = 0; row < 4; ++row)
901 for(col = 0; col < 4; ++col)
903 out << std::setprecision(20) << m[row][col] <<
" ";
990 getEntryNumber(lookup));
996 scale.
toPoint(std::string(lookup));
1027 <<
"ossimMapProjection::loadState WARNING!" 1028 <<
"Unhandled unit type for " 1031 getEntryString(units).c_str() )
1056 lookup = kwl.
find(prefix,
1063 lookup = kwl.
find(prefix,
1082 getEntryNumber(lookup));
1088 tie.
toPoint(std::string(lookup));
1119 <<
"ossimMapProjection::loadState WARNING!" 1120 <<
"Unhandled unit type for " 1123 getEntryString(units).c_str() )
1175 eastingNorthing.
toPoint(std::string(lookup));
1188 ut.
setValue(eastingNorthing.
x, en_units);
1190 ut.
setValue(eastingNorthing.
y, en_units);
1200 <<
"ossimMapProjection::loadState WARNING! Unhandled unit type for " 1238 pixelType=pixelType.
trim();
1267 getEntryNumber(lookup));
1273 if(modelTransform&&modelTransformUnit)
1280 for(row = 0; row < 4; ++row)
1282 for(col = 0; col < 4; ++col)
1305 getEntryNumber(modelTransformUnit));
1354 << __FILE__ <<
": " << __LINE__
1355 <<
"\nossimMapProjection::loadState ERROR: Origin is not set!" 1368 const char MODULE[] =
"ossimMapProjection::print";
1370 out << setiosflags(ios::fixed) << setprecision(15)
1371 <<
"\n// " << MODULE
1430 ossimDpt rightEastNorth = eastNorthGround;
1431 ossimDpt downEastNorth = eastNorthGround;
1457 #ifdef USE_OSSIMGPT_METERS_PER_DEGREE 1508 THIS SECTION IGNORED SINCE IT DEALS WITH IMAGE GEOMETRY, NOT MAP PROJECTION
1607 convertor.
setValue(multiple, unitType);
1615 convertor.
setValue(multiple, unitType);
1616 convertedMultiple = convertor.
getMeters();
1624 d = ossim::round<int>(d / convertedMultiple) * convertedMultiple;
1629 d = ossim::round<int>(d / convertedMultiple) * convertedMultiple;
1639 d = ossim::round<int>(d / convertedMultiple) * convertedMultiple;
1644 d = ossim::round<int>(d / convertedMultiple) * convertedMultiple;
ossimMatrix4x4 theModelTransform
virtual const ossimDpt & getDecimalDegreesPerPixel() const
Returns decimal degrees per pixel as an ossimDpt with "x" representing longitude and "y" representing...
virtual bool isEqualTo(const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
const NEWMAT::Matrix & getData() const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
static const char * MINOR_AXIS_KW
static const char * DECIMAL_DEGREES_PER_PIXEL_LAT
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
static const char * DATUM_KW
virtual double getFalseNorthing() const
static const char * FALSE_EASTING_NORTHING_UNITS_KW
bool isEqualTo(const ossimDpt &rhs, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
double lond() const
Will convert the radian measure to degrees.
static const char * CENTRAL_MERIDIAN_KW
Represents serializable keyword/value map.
bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
static ossimDatumFactoryRegistry * instance()
instance method
const char * find(const char *key) const
virtual ossim_uint32 getPcsCode() const
Returns the EPSG PCS code or 32767 if the projection is a custom (non-EPSG) projection.
virtual void setEllipsoid(const ossimEllipsoid &ellipsoid)
SET METHODS:
virtual ossimString getEntryString(ossim_int32 entry_number) const
virtual std::ostream & print(std::ostream &out) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
virtual bool isEqualTo(const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
static const char * ORIGINAL_MAP_UNITS_KW
double nan()
Method to return ieee floating point double precision NAN.
virtual double getF() const
static const char * IMAGE_MODEL_TRANSFORM_MATRIX_KW
void clampLon(double low, double high)
virtual ossimDpt worldToLineSample(const ossimGpt &worldPoint) const
virtual void computeMetersPerPixel()
This will go from the ground point and give you an approximate meters per pixel.
virtual void setOrigin(const ossimGpt &origin)
Sets theOrigin to origin.
bool contains(char aChar) const
ossimDpt theUlEastingNorthing
Hold tie point as easting northing.
virtual const ossimString & code() const
static ossimString toString(bool aValue)
Numeric to string methods.
static const char * TIE_POINT_LON_KW
virtual bool isGeographic() const
virtual ossim_int32 getEntryNumber(const char *entry_string, bool case_insensitive=true) const
ossim_float64 hgt
Height in meters above the ellipsiod.
virtual ossimString getClassName() const
virtual void setDecimalDegreesPerPixel(const ossimDpt &gsd)
ossim_uint32 toUInt32() const
static ossimElevManager * instance()
METHOD: instance() Implements singelton pattern.
virtual double getStandardParallel2() const
Derived classes should implement as needed.
virtual double getB() const
ossimGpt theUlGpt
Hold tie point in decimal degrees.
ossim_uint32 findProjectionCode(const ossimString &projection_name) const
Given a projection name, assigns the group (e.g., "EPSG") and code of the projection.
double latd() const
Will convert the radian measure to degrees.
virtual void applyScale(const ossimDpt &scale, bool recenterTiePoint)
Applies scale to theDeltaLonPerPixel, theDeltaLatPerPixel and theMetersPerPixel data members (eg: the...
static const char * METERS_PER_PIXEL_Y_KW
static const char * TYPE_KW
virtual ossimGpt inverse(const ossimDpt &projectedPoint) const =0
Will take a point in meters and convert it to ground.
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
ossimMatrix4x4 theInverseModelTransform
virtual double getStandardParallel1() const
Derived classes should implement as needed.
virtual void setUlGpt(const ossimGpt &ulGpt)
virtual void setMetersPerPixel(const ossimDpt &gsd)
const ossimDatum * datum() const
datum().
void snapTiePointTo(ossim_float64 multiple, ossimUnitType unitType)
Utility method to snap the tie point to some multiple.
static const char * PIXEL_SCALE_XY_KW
bool theElevationLookupFlag
static const char * ELEVATION_LOOKUP_FLAG_KW
static const char * TIE_POINT_NORTHING_KW
virtual bool isEqualTo(const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual bool isEqualTo(const ossimEllipsoid &rhs, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
virtual ossimGpt lineSampleToWorld(const ossimDpt &projectedPoint) const
ossimDpt theMetersPerPixel
Holds the number of meters per pixel.
bool hasModelTransform() const
ossimUnitType theModelTransformUnitType
virtual bool operator==(const ossimProjection &projection) const
Compares this to arg projection and returns TRUE if the same.
virtual const ossimDatum * getDatum() const
static const char * TIE_POINT_XY_KW
bool isEqualTo(const ossimGpt &rhs, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
static const char * TIE_POINT_EASTING_KW
virtual void setUlEastingNorthing(const ossimDpt &ulEastingNorthing)
virtual void setPcsCode(ossim_uint32 pcsCode)
virtual void lineSampleToEastingNorthing(const ossimDpt &liineSample, ossimDpt &eastingNorthing) const
static const char * FALSE_NORTHING_KW
static ossimEpsgProjectionDatabase * instance()
Instantiates singleton instance of this class:
virtual double getHeightAboveEllipsoid(const ossimGpt &gpt)
virtual void assign(const ossimProjection &aProjection)
static const char * MAJOR_AXIS_KW
bool toBool() const
String to numeric methods.
const double & getA() const
virtual ossimString getProjectionName() const
Returns the projection name.
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
unsigned int ossim_uint32
virtual const ossimDatum * create(const ossimString &code) const
create method
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
void toPoint(const std::string &s)
Initializes this point from string.
virtual const ossimEllipsoid * ellipsoid() const
ossim_float64 toFloat64() const
static ossimDatumFactory * instance()
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
static const char * FALSE_EASTING_KW
static const char * DECIMAL_DEGREES_PER_PIXEL_LON
static const char * IMAGE_MODEL_TRANSFORM_UNIT_KW
void clampLat(double low, double high)
static ossimString downcase(const ossimString &aString)
static const char * FALSE_EASTING_NORTHING_KW
ossimUnitType theProjectionUnits
Linear units of the projection as indicated in the projection's specification:
virtual const ossimGpt & getUlGpt() const
const ossimGpt & getOrigin() const
virtual ossimDpt forward(const ossimGpt &worldPoint) const =0
All map projections will convert the world coordinate to an easting northing (Meters).
static const char * ORIGIN_LATITUDE_KW
virtual double getFalseEasting() const
ossim_uint32 thePcsCode
Projection Coordinate System(PCS) code.
static const char * PCS_CODE_KW
void snapTiePointToOrigin()
virtual ~ossimMapProjection()
ossimString toString(ossim_uint32 precision=15) const
bool getElevationLookupFlag() const
void updateFromTransform()
const double & getB() const
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
static const char * PIXEL_TYPE_KW
RTTI_DEF1(ossimMapProjection, "ossimMapProjection", ossimProjection)
virtual void setAB(double a, double b)
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
virtual void eastingNorthingToLineSample(const ossimDpt &eastingNorthing, ossimDpt &lineSample) const
bool isEqualTo(const ossimMatrix4x4 &rhs, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual void setUlTiePoints(const ossimGpt &gpt)
ossimDpt metersPerDegree() const
const double & getFlattening() const
static const char * TIE_POINT_LAT_KW
virtual const ossimDpt & getUlEastingNorthing() const
ossimEllipsoid theEllipsoid
This method verifies that the projection parameters match the current pcs code.
const ossimDatum * wgs84() const
std::basic_istringstream< char > istringstream
Class for char input memory streams.
ossimDpt theFalseEastingNorthing
Hold the false easting northing.
virtual void setDatum(const ossimDatum *datum)
Sets theDatum to datum.
virtual ossimDpt getMetersPerPixel() const
virtual void eastingNorthingToWorld(const ossimDpt &eastingNorthing, ossimGpt &worldPt) const
virtual void computeDegreesPerPixel()
Computes the approximate resolution in degrees/pixel.
virtual void lineSampleHeightToWorld(const ossimDpt &lineSampPt, const double &heightAboveEllipsoid, ossimGpt &worldPt) const
This is the pure virtual that projects the image point to the given elevation above ellipsoid...
void setElevationLookupFlag(bool flag)
static ossimUnitTypeLut * instance()
Returns the static instance of an ossimUnitTypeLut object.
virtual std::ostream & print(std::ostream &out) const
Prints data members to stream.
virtual double getA() const
ACCESS METHODS:
static const char * METERS_PER_PIXEL_X_KW
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
static const char * SRS_NAME_KW
std::basic_ostream< char > ostream
Base class for char output streams.
static const char * PIXEL_SCALE_UNITS_KW
static const char * TIE_POINT_UNITS_KW
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.